Commit 56fdfc52 authored by totten's avatar totten

INFRA-132 - bin, extern, install, settings, xml - PHPStorm cleanup

parent 92915c55
...@@ -190,9 +190,9 @@ class CiviContributeProcessor { ...@@ -190,9 +190,9 @@ class CiviContributeProcessor {
$dao->trxn_id = $value; $dao->trxn_id = $value;
if ($dao->find(TRUE)) { if ($dao->find(TRUE)) {
preg_match('/(\d+)$/', $name, $matches); preg_match('/(\d+)$/', $name, $matches);
$seq = $matches[1]; $seq = $matches[1];
$email = $result["l_email{$seq}"]; $email = $result["l_email{$seq}"];
$amt = $result["l_amt{$seq}"]; $amt = $result["l_amt{$seq}"];
CRM_Core_Error::debug_log_message("Skipped (already recorded) - $email, $amt, $value ..<p>", TRUE); CRM_Core_Error::debug_log_message("Skipped (already recorded) - $email, $amt, $value ..<p>", TRUE);
continue; continue;
} }
...@@ -234,9 +234,9 @@ class CiviContributeProcessor { ...@@ -234,9 +234,9 @@ class CiviContributeProcessor {
} }
} }
if ($result['l_errorcode0'] == '11002') { if ($result['l_errorcode0'] == '11002') {
$end = $result['l_timestamp99']; $end = $result['l_timestamp99'];
$end_time = strtotime("{$end}", time()); $end_time = strtotime("{$end}", time());
$end_date = date('Y-m-d\T00:00:00.00\Z', $end_time); $end_date = date('Y-m-d\T00:00:00.00\Z', $end_time);
$args['enddate'] = $end_date; $args['enddate'] = $end_date;
} }
} while ($result['l_errorcode0'] == '11002'); } while ($result['l_errorcode0'] == '11002');
...@@ -272,8 +272,8 @@ class CiviContributeProcessor { ...@@ -272,8 +272,8 @@ class CiviContributeProcessor {
if (is_array($response[1][$response[0]]['notifications']['charge-amount-notification'])) { if (is_array($response[1][$response[0]]['notifications']['charge-amount-notification'])) {
if (array_key_exists('google-order-number', if (array_key_exists('google-order-number',
$response[1][$response[0]]['notifications']['charge-amount-notification'] $response[1][$response[0]]['notifications']['charge-amount-notification']
)) { )) {
// sometimes 'charge-amount-notification' itself is an absolute // sometimes 'charge-amount-notification' itself is an absolute
// array and not array of arrays. This is the case when there is only one // array and not array of arrays. This is the case when there is only one
// charge-amount-notification. Hack for this special case - // charge-amount-notification. Hack for this special case -
...@@ -283,10 +283,10 @@ class CiviContributeProcessor { ...@@ -283,10 +283,10 @@ class CiviContributeProcessor {
} }
foreach ($response[1][$response[0]]['notifications']['charge-amount-notification'] foreach ($response[1][$response[0]]['notifications']['charge-amount-notification']
as $amtData as $amtData
) { ) {
$searchParams = array( $searchParams = array(
'order-numbers' => array($amtData['google-order-number']['VALUE']), 'order-numbers' => array($amtData['google-order-number']['VALUE']),
'notification-types' => array('risk-information', 'new-order', 'charge-amount'), 'notification-types' => array('risk-information', 'new-order', 'charge-amount'),
); );
$response = CRM_Core_Payment_Google::invokeAPI($paymentProcessor, $response = CRM_Core_Payment_Google::invokeAPI($paymentProcessor,
...@@ -323,9 +323,9 @@ class CiviContributeProcessor { ...@@ -323,9 +323,9 @@ class CiviContributeProcessor {
static static
function csv() { function csv() {
$csvFile = '/home/deepak/Desktop/crm-4247.csv'; $csvFile = '/home/deepak/Desktop/crm-4247.csv';
$delimiter = ";"; $delimiter = ";";
$row = 1; $row = 1;
$handle = fopen($csvFile, "r"); $handle = fopen($csvFile, "r");
if (!$handle) { if (!$handle) {
......
...@@ -50,7 +50,7 @@ function initialize() { ...@@ -50,7 +50,7 @@ function initialize() {
function run() { function run() {
initialize(); initialize();
$fh = fopen('php://output', 'w'); $fh = fopen('php://output', 'w');
$rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs(); $rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
if (!empty($rows)) { if (!empty($rows)) {
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
* base class for doing all command line operations via civicrm * base class for doing all command line operations via civicrm
* used by cli.php * used by cli.php
**/ **/
class civicrm_cli { class civicrm_cli {
// required values that must be passed // required values that must be passed
// via the command line // via the command line
...@@ -138,7 +137,7 @@ class civicrm_cli { ...@@ -138,7 +137,7 @@ class civicrm_cli {
// find the value of this arg // find the value of this arg
if (preg_match('/=/', $arg)) { if (preg_match('/=/', $arg)) {
$parts = explode('=', $arg); $parts = explode('=', $arg);
$arg = $parts[0]; $arg = $parts[0];
$value = $parts[1]; $value = $parts[1];
} }
else { else {
...@@ -199,7 +198,7 @@ class civicrm_cli { ...@@ -199,7 +198,7 @@ class civicrm_cli {
$_SERVER['HTTP_HOST'] = $this->_site; $_SERVER['HTTP_HOST'] = $this->_site;
$_SERVER['REMOTE_ADDR'] = "127.0.0.1"; $_SERVER['REMOTE_ADDR'] = "127.0.0.1";
$_SERVER['SERVER_SOFTWARE'] = NULL; $_SERVER['SERVER_SOFTWARE'] = NULL;
$_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['REQUEST_METHOD'] = 'GET';
// SCRIPT_FILENAME needed by CRM_Utils_System::cmsRootPath // SCRIPT_FILENAME needed by CRM_Utils_System::cmsRootPath
$_SERVER['SCRIPT_FILENAME'] = __FILE__; $_SERVER['SCRIPT_FILENAME'] = __FILE__;
...@@ -224,9 +223,9 @@ class civicrm_cli { ...@@ -224,9 +223,9 @@ class civicrm_cli {
// Now we have a Config object, we can set it from the Base URL. // Now we have a Config object, we can set it from the Base URL.
if ($_SERVER['HTTP_HOST'] == 'localhost') { if ($_SERVER['HTTP_HOST'] == 'localhost') {
$_SERVER['HTTP_HOST'] = preg_replace( $_SERVER['HTTP_HOST'] = preg_replace(
'!^https?://([^/]+)/$!i', '!^https?://([^/]+)/$!i',
'$1', '$1',
$this->_config->userFrameworkBaseURL); $this->_config->userFrameworkBaseURL);
} }
$class = 'CRM_Utils_System_' . $this->_config->userFramework; $class = 'CRM_Utils_System_' . $this->_config->userFramework;
...@@ -314,7 +313,6 @@ class civicrm_cli { ...@@ -314,7 +313,6 @@ class civicrm_cli {
* class used by csv/export.php to export records from * class used by csv/export.php to export records from
* the database in a csv file format. * the database in a csv file format.
**/ **/
class civicrm_cli_csv_exporter extends civicrm_cli { class civicrm_cli_csv_exporter extends civicrm_cli {
var $separator = ','; var $separator = ',';
...@@ -358,7 +356,6 @@ class civicrm_cli_csv_exporter extends civicrm_cli { ...@@ -358,7 +356,6 @@ class civicrm_cli_csv_exporter extends civicrm_cli {
* records based on those found in a csv file * records based on those found in a csv file
* passed to the script. * passed to the script.
**/ **/
class civicrm_cli_csv_file extends civicrm_cli { class civicrm_cli_csv_file extends civicrm_cli {
var $header; var $header;
var $separator = ','; var $separator = ',';
...@@ -432,7 +429,6 @@ class civicrm_cli_csv_file extends civicrm_cli { ...@@ -432,7 +429,6 @@ class civicrm_cli_csv_file extends civicrm_cli {
* used by csv/import.php * used by csv/import.php
* *
**/ **/
class civicrm_cli_csv_importer extends civicrm_cli_csv_file { class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
/** /**
* @param array $params * @param array $params
...@@ -453,7 +449,6 @@ class civicrm_cli_csv_importer extends civicrm_cli_csv_file { ...@@ -453,7 +449,6 @@ class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
* used by csv/delete.php * used by csv/delete.php
* *
**/ **/
class civicrm_cli_csv_deleter extends civicrm_cli_csv_file { class civicrm_cli_csv_deleter extends civicrm_cli_csv_file {
/** /**
* @param array $params * @param array $params
......
...@@ -132,9 +132,9 @@ LEFT JOIN civicrm_event event ON ( event.id = participant.event_id ) ...@@ -132,9 +132,9 @@ LEFT JOIN civicrm_event event ON ( event.id = participant.event_id )
$transaction = new CRM_Core_Transaction(); $transaction = new CRM_Core_Transaction();
require_once 'CRM/Event/BAO/Participant.php'; require_once 'CRM/Event/BAO/Participant.php';
$ids = array($participantId); $ids = array($participantId);
$expiredId = array_search('Expired', $expiredStatuses); $expiredId = array_search('Expired', $expiredStatuses);
$results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE); $results = CRM_Event_BAO_Participant::transitionParticipants($ids, $expiredId, $values['status_id'], TRUE, TRUE);
$transaction->commit(); $transaction->commit();
if (!empty($results)) { if (!empty($results)) {
......
...@@ -69,20 +69,25 @@ class CRM_UpdateGreeting { ...@@ -69,20 +69,25 @@ class CRM_UpdateGreeting {
$config = CRM_Core_Config::singleton(); $config = CRM_Core_Config::singleton();
$contactType = CRM_Utils_Request::retrieve('ct', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST'); $contactType = CRM_Utils_Request::retrieve('ct', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
if (!in_array($contactType, if (!in_array($contactType,
array('Individual', 'Household', 'Organization') array('Individual', 'Household', 'Organization')
)) { )
) {
CRM_Core_Error::fatal(ts('Invalid Contact Type.')); CRM_Core_Error::fatal(ts('Invalid Contact Type.'));
} }
$greeting = CRM_Utils_Request::retrieve('gt', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST'); $greeting = CRM_Utils_Request::retrieve('gt', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
if (!in_array($greeting, if (!in_array($greeting,
array('email_greeting', 'postal_greeting', 'addressee') array('email_greeting', 'postal_greeting', 'addressee')
)) { )
) {
CRM_Core_Error::fatal(ts('Invalid Greeting Type.')); CRM_Core_Error::fatal(ts('Invalid Greeting Type.'));
} }
if (in_array($greeting, array( if (in_array($greeting, array(
'email_greeting', 'postal_greeting')) && $contactType == 'Organization') { 'email_greeting',
'postal_greeting'
)) && $contactType == 'Organization'
) {
CRM_Core_Error::fatal(ts('You cannot use %1 for contact type %2.', array(1 => $greeting, 2 => $contactType))); CRM_Core_Error::fatal(ts('You cannot use %1 for contact type %2.', array(1 => $greeting, 2 => $contactType)));
} }
...@@ -92,8 +97,8 @@ class CRM_UpdateGreeting { ...@@ -92,8 +97,8 @@ class CRM_UpdateGreeting {
if (!$valueID) { if (!$valueID) {
require_once 'CRM/Core/OptionGroup.php'; require_once 'CRM/Core/OptionGroup.php';
$contactTypeFilters = array(1 => 'Individual', 2 => 'Household', 3 => 'Organization'); $contactTypeFilters = array(1 => 'Individual', 2 => 'Household', 3 => 'Organization');
$filter = CRM_Utils_Array::key($contactType, $contactTypeFilters); $filter = CRM_Utils_Array::key($contactType, $contactTypeFilters);
$defaulValueID = CRM_Core_OptionGroup::values($greeting, NULL, NULL, NULL, $defaulValueID = CRM_Core_OptionGroup::values($greeting, NULL, NULL, NULL,
" AND is_default = 1 AND ( filter = {$filter} OR filter = 0 )", " AND is_default = 1 AND ( filter = {$filter} OR filter = 0 )",
"value" "value"
); );
...@@ -124,7 +129,9 @@ class CRM_UpdateGreeting { ...@@ -124,7 +129,9 @@ class CRM_UpdateGreeting {
$force = CRM_Utils_Request::retrieve('force', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST'); $force = CRM_Utils_Request::retrieve('force', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
$processAll = $processOnlyIdSet = FALSE; $processAll = $processOnlyIdSet = FALSE;
if (in_array($force, array( if (in_array($force, array(
1, 'true'))) { 1,
'true'
))) {
$processAll = TRUE; $processAll = TRUE;
} }
elseif ($force == 2) { elseif ($force == 2) {
......
...@@ -70,7 +70,10 @@ class CRM_UpdatePledgeRecord { ...@@ -70,7 +70,10 @@ class CRM_UpdatePledgeRecord {
//unset statues that we never use for pledges //unset statues that we never use for pledges
foreach (array( foreach (array(
'Completed', 'Cancelled', 'Failed') as $statusKey) { 'Completed',
'Cancelled',
'Failed'
) as $statusKey) {
if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) { if ($key = CRM_Utils_Array::key($statusKey, $allStatus)) {
unset($allStatus[$key]); unset($allStatus[$key]);
} }
...@@ -143,7 +146,8 @@ SELECT pledge.contact_id as contact_id, ...@@ -143,7 +146,8 @@ SELECT pledge.contact_id as contact_id,
if (CRM_Utils_Date::overdue(CRM_Utils_Date::customFormat($dao->scheduled_date, '%Y%m%d'), if (CRM_Utils_Date::overdue(CRM_Utils_Date::customFormat($dao->scheduled_date, '%Y%m%d'),
$now $now
) && $dao->payment_status != array_search('Overdue', $allStatus)) { ) && $dao->payment_status != array_search('Overdue', $allStatus)
) {
$pledgePayments[$dao->pledge_id][$dao->payment_id] = $dao->payment_id; $pledgePayments[$dao->pledge_id][$dao->payment_id] = $dao->payment_id;
} }
} }
...@@ -170,7 +174,7 @@ SELECT pledge.contact_id as contact_id, ...@@ -170,7 +174,7 @@ SELECT pledge.contact_id as contact_id,
require_once 'CRM/Core/SelectValues.php'; require_once 'CRM/Core/SelectValues.php';
$domain = CRM_Core_BAO_Domain::getDomain(); $domain = CRM_Core_BAO_Domain::getDomain();
$tokens = array( $tokens = array(
'domain' => array('name', 'phone', 'address', 'email'), 'domain' => array('name', 'phone', 'address', 'email'),
'contact' => CRM_Core_SelectValues::contactTokens(), 'contact' => CRM_Core_SelectValues::contactTokens(),
); );
......
...@@ -473,7 +473,7 @@ class Givi { ...@@ -473,7 +473,7 @@ class Givi {
* @return bool * @return bool
*/ */
function doReview($baseBranch = NULL) { function doReview($baseBranch = NULL) {
if (! $this->doCheckoutAll($baseBranch)) { if (!$this->doCheckoutAll($baseBranch)) {
return FALSE; return FALSE;
} }
...@@ -485,7 +485,8 @@ class Givi { ...@@ -485,7 +485,8 @@ class Givi {
$pullRequest = PullRequest::get($prUrl, $this->repos); $pullRequest = PullRequest::get($prUrl, $this->repos);
if ($pullRequest) { if ($pullRequest) {
$pullRequests[] = $pullRequest; $pullRequests[] = $pullRequest;
} else { }
else {
return $this->returnError("Invalid pull-request URL: $prUrl"); return $this->returnError("Invalid pull-request URL: $prUrl");
} }
} }
...@@ -551,14 +552,15 @@ class Givi { ...@@ -551,14 +552,15 @@ class Givi {
return $this->returnError("Missing <branch>[:<branch>]\n"); return $this->returnError("Missing <branch>[:<branch>]\n");
} }
if (FALSE !== strpos($newBranchNames, ':')) { if (FALSE !== strpos($newBranchNames, ':')) {
list ($newBranchFromName,$newBranchToName) = explode(':', $newBranchNames); list ($newBranchFromName, $newBranchToName) = explode(':', $newBranchNames);
foreach ($this->repos as $repo => $relPath) { foreach ($this->repos as $repo => $relPath) {
$filteredFromName = $this->filterBranchName($repo, $newBranchFromName); $filteredFromName = $this->filterBranchName($repo, $newBranchFromName);
$filteredToName = $this->filterBranchName($repo, $newBranchToName); $filteredToName = $this->filterBranchName($repo, $newBranchToName);
$this->run($repo, $relPath, 'git', 'push', $newBranchRepo, $filteredFromName . ':' . $filteredToName); $this->run($repo, $relPath, 'git', 'push', $newBranchRepo, $filteredFromName . ':' . $filteredToName);
} }
} else { }
else {
foreach ($this->repos as $repo => $relPath) { foreach ($this->repos as $repo => $relPath) {
$filteredName = $this->filterBranchName($repo, $newBranchNames); $filteredName = $this->filterBranchName($repo, $newBranchNames);
$this->run($repo, $relPath, 'git', 'push', $newBranchRepo, $filteredName); $this->run($repo, $relPath, 'git', 'push', $newBranchRepo, $filteredName);
...@@ -630,7 +632,8 @@ class Givi { ...@@ -630,7 +632,8 @@ class Givi {
printf("\n\n\nRUN [%s]: %s\n", $repoName, $command); printf("\n\n\nRUN [%s]: %s\n", $repoName, $command);
if ($this->dryRun) { if ($this->dryRun) {
$r = NULL; $r = NULL;
} else { }
else {
$r = system($command); $r = system($command);
} }
...@@ -729,7 +732,8 @@ class HttpClient { ...@@ -729,7 +732,8 @@ class HttpClient {
// PHP native client is unreliable PITA for HTTPS // PHP native client is unreliable PITA for HTTPS
if (exec("which wget")) { if (exec("which wget")) {
self::run('wget', '-q', '-O', $file, $url); self::run('wget', '-q', '-O', $file, $url);
} elseif (exec("which curl")) { }
elseif (exec("which curl")) {
self::run('curl', '-o', $file, $url); self::run('curl', '-o', $file, $url);
} }
......
...@@ -42,7 +42,7 @@ $authorizeNetIPN = new CRM_Core_Payment_AuthorizeNetIPN($_REQUEST); ...@@ -42,7 +42,7 @@ $authorizeNetIPN = new CRM_Core_Payment_AuthorizeNetIPN($_REQUEST);
try { try {
$authorizeNetIPN->main(); $authorizeNetIPN->main();
} }
catch(CRM_Core_Exception $e) { catch (CRM_Core_Exception $e) {
CRM_Core_Error::debug_log_message($e->getMessage()); CRM_Core_Error::debug_log_message($e->getMessage());
CRM_Core_Error::debug_var('error data', $e->getErrorData(), TRUE, TRUE); CRM_Core_Error::debug_var('error data', $e->getErrorData(), TRUE, TRUE);
CRM_Core_Error::debug_var('REQUEST', $_REQUEST, TRUE, TRUE); CRM_Core_Error::debug_var('REQUEST', $_REQUEST, TRUE, TRUE);
......
...@@ -51,7 +51,7 @@ else { ...@@ -51,7 +51,7 @@ else {
try { try {
$paypalIPN->main(); $paypalIPN->main();
} }
catch(CRM_Core_Exception $e) { catch (CRM_Core_Exception $e) {
CRM_Core_Error::debug_log_message($e->getMessage()); CRM_Core_Error::debug_log_message($e->getMessage());
CRM_Core_Error::debug_var('error data', $e->getErrorData(), TRUE, TRUE); CRM_Core_Error::debug_var('error data', $e->getErrorData(), TRUE, TRUE);
CRM_Core_Error::debug_var('REQUEST', $_REQUEST, TRUE, TRUE); CRM_Core_Error::debug_var('REQUEST', $_REQUEST, TRUE, TRUE);
......
...@@ -35,9 +35,9 @@ $params = array(1 => array($_GET['userid'], 'String')); ...@@ -35,9 +35,9 @@ $params = array(1 => array($_GET['userid'], 'String'));
$dpsSettings = CRM_Core_DAO::executeQuery($query, $params); $dpsSettings = CRM_Core_DAO::executeQuery($query, $params);
while ($dpsSettings->fetch()) { while ($dpsSettings->fetch()) {
$dpsUrl = $dpsSettings->url_site; $dpsUrl = $dpsSettings->url_site;
$dpsUser = $dpsSettings->user_name; $dpsUser = $dpsSettings->user_name;
$dpsKey = $dpsSettings->password; $dpsKey = $dpsSettings->password;
$dpsMacKey = $dpsSettings->signature; $dpsMacKey = $dpsSettings->signature;
} }
......
...@@ -38,9 +38,9 @@ $config = CRM_Core_Config::singleton(); ...@@ -38,9 +38,9 @@ $config = CRM_Core_Config::singleton();
$template = CRM_Core_Smarty::singleton(); $template = CRM_Core_Smarty::singleton();
require_once 'CRM/Utils/Request.php'; require_once 'CRM/Utils/Request.php';
$cpageId = CRM_Utils_Request::retrieve('cpageId', 'Positive', CRM_Core_DAO::$_nullObject); $cpageId = CRM_Utils_Request::retrieve('cpageId', 'Positive', CRM_Core_DAO::$_nullObject);
$widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive', CRM_Core_DAO::$_nullObject); $widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive', CRM_Core_DAO::$_nullObject);
$format = CRM_Utils_Request::retrieve('format', 'Positive', CRM_Core_DAO::$_nullObject); $format = CRM_Utils_Request::retrieve('format', 'Positive', CRM_Core_DAO::$_nullObject);
require_once 'CRM/Contribute/BAO/Widget.php'; require_once 'CRM/Contribute/BAO/Widget.php';
......
...@@ -209,14 +209,14 @@ function civicrm_config(&$config) { ...@@ -209,14 +209,14 @@ function civicrm_config(&$config) {
$params['baseURL'] = isset($config['base_url']) ? $config['base_url'] : civicrm_cms_base(); $params['baseURL'] = isset($config['base_url']) ? $config['base_url'] : civicrm_cms_base();
if ($installType == 'drupal') { if ($installType == 'drupal') {
if (version_compare(VERSION, '7.0-rc1') >= 0) { if (version_compare(VERSION, '7.0-rc1') >= 0) {
$params['cms'] = 'Drupal'; $params['cms'] = 'Drupal';
$params['CMSdbUser'] = addslashes($config['drupal']['username']); $params['CMSdbUser'] = addslashes($config['drupal']['username']);
$params['CMSdbPass'] = addslashes($config['drupal']['password']); $params['CMSdbPass'] = addslashes($config['drupal']['password']);
$params['CMSdbHost'] = $config['drupal']['server']; $params['CMSdbHost'] = $config['drupal']['server'];
$params['CMSdbName'] = addslashes($config['drupal']['database']); $params['CMSdbName'] = addslashes($config['drupal']['database']);
} }
elseif (version_compare(VERSION, '6.0') >= 0) { elseif (version_compare(VERSION, '6.0') >= 0) {
$params['cms'] = 'Drupal6'; $params['cms'] = 'Drupal6';
$params['CMSdbUser'] = addslashes($config['drupal']['username']); $params['CMSdbUser'] = addslashes($config['drupal']['username']);
$params['CMSdbPass'] = addslashes($config['drupal']['password']); $params['CMSdbPass'] = addslashes($config['drupal']['password']);
$params['CMSdbHost'] = $config['drupal']['server']; $params['CMSdbHost'] = $config['drupal']['server'];
...@@ -224,7 +224,7 @@ function civicrm_config(&$config) { ...@@ -224,7 +224,7 @@ function civicrm_config(&$config) {
} }
} }
else { else {
$params['cms'] = 'WordPress'; $params['cms'] = 'WordPress';
$params['CMSdbUser'] = addslashes(DB_USER); $params['CMSdbUser'] = addslashes(DB_USER);
$params['CMSdbPass'] = addslashes(DB_PASSWORD); $params['CMSdbPass'] = addslashes(DB_PASSWORD);
$params['CMSdbHost'] = DB_HOST; $params['CMSdbHost'] = DB_HOST;
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title><?php echo $errorTitle ?></title> <title><?php echo $errorTitle ?></title>
<link rel="stylesheet" type="text/css" href=<?php global $installURLPath; echo $installURLPath . "template.css"?> /> <link rel="stylesheet" type="text/css" href=<?php global
$installURLPath; echo $installURLPath . "template.css"?> />
</head> </head>
<body> <body>
<div id="All"> <div id="All">
<h1><?php echo $errorTitle ?></h1> <h1><?php echo $errorTitle ?></h1>
<?php echo $errorMsg ?> <?php echo $errorMsg ?>
</div> </div>
</body> </body>
......
...@@ -51,7 +51,10 @@ global $installType; ...@@ -51,7 +51,10 @@ global $installType;
$installType = strtolower($_SESSION['civicrm_install_type']); $installType = strtolower($_SESSION['civicrm_install_type']);
if (!in_array($installType, array( if (!in_array($installType, array(
'drupal', 'wordpress'))) { 'drupal',
'wordpress'
))
) {
$errorTitle = "Oops! Unsupported installation mode"; $errorTitle = "Oops! Unsupported installation mode";
$errorMsg = ""; $errorMsg = "";
errorDisplayPage($errorTitle, $errorMsg); errorDisplayPage($errorTitle, $errorMsg);
...@@ -83,11 +86,15 @@ if ($installType == 'drupal') { ...@@ -83,11 +86,15 @@ if ($installType == 'drupal') {
$pattern = '/' . preg_quote(CIVICRM_DIRECTORY_SEPARATOR . 'modules', CIVICRM_DIRECTORY_SEPARATOR) . '/'; $pattern = '/' . preg_quote(CIVICRM_DIRECTORY_SEPARATOR . 'modules', CIVICRM_DIRECTORY_SEPARATOR) . '/';
if (!preg_match($pattern, if (!preg_match($pattern,
str_replace("\\", "/", $_SERVER['SCRIPT_FILENAME']) str_replace("\\", "/", $_SERVER['SCRIPT_FILENAME'])
)) { )
) {
$errorTitle = "Oops! Please Correct Your Install Location"; $errorTitle = "Oops! Please Correct Your Install Location";
$errorMsg = "Please untar (uncompress) your downloaded copy of CiviCRM in the <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array( $errorMsg = "Please untar (uncompress) your downloaded copy of CiviCRM in the <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array(
'sites', 'all', 'modules')) . "</strong> directory below your Drupal root directory. Refer to the online " . $docLink . " for more information."; 'sites',
'all',
'modules'
)) . "</strong> directory below your Drupal root directory. Refer to the online " . $docLink . " for more information.";
errorDisplayPage($errorTitle, $errorMsg); errorDisplayPage($errorTitle, $errorMsg);
} }
} }
...@@ -166,7 +173,10 @@ if ($alreadyInstalled) { ...@@ -166,7 +173,10 @@ if ($alreadyInstalled) {
if ($installType == 'drupal') { if ($installType == 'drupal') {
$errorMsg = "CiviCRM has already been installed in this Drupal site. <ul><li>To <strong>start over</strong>, you must delete or rename the existing CiviCRM settings file - <strong>civicrm.settings.php</strong> - from <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array( $errorMsg = "CiviCRM has already been installed in this Drupal site. <ul><li>To <strong>start over</strong>, you must delete or rename the existing CiviCRM settings file - <strong>civicrm.settings.php</strong> - from <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array(
'[your Drupal root directory]', 'sites', $siteDir)) . "</strong>.</li><li>To <strong>upgrade an existing installation</strong>, refer to the online " . $docLink . ".</li></ul>"; '[your Drupal root directory]',
'sites',
$siteDir
)) . "</strong>.</li><li>To <strong>upgrade an existing installation</strong>, refer to the online " . $docLink . ".</li></ul>";
} }
elseif ($installType == 'wordpress') { elseif ($installType == 'wordpress') {
$errorMsg = "CiviCRM has already been installed in this WordPress site. <ul><li>To <strong>start over</strong>, you must delete or rename the existing CiviCRM settings file - <strong>civicrm.settings.php</strong> - from <strong>" . $cmsPath . "</strong>.</li><li>To <strong>upgrade an existing installation</strong>, refer to the online " . $docLink . ".</li></ul>"; $errorMsg = "CiviCRM has already been installed in this WordPress site. <ul><li>To <strong>start over</strong>, you must delete or rename the existing CiviCRM settings file - <strong>civicrm.settings.php</strong> - from <strong>" . $cmsPath . "</strong>.</li><li>To <strong>upgrade an existing installation</strong>, refer to the online " . $docLink . ".</li></ul>";
...@@ -276,12 +286,13 @@ class InstallRequirements { ...@@ -276,12 +286,13 @@ class InstallRequirements {
*/ */
function checkdatabase($databaseConfig, $dbName) { function checkdatabase($databaseConfig, $dbName) {
if ($this->requireFunction('mysql_connect', if ($this->requireFunction('mysql_connect',
array( array(
"PHP Configuration", "PHP Configuration",
"MySQL support", "MySQL support",
"MySQL support not included in PHP.", "MySQL support not included in PHP.",
) )
)) { )