mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Moved *_PATH and PR_*constants from main.php/cli-script.php back to Core.php - was causing problems with installer (directly includes Core.php, but doesn't run through main.php) - see ticket #2867 for improvement suggestions in bootstrapping code to avoid these bugs
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63290 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
11e09aa0d6
commit
21944a2e06
@ -44,36 +44,11 @@ if(isset($_SERVER['argv'][2])) {
|
|||||||
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
|
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
|
||||||
chdir(dirname($_SERVER['SCRIPT_FILENAME']));
|
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
|
* Include Sapphire's core code
|
||||||
*/
|
*/
|
||||||
require_once("core/Core.php");
|
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\"");
|
header("Content-type: text/html; charset=\"utf-8\"");
|
||||||
if(function_exists('mb_http_output')) {
|
if(function_exists('mb_http_output')) {
|
||||||
mb_http_output('UTF-8');
|
mb_http_output('UTF-8');
|
||||||
|
@ -6,6 +6,24 @@
|
|||||||
* @subpackage core
|
* @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
|
* Define the temporary folder if it wasn't defined yet
|
||||||
*/
|
*/
|
||||||
@ -13,6 +31,13 @@ if(!defined('TEMP_FOLDER')) {
|
|||||||
define('TEMP_FOLDER', getTempFolder());
|
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
|
* Returns the temporary folder that sapphire/silverstripe should use for its cache files
|
||||||
* This is loaded into the TEMP_FOLDER define on start up
|
* This is loaded into the TEMP_FOLDER define on start up
|
||||||
|
25
main.php
25
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
|
* Include Sapphire's core code
|
||||||
*/
|
*/
|
||||||
require_once("core/Core.php");
|
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\"");
|
header("Content-type: text/html; charset=\"utf-8\"");
|
||||||
if (function_exists('mb_http_output')) {
|
if (function_exists('mb_http_output')) {
|
||||||
mb_http_output('UTF-8');
|
mb_http_output('UTF-8');
|
||||||
|
Loading…
Reference in New Issue
Block a user