/**
* @var string
*/
- static $_entityTable = NULL;
- static $_objectTable = NULL;
- static $_operation = NULL;
+ public static $_entityTable = NULL;
+ public static $_objectTable = NULL;
+ public static $_operation = NULL;
- static $_fieldKeys = NULL;
+ public static $_fieldKeys = NULL;
/**
* Get ACL entity table.
*/
class CRM_ACL_BAO_Cache extends CRM_ACL_DAO_Cache {
- static $_cache = NULL;
+ public static $_cache = NULL;
/**
* @param int $id
* Access Control EntityRole.
*/
class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole {
- static $_entityTable = NULL;
+ public static $_entityTable = NULL;
/**
* Get entity table.
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
/**
* Retrieve the basic contact type associated with given subType.
*
- * @param array /string $subType contact subType.
- * @return array/string of basicTypes.
+ * @param array|string $subType contact subType.
+ * @return array|string
+ * basicTypes.
*/
public static function getBasicType($subType) {
static $_cache = NULL;
else {
$name = self::getBasicType($contactName);
if (!$name) {
- return;
+ return NULL;
}
$value = ['name' => "New $name"];
CRM_Core_BAO_Navigation::retrieve($value, $navinfo);
* Custom group id.
* @param array $subtypes
* List of subtypes related to which entry is to be removed.
+ * @param array $subtypesToPreserve
*
* @return bool
*/
*
* @var array
*/
- static $_links = NULL;
+ public static $_links = NULL;
/**
* Get BAO Name.
*/
class CRM_Widget_Widget {
- static $_methodTable;
+ public static $_methodTable;
public function initialize() {
if (!self::$_methodTable) {
/**
* A central location for static variable storage.
- *
+ * @var array
* @code
* `Civi::$statics[__CLASS__]['foo'] = 'bar';
* @endcode
* @copyright CiviCRM LLC (c) 2004-2019
*/
class CiviContributeProcessor {
- static $_paypalParamsMapper = array(
+ public static $_paypalParamsMapper = array(
//category => array(paypal_param => civicrm_field);
'contact' => array(
'salutation' => 'prefix_id',
),
);
- static $_csvParamsMapper = array(
- // Note: if csv header is not present in the mapper, header itself
- // is considered as a civicrm field.
- //category => array(csv_header => civicrm_field);
+ /**
+ * Note: if csv header is not present in the mapper, header itself
+ * is considered as a civicrm field.
+ * category => array(csv_header => civicrm_field);
+ * @var array
+ */
+ public static $_csvParamsMapper = array(
'contact' => array(
'first_name' => 'first_name',
'last_name' => 'last_name',
*/
class civicrm_cli {
// required values that must be passed
- // via the command line
- var $_required_arguments = array('action', 'entity');
- var $_additional_arguments = array();
- var $_entity = NULL;
- var $_action = NULL;
- var $_output = FALSE;
- var $_joblog = FALSE;
- var $_semicolon = FALSE;
- var $_config;
-
- // optional arguments
- var $_site = 'localhost';
- var $_user = NULL;
- var $_password = NULL;
+ /**
+ * via the command line
+ * @var array
+ */
+ public $_required_arguments = array('action', 'entity');
+ public $_additional_arguments = array();
+ public $_entity = NULL;
+ public $_action = NULL;
+ public $_output = FALSE;
+ public $_joblog = FALSE;
+ public $_semicolon = FALSE;
+ public $_config;
+
+ /**
+ * optional arguments
+ * @var string
+ */
+ public $_site = 'localhost';
+ public $_user = NULL;
+ public $_password = NULL;
// all other arguments populate the parameters
- // array that is passed to civicrm_api
- var $_params = array('version' => 3);
+ /**
+ * array that is passed to civicrm_api
+ * @var array
+ */
+ public $_params = array('version' => 3);
- var $_errors = array();
+ public $_errors = array();
/**
* @return bool
* the database in a csv file format.
*/
class civicrm_cli_csv_exporter extends civicrm_cli {
- var $separator = ',';
+ public $separator = ',';
/**
*/
* passed to the script.
*/
class civicrm_cli_csv_file extends civicrm_cli {
- var $header;
- var $separator = ',';
+ public $header;
+ public $separator = ',';
/**
*/
}
/* return a params as expected */
+
/**
* @param $data
*
*
*/
class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
+
/**
* @param array $params
*/
*
*/
class civicrm_cli_csv_deleter extends civicrm_cli_csv_file {
+
/**
* @param array $params
*/
'administrator/components/com_civicrm/civicrm/civicrm-version.php',
),
'Drupal' => array(
- 'modules/system/system.module', // D7
+ // D7
+ 'modules/system/system.module',
),
'Drupal8' => array(
- 'core/core.services.yml', // D8
+ // D8
+ 'core/core.services.yml',
),
'Backdrop' => array(
'core/modules/layout/layout.module',
}
namespace {
+
/**
* Get the CiviCRM version.
* TODO : For now this function is not included in \Civi\Version class so not to break any code
'cms' => \_CiviVersion_\Util::findCMS(),
];
}
+
}
$object = new CRM_Utils_System_Backdrop();
$cmsPath = $object->cmsRootPath();
$siteDir = getSiteDir($cmsPath, $_SERVER['SCRIPT_FILENAME']);
- $alreadyInstalled = file_exists($cmsPath . CIVICRM_DIRECTORY_SEPARATOR . 'civicrm.settings.php');
+ $alreadyInstalled = file_exists($cmsPath . CIVICRM_DIRECTORY_SEPARATOR . 'civicrm.settings.php');
}
elseif ($installType == 'wordpress') {
$cmsPath = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'civicrm';
* $description[2] - The test error to show, if it goes wrong
*/
class InstallRequirements {
- var $errors, $warnings, $tests, $conn;
+ public $errors;
+ public $warnings;
+ public $tests;
+ public $conn;
// @see CRM_Upgrade_Form::MINIMUM_THREAD_STACK
const MINIMUM_THREAD_STACK = 192;
mysqli_query($conn, 'DROP TABLE civicrm_install_temp_table_test');
}
-
/**
* @param $server
* @param string $username
return;
}
- $result = mysqli_query($conn, "SHOW VARIABLES LIKE 'thread_stack'"); // bytes => kb
+ // bytes => kb
+ $result = mysqli_query($conn, "SHOW VARIABLES LIKE 'thread_stack'");
if (!$result) {
$testDetails[2] = ts('Could not get information about the thread_stack of the database.');
$this->error($testDetails);
* Class Installer
*/
class Installer extends InstallRequirements {
+
/**
* @param $server
* @param $username
//change the default language to one chosen
if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') {
civicrm_api3('Setting', 'create', array(
- 'domain_id' => 'current_domain',
- 'lcMessages' => $config['seedLanguage'],
- )
- );
+ 'domain_id' => 'current_domain',
+ 'lcMessages' => $config['seedLanguage'],
+ ));
}
$output .= '</ul>';
$this->householdIndividual = array_combine($this->Household, $this->householdIndividual);
}
- /*********************************
+ /*
* private members
- *********************************/
+ *
+ */
- // enum's from database
+ /**
+ * enum's from database
+ * @var array
+ */
private $preferredCommunicationMethod = array('1', '2', '3', '4', '5');
private $contactType = array('Individual', 'Household', 'Organization');
private $phoneType = array('1', '2', '3', '4');
- // customizable enums (foreign keys)
+ /**
+ * customizable enums (foreign keys)
+ * @var array
+ */
private $prefix = array(
// Female
1 => array(
4 => 'Dr.',
),
);
+ /**
+ * @var array
+ */
private $suffix = array(1 => 'Jr.', 2 => 'Sr.', 3 => 'II', 4 => 'III');
private $gender = array(1 => 'female', 2 => 'male');
- // store domain id's
+ /**
+ * store domain id's
+ * @var array
+ */
private $domain = array();
- // store contact id's
+ /**
+ * store contact id's
+ * @var array
+ */
private $contact = array();
private $Individual = array();
private $Household = array();
private $Organization = array();
// store which contacts have a location entity
- // for automatic management of is_primary field
+ /**
+ * for automatic management of is_primary field
+ * @var array
+ */
private $location = array(
'Email' => array(),
'Phone' => array(),
'Address' => array(),
);
- // stores the strict individual id and household id to individual id mapping
+ /**
+ * stores the strict individual id and household id to individual id mapping
+ * @var array
+ */
private $strictIndividual = array();
private $householdIndividual = array();
private $householdName = array();
- // sample data in xml format
+ /**
+ * sample data in xml format
+ * @var array
+ */
private $sampleData = array();
- // private vars
+ /**
+ * private vars
+ * @var array
+ */
private $startCid;
private $numIndividual = 0;
private $numHousehold = 0;
/*********************************
* private methods
- ********************************
+ * *******************************
* @param int $size
* @return string
*/
*
*/
-/*******************************************************
+/**
* This class generates data for the schema located in Contact.sql
*
* each public method generates data for the concerned table.
* Contact Location = 15% for Households, 10% for Organizations, (75-(15*4))% for Individuals.
* (Assumption is that each household contains 4 individuals)
*
- *******************************************************/
+ */
-/*******************************************************
+/**
*
* Note: implication of using of mt_srand(1) in constructor
* The data generated will be done in a consistent manner
* to get consistent random numbers then the mt_srand(1) shld
* be in each function that adds data to each table.
*
- *******************************************************/
+ */
require_once '../civicrm.config.php';
*/
class CRM_GCD {
- /*******************************************************
+ /**
* constants
- *******************************************************/
+ */
const DATA_FILENAME = "sample_data.xml";
const NUM_DOMAIN = 1;
const NUM_CONTACT = 5000;
//const ADD_TO_DB=FALSE;
const DEBUG_LEVEL = 1;
- /*********************************
+ /***
* private members
- *********************************/
+ */
- // enum's from database
+ /**
+ * enum's from database
+ * @var array
+ */
private $preferredCommunicationMethod = array('1', '2', '3', '4', '5');
private $contactType = array('Individual', 'Household', 'Organization');
private $phoneType = array('1', '2', '3', '4');
- // customizable enums (foreign keys)
+ /**
+ * customizable enums (foreign keys)
+ * @var array
+ */
private $prefix = array(1 => 'Mrs', 2 => 'Ms', 3 => 'Mr', 4 => 'Dr');
private $suffix = array(1 => 'Jr', 2 => 'Sr');
private $gender = array(1 => 'Female', 2 => 'Male');
private $greetingType = array(1 => 'Dear [first]', 2 => 'Dear [prefix] [first] [last]', 3 => 'Dear [prefix] [last]');
- // store domain id's
+ /**
+ * store domain id's
+ * @var array
+ */
private $domain = array();
- // store contact id's
+ /**
+ * store contact id's
+ * @var array
+ */
private $contact = array();
private $individual = array();
private $household = array();
private $organization = array();
- // store names, firstnames, street 1, street2
+ /**
+ * store names, firstnames, street 1, street2
+ * @var array
+ */
private $firstName = array();
private $lastName = array();
private $streetName = array();
private $degree = array();
private $school = array();
- // stores the strict individual id and household id to individual id mapping
+ /**
+ * stores the strict individual id and household id to individual id mapping
+ * @var array
+ */
private $strictIndividual = array();
private $householdIndividual = array();
- // sample data in xml format
+ /**
+ * sample data in xml format
+ * @var int
+ */
private $sampleData = NULL;
- // private vars
+ /**
+ * private vars
+ * @var int
+ */
private $numIndividual = 0;
private $numHousehold = 0;
private $numOrganization = 0;
1116 => array('GdaĆsk', 'Gdynia'),
),
);
-
+ /**
+ * @var array
+ */
private $groupMembershipStatus = array('Added', 'Removed', 'Pending');
private $subscriptionHistoryMethod = array('Admin', 'Email');
- /*********************************
+ /**
* private methods
- ********************************
+ *
* @param int $size
* @return string
*/
return mt_rand(1, count($array1));
}
-
// country state city combo
+
/**
* @return array
*/
return date($dateFormat, mt_rand($today - $numSecond, $today));
}
-
// insert data into db's
+
/**
* @param $dao
*/
}
// update data into db's
+
/**
* @param $dao
*/
}
}
-
public function initDB() {
$config = CRM_Core_Config::singleton();
}
$this->_insert($activityContactDAO);
if (in_array($activityTypeID, array(
- 6, 9))) {
+ 6, 9,
+ ))) {
$activityTargetDAO = new CRM_Activity_DAO_ActivityContact();
$activityTargetDAO->activity_id = $activityDAO->id;
$activityTargetDAO->contact_id = mt_rand(1, 101);
return array();
}
-
echo ("Starting data generation on " . date("F dS h:i:s A") . "\n");
$obj1 = new CRM_GCD();
$obj1->initID();
// Note: When processing all locales, CRM_Core_I18n::singleton() eats a lot of RAM.
ini_set('memory_limit', -1);
}
-date_default_timezone_set('UTC'); // avoid php warnings if timezone is not set - CRM-10844
+// avoid php warnings if timezone is not set - CRM-10844
+date_default_timezone_set('UTC');
define('CIVICRM_UF', 'Drupal');
define('CIVICRM_UF_BASEURL', '/');
# TODO: pull these settings from configuration
$genCode = new CRM_Core_CodeGen_Main(
- '../CRM/Core/DAO/', // $CoreDAOCodePath
- '../sql/', // $sqlCodePath
- '../', // $phpCodePath
- '../templates/', // $tplCodePath
- NULL, // IGNORE
- @$argv[3], // cms
- empty($argv[2]) ? NULL : $argv[2], // db version
- empty($argv[1]) ? 'schema/Schema.xml' : $argv[1], // schema file
- getenv('CIVICRM_GENCODE_DIGEST') ? getenv('CIVICRM_GENCODE_DIGEST') : NULL // path to digest file
+ // $CoreDAOCodePath
+ '../CRM/Core/DAO/',
+ // $sqlCodePath
+ '../sql/',
+ // $phpCodePath
+ '../',
+ // $tplCodePath
+ '../templates/',
+ // IGNORE
+ NULL,
+ // cms
+ @$argv[3],
+ // db version
+ empty($argv[2]) ? NULL : $argv[2],
+ // schema file
+ empty($argv[1]) ? 'schema/Schema.xml' : $argv[1],
+ // path to digest file
+ getenv('CIVICRM_GENCODE_DIGEST') ? getenv('CIVICRM_GENCODE_DIGEST') : NULL
);
$genCode->main();
<?php
+
/**
* @param array $params
* @param $text