X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=install%2Fcivicrm.php;h=8438e850fa27c9899139fb3332b9f35e68985029;hb=e2ec8bbd52347164d7383b6c11fbd41370467d60;hp=05724e8af04003fb43d6e467831cd67be059c7a5;hpb=c15fb38374462a40d704d83fac983412df8a16a1;p=civicrm-core.git diff --git a/install/civicrm.php b/install/civicrm.php index 05724e8af0..8438e850fa 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -36,6 +36,13 @@ function civicrm_setup($filesDirectory) { global $crmPath, $sqlPath, $pkgPath, $tplPath; global $compileDir; + // Setup classloader + // This is needed to allow CiviCRM to be installed by drush. + // TODO: move to civicrm.drush.inc drush_civicrm_install() + global $crmPath; + require_once $crmPath . '/CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + $sqlPath = $crmPath . DIRECTORY_SEPARATOR . 'sql'; $tplPath = $crmPath . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR; @@ -228,7 +235,8 @@ function civicrm_config(&$config) { $params['crmRoot'] = addslashes($params['crmRoot']); } - $params['siteKey'] = md5(uniqid('', TRUE) . $params['baseURL']); + $params['siteKey'] = md5(rand() . mt_rand() . rand() . uniqid('', TRUE) . $params['baseURL']); + // Would prefer openssl_random_pseudo_bytes(), but I don't think it's universally available. $str = file_get_contents($tplPath . 'civicrm.settings.php.template'); foreach ($params as $key => $value) {