From 4046d16793f8de02de8e1c3497752a0934bcf7e1 Mon Sep 17 00:00:00 2001 From: CiviCRM Date: Fri, 30 May 2014 16:23:30 +0530 Subject: [PATCH] CRM-13584 reverted change ---------------------------------------- * CRM-13584: Localising the CiviCRM installation https://issues.civicrm.org/jira/browse/CRM-13584 --- install/civicrm.php | 7 +++ install/index.php | 101 +++++++++++++-------------------- install/template.html | 129 ++++++++++++++++++------------------------ 3 files changed, 99 insertions(+), 138 deletions(-) diff --git a/install/civicrm.php b/install/civicrm.php index dd189db3b1..debefb2925 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -36,6 +36,12 @@ function civicrm_setup($filesDirectory) { global $crmPath, $sqlPath, $pkgPath, $tplPath; global $compileDir; + $pkgPath = $crmPath . DIRECTORY_SEPARATOR . 'packages'; + set_include_path($crmPath . PATH_SEPARATOR . + $pkgPath . PATH_SEPARATOR . + get_include_path() + ); + $sqlPath = $crmPath . DIRECTORY_SEPARATOR . 'sql'; $tplPath = $crmPath . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR; @@ -129,6 +135,7 @@ function civicrm_main(&$config) { */ function civicrm_source($dsn, $fileName, $lineMode = FALSE) { global $crmPath; + require_once "$crmPath/packages/DB.php"; $db = DB::connect($dsn); diff --git a/install/index.php b/install/index.php index 174a0a5c09..9516dd56bc 100644 --- a/install/index.php +++ b/install/index.php @@ -58,10 +58,8 @@ if (!in_array($installType, array( } global $crmPath; -global $pkgPath; global $installDirPath; global $installURLPath; - if ($installType == 'drupal') { $crmPath = dirname(dirname($_SERVER['SCRIPT_FILENAME'])); $installDirPath = $installURLPath = ''; @@ -69,16 +67,11 @@ if ($installType == 'drupal') { elseif ($installType == 'wordpress') { $crmPath = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR; $installDirPath = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR; + $installURLPath = WP_PLUGIN_URL . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR; } -$pkgPath = $crmPath . DIRECTORY_SEPARATOR . 'packages'; - -set_include_path( - $crmPath . PATH_SEPARATOR . - $pkgPath . PATH_SEPARATOR . - get_include_path() -); +set_include_path(get_include_path() . PATH_SEPARATOR . $crmPath); require_once $crmPath . '/CRM/Core/ClassLoader.php'; CRM_Core_ClassLoader::singleton()->register(); @@ -86,10 +79,12 @@ CRM_Core_ClassLoader::singleton()->register(); $docLink = CRM_Utils_System::docURL2('Installation and Upgrades', FALSE, 'Installation Guide',NULL,NULL,"wiki"); if ($installType == 'drupal') { - // Lets check only /modules/. + //lets check only /modules/. $pattern = '/' . preg_quote(CIVICRM_DIRECTORY_SEPARATOR . 'modules', CIVICRM_DIRECTORY_SEPARATOR) . '/'; - if (!preg_match($pattern, str_replace("\\", "/", $_SERVER['SCRIPT_FILENAME']))) { + if (!preg_match($pattern, + str_replace("\\", "/", $_SERVER['SCRIPT_FILENAME']) + )) { $errorTitle = "Oops! Please Correct Your Install Location"; $errorMsg = "Please untar (uncompress) your downloaded copy of CiviCRM in the " . implode(CIVICRM_DIRECTORY_SEPARATOR, array( 'sites', 'all', 'modules')) . " directory below your Drupal root directory. Refer to the online " . $docLink . " for more information."; @@ -135,30 +130,14 @@ foreach ($langs as $locale => $_) { if ($locale == 'en_US') { continue; } - if (!file_exists(implode(CIVICRM_DIRECTORY_SEPARATOR, array($crmPath, 'sql', "civicrm_data.$locale.mysql")))) { - unset($langs[$locale]); - } + if (!file_exists(implode(CIVICRM_DIRECTORY_SEPARATOR, array($crmPath, 'sql', "civicrm_data.$locale.mysql"))))unset($langs[$locale]); } -// Set the locale (works with both native gettext and phpgettext) -define('CIVICRM_UF', 'Drupal'); -define('CIVICRM_GETTEXT_NATIVE', 1); -global $tsLocale; - -$tsLocale = 'en_US'; $seedLanguage = 'en_US'; - if (isset($_REQUEST['seedLanguage']) and isset($langs[$_REQUEST['seedLanguage']])) { $seedLanguage = $_REQUEST['seedLanguage']; - $tsLocale = $_REQUEST['seedLanguage']; } -$config = CRM_Core_Config::singleton(FALSE); - -// The translation files are in the parent directory (l10n) -$config->gettextResourceDir = '..' . DIRECTORY_SEPARATOR . $config->gettextResourceDir; -$i18n = CRM_Core_I18n::singleton(); - global $cmsPath; if ($installType == 'drupal') { //CRM-6840 -don't force to install in sites/all/modules/ @@ -296,16 +275,16 @@ class InstallRequirements { function checkdatabase($databaseConfig, $dbName) { if ($this->requireFunction('mysql_connect', array( - ts("PHP Configuration"), - ts("MySQL support"), - ts("MySQL support not included in PHP."), + "PHP Configuration", + "MySQL support", + "MySQL support not included in PHP.", ) )) { $this->requireMySQLServer($databaseConfig['server'], array( - ts("MySQL %1 Configuration", array(1 => $dbName)), - ts("Does the server exist?"), - ts("Can't find the a MySQL server on '%1'", array(1 => $databaseConfig['server'])), + "MySQL $dbName Configuration", + "Does the server exist", + "Can't find the a MySQL server on '$databaseConfig[server]'", $databaseConfig['server'], ) ); @@ -313,15 +292,15 @@ class InstallRequirements { $databaseConfig['username'], $databaseConfig['password'], array( - ts("MySQL %1 Configuration", array(1 => $dbName)), - ts("Are the access credentials correct?"), - ts("That username/password doesn't work"), + "MySQL $dbName Configuration", + "Are the access credentials correct", + "That username/password doesn't work", ) )) { @$this->requireMySQLVersion("5.1", array( - ts("MySQL %1 Configuration", array(1 => $dbName)), - ts("MySQL version at least %1", array(1 => '5.1')), + "MySQL $dbName Configuration", + "MySQL version at least 5.1", "MySQL version 5.1 or higher is required, you only have ", "MySQL " . mysql_get_server_info(), ) @@ -413,14 +392,14 @@ class InstallRequirements { $this->errors = NULL; - $this->requirePHPVersion('5.3.3', array(ts("PHP Configuration"), ts("PHP5 installed"), NULL, ts("PHP version %1", array(1 => phpversion())))); + $this->requirePHPVersion('5.3.3', array("PHP Configuration", "PHP5 installed", NULL, "PHP version " . phpversion())); // Check that we can identify the root folder successfully $this->requireFile($crmPath . CIVICRM_DIRECTORY_SEPARATOR . 'README.txt', array( - ts("File permissions"), - ts("Does the webserver know where files are stored?"), - ts("The webserver isn't letting me identify where files are stored."), + "File permissions", + "Does the webserver know where files are stored?", + "The webserver isn't letting me identify where files are stored.", $this->getBaseDir(), ), TRUE @@ -429,9 +408,9 @@ class InstallRequirements { // CRM-6485: make sure the path does not contain PATH_SEPARATOR, as we don’t know how to escape it $this->requireNoPathSeparator( array( - ts('File permissions'), - ts('Does the CiviCRM path contain PATH_SEPARATOR?'), - ts('The %1 path contains the PATH_SEPARATOR (the %2 character)', array(1 => $this->getBaseDir(), 2 => PATH_SEPARATOR)), + 'File permissions', + 'does the CiviCRM path contain PATH_SEPARATOR?', + 'the ' . $this->getBaseDir() . ' path contains PATH_SEPARATOR (the ' . PATH_SEPARATOR . ' character)', $this->getBaseDir(), ) ); @@ -440,11 +419,7 @@ class InstallRequirements { foreach ($requiredDirectories as $dir) { $this->requireFile($crmPath . CIVICRM_DIRECTORY_SEPARATOR . $dir, array( - ts("File permissions"), - ts("%1: folder exists", array(1 => $dir)), - ts("%1: folder is missing", array(1 => $dir)), - ), - TRUE + "File permissions", "$dir folder exists", "There is no $dir folder"), TRUE ); } @@ -472,7 +447,7 @@ class InstallRequirements { foreach ($writableDirectories as $dir) { $dirName = CIVICRM_WINDOWS ? $dir : CIVICRM_DIRECTORY_SEPARATOR . $dir; $this->requireWriteable($dirName, - array(ts("File permissions"), ts("Is the %1 folder writeable?", array(1 => $dir)), NULL), + array("File permissions", "Is the $dir folder writeable?", NULL), TRUE ); } @@ -496,7 +471,7 @@ class InstallRequirements { } if ($webserver == '') { - $webserver = ts("I can't tell what webserver you are running"); + $webserver = "I can't tell what webserver you are running"; } // Check for $_SERVER configuration @@ -504,17 +479,17 @@ class InstallRequirements { // Check for MySQL support $this->requireFunction('mysql_connect', - array(ts("PHP Configuration"), ts("MySQL support"), ts("MySQL support not included in PHP.")) + array("PHP Configuration", "MySQL support", "MySQL support not included in PHP.") ); // Check for JSON support $this->requireFunction('json_encode', - array(ts("PHP Configuration"), ts("JSON support"), ts("JSON support not included in PHP.")) + array("PHP Configuration", "JSON support", "JSON support not included in PHP.") ); // Check for xcache_isset and emit warning if exists $this->checkXCache(array( - ts("PHP Configuration"), + "PHP Configuration", "XCache compatibility", "XCache is installed and there are known compatibility issues between XCache and CiviCRM. Consider using an alternative PHP caching mechanism or disable PHP caching altogether.", )); @@ -523,9 +498,9 @@ class InstallRequirements { $this->requireMemory(32 * 1024 * 1024, 64 * 1024 * 1024, array( - ts("PHP Configuration"), - ts("Memory allocated (PHP config option 'memory_limit')"), - ts("CiviCRM needs a minimum of 32M allocated to PHP, but recommends 64M."), + "PHP Configuration", + "Memory allocated (PHP config option 'memory_limit')", + "CiviCRM needs a minimum of 32M allocated to PHP, but recommends 64M.", ini_get("memory_limit"), ) ); @@ -543,15 +518,15 @@ class InstallRequirements { $mem = $this->getPHPMemory(); if ($mem < $min && $mem > 0) { - $testDetails[2] .= " " . ts("You only have %1 of memory allocated", array(1 => ini_get("memory_limit"))); + $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated"; $this->error($testDetails); } elseif ($mem < $recommended && $mem > 0) { - $testDetails[2] .= " " . ts("You only have %1 of memory allocated", array(1 => ini_get("memory_limit"))); + $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated"; $this->warning($testDetails); } elseif ($mem == 0) { - $testDetails[2] .= " " . ts("We can't determine how much memory you have allocated. Install only if you're sure you've allocated at least 20 MB."); + $testDetails[2] .= " We can't determine how much memory you have allocated. Install only if you're sure you've allocated at least 20 MB."; $this->warning($testDetails); } } @@ -579,7 +554,7 @@ class InstallRequirements { function listErrors() { if ($this->errors) { - echo "

