Skip to content
Snippets Groups Projects
Commit 09dd8985 authored by Tim Otten's avatar Tim Otten
Browse files

Merge pull request #2353 from totten/master-cache-codegen2

GenCode - Ignore cache/digest if some key files are missing
parents 20de3653 693f0bff
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ class CRM_Core_CodeGen_Main {
*
*/
function main() {
if (!empty($this->digestPath) && file_exists($this->digestPath)) {
if (!empty($this->digestPath) && file_exists($this->digestPath) && $this->hasExpectedFiles()) {
if ($this->getDigest() === file_get_contents($this->digestPath)) {
echo "GenCode has previously executed. To force execution, please (a) omit CIVICRM_GENCODE_DIGEST\n";
echo "or (b) remove {$this->digestPath} or (c) call GenCode with new parameters.\n";
......@@ -155,4 +155,20 @@ Alternatively you can get a version of CiviCRM that matches your PHP version
}
return $this->digest;
}
function getExpectedFiles() {
return array(
$this->sqlCodePath . '/civicrm.mysql',
$this->phpCodePath . '/CRM/Contact/DAO/Contact.php',
);
}
function hasExpectedFiles() {
foreach ($this->getExpectedFiles() as $file) {
if (!file_exists($file)) {
return FALSE;
}
}
return TRUE;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment