- Timestamp:
- May 24, 2015 3:01:42 PM (9 years ago)
- Location:
- trunk/bin/module_maker
- Files:
-
- 2 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 -
trunk/bin/module_maker/form_template.cli.php
r485 r523 100 100 <label for="$field"><\x3fphp echo _("$title"); \x3f></label> 101 101 <input type="file" name="$field" id="$field" /> 102 <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && getFormData('op') == 'edit' || getFormData('op') == 'update') { \x3f>103 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\ $s\"><strong>%2\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div>102 <\x3fphp if ('' != \$upload->getFilenameGlob(getFormData('$primary_key') . '_*') && (getFormData('op') == 'edit' || getFormData('op') == 'update')) { \x3f> 103 <div class="sc-help"><\x3fphp printf(_("The current file <a href=\"%s/%2\\\$s\"><strong>%2\\\$s</strong></a> will be deleted if a new file is selected for upload."), '/_db_files/__///__', \$upload->getFilenameGlob(getFormData('$primary_key') . '_*')) \x3f></div> 104 104 <\x3fphp } \x3f> 105 105 <div class="sc-help"><\x3fphp printf(_("Allowed file types: %s."), join(', ', \$upload->getParam('valid_file_extensions'))) \x3f></div>
Note: See TracChangeset
for help on using the changeset viewer.