}
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,
$lock->release();
echo "Done processing<p>";
-
/**
* 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();
$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;
$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';
// 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);
$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, '"');
*
*/
function __construct() {
- $this->_required_arguments = array('entity','file');
+ $this->_required_arguments = array('entity', 'file');
$this->_additional_arguments = array('f' => 'file');
parent::initialize();
}
$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);
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];
*/
-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' );
$facility->setSingleRunParams('job', $job, $params, 'From cron.php');
$facility->executeJobByAction('job', $job);
}
-
*
**/
-require_once (dirname(__DIR__) . '/cli.class.php');
+require_once dirname(__DIR__) . '/cli.class.php';
$entityImporter = new civicrm_cli_csv_deleter();
$entityImporter->run();
-
-
* 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();
* 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();
-
-
session_start();
$obj = new CiviReportMail;
$obj->run();
-
*/
/**
- *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)>
*
// 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
$lock->release();
}
-
echo "Updating..";
$obj->updateParticipantStatus();
echo "<br />Participant records updated. (Done)";
-
-
echo "Releasing..";
$obj->releaseRespondent();
echo "<br /><br />Respondent Release Done";
-
-
$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';
}
run();
-
$obj = new CRM_UpdateGreeting();
$obj->updateGreeting();
echo "\n\n Greeting is updated for contact(s). (Done) \n";
-
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
}
echo "\n Updating ";
$obj->updateMembershipStatus();
echo "\n\n Membership records updated. (Done) \n";
-
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
}
echo "\n Updating... ";
$reminderDate->updateMembershipReminderDate();
echo "\n\n Membership(s) reminder date updated. (Done) \n";
-
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(),
);
echo "Updating<br />";
$obj->updatePledgeStatus();
echo "<br />Pledge records update script finished.";
-
-
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
}
$cron = new CRM_Cron_Action();
$cron->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';
else {
run();
}
-