Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263924

Change subject: Partial backport of DB initialisation fixes.
......................................................................

Partial backport of DB initialisation fixes.

This complements https://gerrit.wikimedia.org/r/256152 in backporting 
improvements to not calling set utf names too often. The initial backport patch 
did not include some other changes in core with the result being that the 
setfactoryclass was being called in the 4.6 code location & the 4.7 one - ie. 
twice. This fixes that. It is part of the larger patch
: 
https://github.com/civicrm/civicrm-core/commit/635f0b8655fb0b77ba882cde2081e5055326d175
 which is part of a larger refactor. I would not want to backport that patch as 
a whole as there might be other dependencies in it.

Bug: T116724
Change-Id: Ic7ef3a409081edb865724662b123874879b0920b
---
M CRM/Core/Config.php
1 file changed, 1 insertion(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/24/263924/1

diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php
index 14bc537..6cbb65e 100644
--- a/CRM/Core/Config.php
+++ b/CRM/Core/Config.php
@@ -121,13 +121,6 @@
   public $customPHPPathDir;
 
   /**
-   * The factory class used to instantiate our DB objects
-   *
-   * @var string
-   */
-  private $DAOFactoryClass = 'CRM_Contact_DAO_Factory';
-
-  /**
    * The handle to the log that we are using
    * @var object
    */
@@ -381,7 +374,7 @@
       exit();
     }
 
-    $this->_initDAO();
+    CRM_Core_DAO::init($this->dsn);
 
     if (defined('CIVICRM_UF')) {
       $this->userFramework = CIVICRM_UF;
@@ -399,22 +392,6 @@
     // between CRM_Core_Config and CRM_Core_Component (they
     // are co-dependant)
     $this->componentRegistry = new CRM_Core_Component();
-  }
-
-  /**
-   * Initialize the DataObject framework.
-   *
-   * @return void
-   */
-  private function _initDAO() {
-    CRM_Core_DAO::init($this->dsn);
-
-    $factoryClass = $this->DAOFactoryClass;
-    require_once str_replace('_', DIRECTORY_SEPARATOR, $factoryClass) . '.php';
-    CRM_Core_DAO::setFactory(new $factoryClass());
-    if (CRM_Utils_Constant::value('CIVICRM_MYSQL_STRICT', 
CRM_Utils_System::isDevelopment())) {
-      CRM_Core_DAO::executeQuery('SET SESSION sql_mode = STRICT_TRANS_TABLES');
-    }
   }
 
   /**

-- 
To view, visit https://gerrit.wikimedia.org/r/263924
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7ef3a409081edb865724662b123874879b0920b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to