Changeset 523 for trunk/bin/module_maker/_config.inc.php
- Timestamp:
- May 24, 2015 3:01:42 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/_config.inc.php
r500 r523 36 36 // Make sure necessary files exist. 37 37 $db_auth_file = false; 38 $db_json_file = false; 38 39 $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(COMMON_BASE)); 39 40 $rii->setMaxDepth(2); 40 41 foreach ($rii as $filename => $file) { 42 if (mb_strpos($filename, 'db_auth.json') !== false) { 43 $db_json_file = $filename; 44 break; 45 } 41 46 if (mb_strpos($filename, 'db_auth.inc.php') !== false) { 42 47 $db_auth_file = $filename; … … 45 50 } 46 51 47 if (!$db_auth_file ) {52 if (!$db_auth_file && !$db_json_file) { 48 53 die("Error: First argument directory must contain the global/db_auth.inc.php file with valid MySQL credentials.\n"); 49 54 } … … 72 77 'error_reporting' => E_ALL, 73 78 'log_screen_priority' => LOG_DEBUG, 79 'log_directory' => COMMON_BASE . '/log', 74 80 )); 75 require_once $db_auth_file; 81 82 if ($db_json_file) { 83 $app->setParam(array( 84 'db_auth_file' => $db_json_file, 85 )); 86 } else { 87 require_once $db_auth_file; 88 } 76 89 77 90 // Start application-based functionality: database, session, environment, ini setup, etc. 78 91 // Most configuration parameters must be set before starting the App. 92 define('_CLI', true); 79 93 $app->start(); 80 94
Note: See TracChangeset
for help on using the changeset viewer.