X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=xml%2FGenCode.php;h=0f994a9b25b8721d321d1b41280e5cd8b457bcec;hb=b863b16436bd6aa0ba3d2effd1065b2b77083fb0;hp=e2ca3fa7bc10e91711a3486c9cff3a1fc749f08b;hpb=4c95b949e863281d990ffa2a3104415079e6352d;p=civicrm-core.git diff --git a/xml/GenCode.php b/xml/GenCode.php index e2ca3fa7bc..0f994a9b25 100644 --- a/xml/GenCode.php +++ b/xml/GenCode.php @@ -2,16 +2,19 @@ ini_set('include_path', '.' . PATH_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR . '..'); // make sure the memory_limit is at least 512 MB $memLimitString = trim(ini_get('memory_limit')); -$memLimitUnit = strtolower(substr($memLimitString, -1)); -$memLimit = (int) $memLimitString; +$memLimitUnit = strtolower(substr($memLimitString, -1)); +$memLimit = (int) $memLimitString; switch ($memLimitUnit) { - case 'g': $memLimit *= 1024; - case 'm': $memLimit *= 1024; - case 'k': $memLimit *= 1024; + case 'g': + $memLimit *= 1024; + case 'm': + $memLimit *= 1024; + case 'k': + $memLimit *= 1024; } if ($memLimit >= 0 and $memLimit < 536870912) { - ini_set('memory_limit', '512M'); + ini_set('memory_limit', '512M'); } date_default_timezone_set('UTC'); // avoid php warnings if timezone is not set - CRM-10844 @@ -22,14 +25,14 @@ CRM_Core_ClassLoader::singleton()->register(); # TODO: pull these settings from configuration $genCode = new CRM_Core_CodeGen_Main( - '../CRM/Core/DAO/', // $CoreDAOCodePath - '../sql/', // $sqlCodePath - '../', // $phpCodePath - '../templates/', // $tplCodePath - array('../packages/Smarty/plugins', '../CRM/Core/Smarty/plugins'), // smarty plugin dirs - @$argv[3], // cms - empty($argv[2]) ? NULL : $argv[2], // db version - empty($argv[1]) ? 'schema/Schema.xml' : $argv[1], // schema file + '../CRM/Core/DAO/', // $CoreDAOCodePath + '../sql/', // $sqlCodePath + '../', // $phpCodePath + '../templates/', // $tplCodePath + array('../packages/Smarty/plugins', '../CRM/Core/Smarty/plugins'), // smarty plugin dirs + @$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 ); -$genCode->main(); \ No newline at end of file +$genCode->main();