Commit a9e80afc authored by totten's avatar totten
Browse files

INFRA-132 - bin/ - phpcbf

parent 1f5f3294
......@@ -283,9 +283,10 @@ class CiviContributeProcessor {
}
foreach ($response[1][$response[0]]['notifications']['charge-amount-notification']
as $amtData
as $amtData
) {
$searchParams = array('order-numbers' => array($amtData['google-order-number']['VALUE']),
$searchParams = array(
'order-numbers' => array($amtData['google-order-number']['VALUE']),
'notification-types' => array('risk-information', 'new-order', 'charge-amount'),
);
$response = CRM_Core_Payment_Google::invokeAPI($paymentProcessor,
......@@ -434,4 +435,3 @@ else {
$lock->release();
echo "Done processing<p>";
......@@ -28,7 +28,7 @@
/**
* A PHP script which deletes extraneous civicrm_membership_payment rows
* in order to correct the condition where a contribution row is linked to > 1 membership.
*/
*/
function initialize() {
session_start();
......
......@@ -175,7 +175,7 @@ class civicrm_cli {
$this->_joblog = TRUE;
}
else {
while(list($short, $long) = each ($this->_additional_arguments)) {
while(list($short, $long) = each($this->_additional_arguments)) {
if ($arg == '-' . $short || $arg == '--' . $long) {
$property = '_' . $long;
$this->$property = $value;
......@@ -211,7 +211,7 @@ class civicrm_cli {
$civicrm_root = dirname(__DIR__);
chdir($civicrm_root);
require_once ('civicrm.config.php');
require_once 'civicrm.config.php';
// autoload
if ( !class_exists('CRM_Core_ClassLoader') ) {
require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
......@@ -223,7 +223,7 @@ class civicrm_cli {
// HTTP_HOST will be 'localhost' unless overwritten with the -s argument.
// Now we have a Config object, we can set it from the Base URL.
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$_SERVER['HTTP_HOST'] = preg_replace(
$_SERVER['HTTP_HOST'] = preg_replace(
'!^https?://([^/]+)/$!i',
'$1',
$this->_config->userFrameworkBaseURL);
......@@ -332,18 +332,18 @@ class civicrm_cli_csv_exporter extends civicrm_cli {
$this->row = 1;
$result = civicrm_api($this->_entity, 'Get', $this->_params);
$first = true;
$first = TRUE;
foreach ($result['values'] as $row) {
if($first) {
$columns = array_keys($row);
fputcsv($out, $columns, $this->separator, '"');
$first = false;
$first = FALSE;
}
//handle values returned as arrays (i.e. custom fields that allow multiple selections) by inserting a control character
foreach ($row as &$field) {
if(is_array($field)) {
//convert to string
$field = implode($field,CRM_Core_DAO::VALUE_SEPARATOR) . CRM_Core_DAO::VALUE_SEPARATOR;
$field = implode($field, CRM_Core_DAO::VALUE_SEPARATOR) . CRM_Core_DAO::VALUE_SEPARATOR;
}
}
fputcsv($out, $row, $this->separator, '"');
......@@ -368,7 +368,7 @@ class civicrm_cli_csv_file extends civicrm_cli {
*
*/
function __construct() {
$this->_required_arguments = array('entity','file');
$this->_required_arguments = array('entity', 'file');
$this->_additional_arguments = array('f' => 'file');
parent::initialize();
}
......@@ -397,7 +397,8 @@ class civicrm_cli_csv_file extends civicrm_cli {
$this->header = $header;
while (($data = fgetcsv($handle, 0, $this->separator)) !== FALSE) {
// skip blank lines
if(count($data) == 1 && is_null($data[0])) continue;
if(count($data) == 1 && is_null($data[0])) { continue;
}
$this->row++;
$params = $this->convertLine($data);
$this->processLine($params);
......@@ -417,7 +418,7 @@ class civicrm_cli_csv_file extends civicrm_cli {
foreach ($this->header as $i => $field) {
//split any multiselect data, denoted with CRM_Core_DAO::VALUE_SEPARATOR
if (strpos($data[$i], CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) {
$data[$i] = explode(CRM_Core_DAO::VALUE_SEPARATOR,$data[$i]);
$data[$i] = explode(CRM_Core_DAO::VALUE_SEPARATOR, $data[$i]);
$data[$i] = array_combine($data[$i], $data[$i]);
}
$params[$field] = $data[$i];
......
......@@ -25,7 +25,7 @@
*/
require_once ('cli.class.php');
require_once 'cli.class.php';
$cli = new civicrm_Cli();
$cli->initialize() || die( 'Died during initialization' );
$cli->callApi() || die( 'Died during callApi' );
......@@ -52,4 +52,3 @@ else {
$facility->setSingleRunParams('job', $job, $params, 'From cron.php');
$facility->executeJobByAction('job', $job);
}
......@@ -33,9 +33,7 @@
*
**/
require_once (dirname(__DIR__) . '/cli.class.php');
require_once dirname(__DIR__) . '/cli.class.php';
$entityImporter = new civicrm_cli_csv_deleter();
$entityImporter->run();
......@@ -34,7 +34,7 @@
* e.g.: php bin/csv/export.php -e Contact --email=jamie@progressivetech.org
*
**/
require_once (dirname(__DIR__) . '/cli.class.php');
require_once dirname(__DIR__) . '/cli.class.php';
$entityExporter = new civicrm_cli_csv_exporter();
$entityExporter->run();
......@@ -31,9 +31,7 @@
* e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv
*
**/
require_once (dirname(__DIR__) . '/cli.class.php');
require_once dirname(__DIR__) . '/cli.class.php';
$entityImporter = new civicrm_cli_csv_importer();
$entityImporter->run();
......@@ -75,4 +75,3 @@ class CiviReportMail {
session_start();
$obj = new CiviReportMail;
$obj->run();
......@@ -34,7 +34,7 @@
*/
/**
*When runing script from cli :
* When runing script from cli :
* 1. By default script is being used for civimail processing.
* eg : nice -19 php bin/EmailProcessor.php -u<login> -p<password> -s<sites(or default)>
*
......@@ -46,7 +46,7 @@
// bootstrap the environment and run the processor
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once ("bin/cli.php");
require_once "bin/cli.php";
$cli = new civicrm_cli();
//if it doesn't die, it's authenticated
//log the execution of script
......@@ -108,4 +108,3 @@ else {
$lock->release();
}
......@@ -264,5 +264,3 @@ $obj = new CRM_ParticipantProcessor();
echo "Updating..";
$obj->updateParticipantStatus();
echo "<br />Participant records updated. (Done)";
......@@ -108,5 +108,3 @@ $obj = new CRM_RespondentProcessor();
echo "Releasing..";
$obj->releaseRespondent();
echo "<br /><br />Respondent Release Done";
......@@ -176,7 +176,7 @@ WHERE {$whereClause}
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
if ($processGeocode) {
require_once (str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php');
require_once str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php';
}
require_once 'CRM/Core/DAO/Address.php';
......@@ -278,4 +278,3 @@ WHERE {$whereClause}
}
run();
......@@ -237,4 +237,3 @@ UPDATE civicrm_contact
$obj = new CRM_UpdateGreeting();
$obj->updateGreeting();
echo "\n\n Greeting is updated for contact(s). (Done) \n";
......@@ -49,7 +49,7 @@ class CRM_UpdateMembershipRecord {
function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once ("cli.php");
require_once "cli.php";
$cli = new civicrm_cli();
//if it doesn't die, it's authenticated
}
......@@ -85,4 +85,3 @@ $obj = new CRM_UpdateMembershipRecord();
echo "\n Updating ";
$obj->updateMembershipStatus();
echo "\n\n Membership records updated. (Done) \n";
......@@ -41,7 +41,7 @@ class CRM_UpdateMembershipReminderDate {
function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once ("cli.php");
require_once "cli.php";
$cli = new civicrm_cli();
//if it doesn't die, it's authenticated
}
......@@ -114,4 +114,3 @@ $reminderDate = new CRM_UpdateMembershipReminderDate();
echo "\n Updating... ";
$reminderDate->updateMembershipReminderDate();
echo "\n\n Membership(s) reminder date updated. (Done) \n";
......@@ -170,7 +170,8 @@ SELECT pledge.contact_id as contact_id,
require_once 'CRM/Core/BAO/Domain.php';
require_once 'CRM/Core/SelectValues.php';
$domain = CRM_Core_BAO_Domain::getDomain();
$tokens = array('domain' => array('name', 'phone', 'address', 'email'),
$tokens = array(
'domain' => array('name', 'phone', 'address', 'email'),
'contact' => CRM_Core_SelectValues::contactTokens(),
);
......@@ -303,5 +304,3 @@ $obj = new CRM_UpdatePledgeRecord();
echo "Updating<br />";
$obj->updatePledgeStatus();
echo "<br />Pledge records update script finished.";
......@@ -39,7 +39,7 @@ class CRM_Cron_Action {
function __construct() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once ("cli.php");
require_once "cli.php";
$cli = new civicrm_cli();
//if it doesn't die, it's authenticated
}
......@@ -75,4 +75,3 @@ class CRM_Cron_Action {
$cron = new CRM_Cron_Action();
$cron->run();
......@@ -53,7 +53,7 @@ function run() {
// you can run this program either from an apache command, or from the cli
if (php_sapi_name() == "cli") {
require_once ("bin/cli.php");
require_once "bin/cli.php";
$cli = new civicrm_cli();
require_once 'CRM/Mailing/BAO/Mailing.php';
......@@ -64,4 +64,3 @@ if (php_sapi_name() == "cli") {
else {
run();
}
......@@ -100,4 +100,3 @@ function run() {
}
run();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment