示例#1
0
 /**
  * Compute a digest based on the inputs to the code-generator (ie the properties
  * of the codegen and the source files loaded by the codegen).
  *
  * @return string
  */
 function getDigest()
 {
     if ($this->digest === 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"), array("{$srcDir}/xml", "*.xml")));
         $properties = var_export(array(CRM_Core_CodeGen_Util_File::digestAll($files), $this->buildVersion, $this->db_version, $this->cms, $this->CoreDAOCodePath, $this->sqlCodePath, $this->phpCodePath, $this->tplCodePath, $this->schemaPath, $this->getTasks()), TRUE);
         $this->digest = md5($properties);
     }
     return $this->digest;
 }
示例#2
0
 /**
  * Compute a digest based on the GenCode logic (PHP/tpl).
  *
  * @return string
  */
 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")));
         $this->sourceDigest = CRM_Core_CodeGen_Util_File::digestAll($files);
     }
     return $this->sourceDigest;
 }