* Class CRM_Core_CodeGen_Main
*/
class CRM_Core_CodeGen_Main {
- var $buildVersion;
- var $db_version;
- var $cms; // drupal, joomla, wordpress
+ public $buildVersion;
+ public $db_version;
+ /**
+ * drupal, joomla, wordpress
+ * @var string
+ */
+ public $cms;
- var $CoreDAOCodePath;
- var $sqlCodePath;
- var $phpCodePath;
- var $tplCodePath;
- var $schemaPath; // ex: schema/Schema.xml
+ public $CoreDAOCodePath;
+ public $sqlCodePath;
+ public $phpCodePath;
+ public $tplCodePath;
+ /**
+ * ex: schema/Schema.xml
+ * @var string
+ */
+ public $schemaPath;
/**
* Definitions of all tables.
* @var array
* Ex: $tables['civicrm_address_format']['className'] = 'CRM_Core_DAO_AddressFormat';
*/
- var $tables;
+ public $tables;
/**
* @var array
* Ex: $database['tableAttributes_modern'] = "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci";
*/
- var $database;
+ public $database;
/**
- * @var string|NULL path in which to store a marker that indicates the last execution of
- * GenCode. If a matching marker already exists, GenCode doesn't run.
+ * Path in which to store a marker that indicates the last execution of GenCode.
+ *
+ * If a matching marker already exists, GenCode doesn't run.
+ *
+ * @var string|null
*/
- var $digestPath;
+ public $digestPath;
/**
- * @var string|NULL a digest of the inputs to the code-generator (eg the properties and source files)
+ * Digest of the inputs to the code-generator (eg the properties and source files).
+ *
+ * @var string|null
*/
- var $sourceDigest;
+ public $sourceDigest;
/**
* @param $CoreDAOCodePath
public function getTasks() {
$this->init();
- $tasks = array();
+ $tasks = [];
$tasks[] = new CRM_Core_CodeGen_Config($this);
$tasks[] = new CRM_Core_CodeGen_Reflection($this);
$tasks[] = new CRM_Core_CodeGen_Schema($this);
public function getSourceDigest() {
if ($this->sourceDigest === NULL) {
$srcDir = CRM_Core_CodeGen_Util_File::findCoreSourceDir();
- $files = CRM_Core_CodeGen_Util_File::findManyFiles(array(
- array("$srcDir/CRM/Core/CodeGen", '*.php'),
- array("$srcDir/xml", "*.php"),
- array("$srcDir/xml", "*.tpl"),
- ));
+ $files = CRM_Core_CodeGen_Util_File::findManyFiles([
+ ["$srcDir/CRM/Core/CodeGen", '*.php'],
+ ["$srcDir/xml", "*.php"],
+ ["$srcDir/xml", "*.tpl"],
+ ]);
$this->sourceDigest = CRM_Core_CodeGen_Util_File::digestAll($files);
}
if (!$this->database || !$this->tables) {
$specification = new CRM_Core_CodeGen_Specification();
$specification->parse($this->schemaPath, $this->buildVersion);
- # cheese:
$this->database = $specification->database;
$this->tables = $specification->tables;
}