diff --git a/cli-script.php b/cli-script.php index 873b1030e..07bcad2d0 100755 --- a/cli-script.php +++ b/cli-script.php @@ -44,36 +44,11 @@ if(isset($_SERVER['argv'][2])) { $_SERVER['SCRIPT_FILENAME'] = __FILE__; chdir(dirname($_SERVER['SCRIPT_FILENAME'])); -/** - * Define system paths - */ -define('BASE_PATH', dirname(dirname($_SERVER['SCRIPT_FILENAME']))); -define('BASE_URL', dirname(dirname($_SERVER['SCRIPT_NAME']))); -define('MODULES_DIR', 'modules'); -define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR); -define('THIRDPARTY_DIR', 'jsparty'); -define('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR); -define('THEMES_DIR', 'themes'); -define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR); -define('SAPPHIRE_DIR', 'sapphire'); -define('SAPPHIRE_PATH', BASE_PATH . '/' . SAPPHIRE_DIR); -define('CMS_DIR', 'cms'); -define('CMS_PATH', BASE_PATH . '/' . CMS_DIR); -define('ASSETS_DIR', 'assets'); -define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR); - /** * Include Sapphire's core code */ require_once("core/Core.php"); -/** - * Priorities definition. These constants are used in calls to _t() as an optional argument - */ -define('PR_HIGH',100); -define('PR_MEDIUM',50); -define('PR_LOW',10); - header("Content-type: text/html; charset=\"utf-8\""); if(function_exists('mb_http_output')) { mb_http_output('UTF-8'); diff --git a/core/Core.php b/core/Core.php index 6ba0e1751..2d5c73ad3 100755 --- a/core/Core.php +++ b/core/Core.php @@ -6,6 +6,24 @@ * @subpackage core */ +/** + * Define system paths + */ +define('BASE_PATH', dirname(dirname($_SERVER['SCRIPT_FILENAME']))); +define('BASE_URL', dirname(dirname($_SERVER['SCRIPT_NAME']))); +define('MODULES_DIR', 'modules'); +define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR); +define('THIRDPARTY_DIR', 'jsparty'); +define('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR); +define('THEMES_DIR', 'themes'); +define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR); +define('SAPPHIRE_DIR', 'sapphire'); +define('SAPPHIRE_PATH', BASE_PATH . '/' . SAPPHIRE_DIR); +define('CMS_DIR', 'cms'); +define('CMS_PATH', BASE_PATH . '/' . CMS_DIR); +define('ASSETS_DIR', 'assets'); +define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR); + /** * Define the temporary folder if it wasn't defined yet */ @@ -13,6 +31,13 @@ if(!defined('TEMP_FOLDER')) { define('TEMP_FOLDER', getTempFolder()); } +/** + * Priorities definition. These constants are used in calls to _t() as an optional argument + */ +define('PR_HIGH',100); +define('PR_MEDIUM',50); +define('PR_LOW',10); + /** * Returns the temporary folder that sapphire/silverstripe should use for its cache files * This is loaded into the TEMP_FOLDER define on start up diff --git a/main.php b/main.php index dac8fc9a5..d866320ad 100644 --- a/main.php +++ b/main.php @@ -46,36 +46,11 @@ foreach ($envFiles as $envFile) { } } -/** - * Define system paths - */ -define('BASE_PATH', dirname(dirname($_SERVER['SCRIPT_FILENAME']))); -define('BASE_URL', dirname(dirname($_SERVER['SCRIPT_NAME']))); -define('MODULES_DIR', 'modules'); -define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR); -define('THIRDPARTY_DIR', 'jsparty'); -define('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR); -define('THEMES_DIR', 'themes'); -define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR); -define('SAPPHIRE_DIR', 'sapphire'); -define('SAPPHIRE_PATH', BASE_PATH . '/' . SAPPHIRE_DIR); -define('CMS_DIR', 'cms'); -define('CMS_PATH', BASE_PATH . '/' . CMS_DIR); -define('ASSETS_DIR', 'assets'); -define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR); - /** * Include Sapphire's core code */ require_once("core/Core.php"); -/** - * Priorities definition. These constants are used in calls to _t() as an optional argument - */ -define('PR_HIGH',100); -define('PR_MEDIUM',50); -define('PR_LOW',10); - header("Content-type: text/html; charset=\"utf-8\""); if (function_exists('mb_http_output')) { mb_http_output('UTF-8');