Changeset 533 for trunk/bin/_config.inc.php
- Timestamp:
- Jul 13, 2015 8:48:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/_config.inc.php
r532 r533 27 27 */ 28 28 29 $this_script = basename($_SERVER['argv'][0]); 29 // The name of the CLI. 30 $cli_executed = basename($_SERVER['argv'][0]); 30 31 31 // Assume execution occurs while in the common app directory. 32 define('COMMON_BASE', realpath('.')); 32 // Enforce "relaxed" directory location, if set by the called script. 33 // This script can be executed in any directory that is an ancestor 2 directories above the db_auth file. 34 if (!defined('COMMON_BASE')) { 35 define('COMMON_BASE', realpath('.')); 36 } 37 38 // Use codebase files releative to this file. 39 define('CODEBASE_PATH', realpath(dirname(__FILE__) . '/../')); 40 33 41 $db_auth_file = false; 34 42 $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(COMMON_BASE)); … … 41 49 } 42 50 if (!$db_auth_file) { 43 die(sprintf("%s error: the current directory must be common site directory (i.e. the parent directory of the document root) AND a db_auth file must exist within two directory levels.\n", $ this_script));51 die(sprintf("%s error: the current directory must be common site directory (i.e. the parent directory of the document root) AND a db_auth file must exist within two directory levels.\n", $cli_executed)); 44 52 } 45 53 if (fileowner($db_auth_file) != getmyuid()) { 46 die(sprintf("%s error: you must execute this script as the owner of the web files.\n", $ this_script));54 die(sprintf("%s error: you must execute this script as the owner of the web files.\n", $cli_executed)); 47 55 } 48 56 … … 55 63 56 64 // Include core libraries. 57 require_once 'codebase/lib/App.inc.php';58 require_once 'codebase/lib/Utilities.inc.php';65 require_once CODEBASE_PATH . '/lib/App.inc.php'; 66 require_once CODEBASE_PATH . '/lib/Utilities.inc.php'; 59 67 60 68 define('_CLI', true); … … 74 82 'log_file_priority' => false, 75 83 'log_screen_priority' => LOG_INFO, 76 'log_directory' => COMMON_BASE . '/log',84 'log_directory' => '/tmp', 77 85 'log_filename' => 'site_log', 78 86 ));
Note: See TracChangeset
for help on using the changeset viewer.