" . ts("The following problems are preventing me from installing CiviCRM:") . "

"; + echo "

The following problems are preventing me from installing CiviCRM:

"; foreach ($this->errors as $error) { echo "
  • " . htmlentities($error) . "
  • "; } diff --git a/install/template.html b/install/template.html index d9ace3f94d..6202e9ff29 100644 --- a/install/template.html +++ b/install/template.html @@ -2,116 +2,95 @@ -<?php echo ts('CiviCRM Installer'); ?> +CiviCRM Installer /> -
    -
    Version
    +
    Version
    /> -
    - -

    -

    - +
    +

    CiviCRM Installer

    +
    Thanks for choosing to use CiviCRM! Please follow the instructions below to get CiviCRM installed.
    +

    - -

    see below for details.'); ?>

    +

    We are not able to install the software. Please see below for details.

    - hasWarnings()) { ?> -

    - hasErrors()) { ?> -

    - +hasWarnings()) { ?> +

    There are some issues that we recommend you look at before installing, however, you are still able to install the software. Please see below for details.

    -

    - +hasErrors()) { ?> +

    You're ready to install!    +

    + + + +

    + -

    +

    -

    - -

    Learn more about using CiviCRM in other languages.', array(1 => 'http://wiki.civicrm.org/confluence/pages/viewpage.action?pageId=88408149')); ?>

    - - -

    - - - - - - -

    - -

    +

    Database Version and Connection Settings

    - +CiviCRM stores its content in a MySQL database. Please provide the username +and password to connect to the server here. If this account has permission to create databases, then we will +create the database for you; otherwise, you must give the name of a database that already exists.

    hasErrors()) { ?> -

    Database Details below for specific errors.", array(1 => '#dbDetails')); ?>

    +

    Your database settings don't appear to be correct. Please check the Database Details below for specific errors.

    -

    +

    Database version and connection settings have been verified and look correct!

    -

    -
    -
    -
    -
    +

    CiviCRM Database Settings

    +

    +
    +
    +
    +

    -

    +

    Drupal Database Settings

    -
    -
    -
    -
    +
    +
    +
    +

    -

    - -

    +

    Other Settings

    +

    + + + + +

    Check this box to pre-populate CiviCRM with sample English contact records, online contribution pages, profile forms, etc. These examples can help you learn about CiviCRM features.

    -- 2.25.1