dev/279 - When Merging two contacts flip, prev, next not working
[civicrm-core.git] / install / civicrm.php
index 50e42710811059fb85a438bcf007c5259777be22..bc0e608f2382e95dd829a016f7358feb4a91a314 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
@@ -84,8 +84,7 @@ function civicrm_main(&$config) {
 
   if ($installType == 'drupal') {
     $siteDir = isset($config['site_dir']) ? $config['site_dir'] : getSiteDir($cmsPath, $_SERVER['SCRIPT_FILENAME']);
-    civicrm_setup($cmsPath . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR .
-      $siteDir . DIRECTORY_SEPARATOR . 'files'
+    civicrm_setup($cmsPath . DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . $siteDir . DIRECTORY_SEPARATOR . 'files'
     );
   }
   elseif ($installType == 'backdrop') {
@@ -139,7 +138,6 @@ function civicrm_main(&$config) {
   civicrm_write_file($configFile,
     $string
   );
-
 }
 
 /**
@@ -217,6 +215,9 @@ function civicrm_config(&$config) {
   global $compileDir;
   global $tplPath, $installType;
 
+  // Ex: $extraSettings[] = '$civicrm_settings["domain"]["foo"] = "bar";';
+  $extraSettings = array();
+
   $params = array(
     'crmRoot' => $crmPath,
     'templateCompileDir' => $compileDir,
@@ -274,6 +275,18 @@ function civicrm_config(&$config) {
 
     // CRM-12386
     $params['crmRoot'] = addslashes($params['crmRoot']);
+    //CRM-16421
+
+    $extraSettings[] = sprintf('$civicrm_paths[\'wp.frontend.base\'][\'url\'] = %s;', var_export(home_url() . '/', 1));
+    $extraSettings[] = sprintf('$civicrm_paths[\'wp.backend.base\'][\'url\'] = %s;', var_export(admin_url(), 1));
+    $extraSettings[] = sprintf('$civicrm_setting[\'URL Preferences\'][\'userFrameworkResourceURL\'] = %s;', var_export(plugin_dir_url(CIVICRM_PLUGIN_FILE) . 'civicrm', 1));
+  }
+
+  if ($extraSettings) {
+    $params['extraSettings'] = "Additional settings generated by installer:\n" . implode("\n", $extraSettings);
+  }
+  else {
+    $params['extraSettings'] = "";
   }
 
   $params['siteKey'] = md5(rand() . mt_rand() . rand() . uniqid('', TRUE) . $params['baseURL']);