Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ini_set('include_path', '.' . PATH_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR . '..'); | |
0d035206 | 3 | // make sure the memory_limit is at least 512 MB |
4 | $memLimitString = trim(ini_get('memory_limit')); | |
56fdfc52 TO |
5 | $memLimitUnit = strtolower(substr($memLimitString, -1)); |
6 | $memLimit = (int) $memLimitString; | |
0d035206 | 7 | switch ($memLimitUnit) { |
56fdfc52 TO |
8 | case 'g': |
9 | $memLimit *= 1024; | |
10 | case 'm': | |
11 | $memLimit *= 1024; | |
12 | case 'k': | |
13 | $memLimit *= 1024; | |
0d035206 | 14 | } |
15 | ||
16 | if ($memLimit >= 0 and $memLimit < 536870912) { | |
8652384e TO |
17 | // Note: When processing all locales, CRM_Core_I18n::singleton() eats a lot of RAM. |
18 | ini_set('memory_limit', -1); | |
0d035206 | 19 | } |
6a488035 TO |
20 | date_default_timezone_set('UTC'); // avoid php warnings if timezone is not set - CRM-10844 |
21 | ||
22 | define('CIVICRM_UF', 'Drupal'); | |
2a8330d8 | 23 | define('CIVICRM_UF_BASEURL', '/'); |
6a488035 TO |
24 | |
25 | require_once 'CRM/Core/ClassLoader.php'; | |
26 | CRM_Core_ClassLoader::singleton()->register(); | |
27 | ||
e39816b5 ARW |
28 | # TODO: pull these settings from configuration |
29 | $genCode = new CRM_Core_CodeGen_Main( | |
c59c0e21 TO |
30 | '../CRM/Core/DAO/', // $CoreDAOCodePath |
31 | '../sql/', // $sqlCodePath | |
32 | '../', // $phpCodePath | |
33 | '../templates/', // $tplCodePath | |
90b9cb2c | 34 | NULL, // IGNORE |
c59c0e21 TO |
35 | @$argv[3], // cms |
36 | empty($argv[2]) ? NULL : $argv[2], // db version | |
37 | empty($argv[1]) ? 'schema/Schema.xml' : $argv[1], // schema file | |
2469a0dd | 38 | getenv('CIVICRM_GENCODE_DIGEST') ? getenv('CIVICRM_GENCODE_DIGEST') : NULL // path to digest file |
6a488035 | 39 | ); |
c59c0e21 | 40 | $genCode->main(); |