From: Tim Otten Date: Thu, 9 Jan 2014 09:10:12 +0000 (-0800) Subject: CRM_Core_CodeGen_Util_Template - Fix warning X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d9b759a7e50e849253bc2ea48391772b5b139621;p=civicrm-core.git CRM_Core_CodeGen_Util_Template - Fix warning Example warning: "PHP Warning: unlink(../sql/civicrm_data.da_DK.mysql): No such file or directory in /home/webeditor/jenkins-node/workspace/buildkit-demos.civicrm.org/build/d7-sandbox/sites/all/modules/civicrm/CRM/Core/CodeGen/Util/Template.php on line 56" --- diff --git a/CRM/Core/CodeGen/Util/Template.php b/CRM/Core/CodeGen/Util/Template.php index e151496015..516d5f3d12 100644 --- a/CRM/Core/CodeGen/Util/Template.php +++ b/CRM/Core/CodeGen/Util/Template.php @@ -53,7 +53,9 @@ class CRM_Core_CodeGen_Util_Template { * @param string $outpath full path to the desired output file */ function runConcat($inputs, $outpath) { - unlink($outpath); + if (file_exists($outpath)) { + unlink($outpath); + } foreach ($inputs as $infile) { // FIXME: does not beautify. Document. file_put_contents($outpath, $this->smarty->fetch($infile) ."\n", FILE_APPEND);