mirror of
https://github.com/flextype/flextype.git
synced 2025-01-17 12:48:31 +01:00
define CONSTANTS in PHP7 style
This commit is contained in:
parent
f30200a579
commit
8ffcc0dbe6
@ -44,9 +44,6 @@
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"flextype"
|
||||
],
|
||||
"files": [
|
||||
"flextype/boot/defines.php"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
19
index.php
19
index.php
@ -15,6 +15,23 @@ namespace Flextype;
|
||||
// Define the application minimum supported PHP version.
|
||||
define('FLEXTYPE_MINIMUM_PHP', '7.1.3');
|
||||
|
||||
// Define the path to the root directory (without trailing slash).
|
||||
define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd()));
|
||||
|
||||
// Define the PATH (without trailing slash).
|
||||
define('PATH', ['site' => ROOT_DIR . '/site',
|
||||
'plugins' => ROOT_DIR . '/site/plugins',
|
||||
'themes' => ROOT_DIR . '/site/themes',
|
||||
'pages' => ROOT_DIR . '/site/pages',
|
||||
'blocks' => ROOT_DIR . '/site/blocks',
|
||||
'data' => ROOT_DIR . '/site/data',
|
||||
'config' => ROOT_DIR . '/site/config',
|
||||
'cache' => ROOT_DIR . '/site/cache',
|
||||
'accounts' => ROOT_DIR . '/site/accounts']);
|
||||
|
||||
// Define the path to the logs directory (without trailing slash).
|
||||
define('LOGS_PATH', PATH['site'] . '/logs');
|
||||
|
||||
// Check PHP Version
|
||||
version_compare($ver = PHP_VERSION, $req = FLEXTYPE_MINIMUM_PHP, '<') and exit(sprintf('You are running PHP %s, but Flextype needs at least <strong>PHP %s</strong> to run.', $ver, $req));
|
||||
|
||||
@ -24,5 +41,5 @@ version_compare($ver = PHP_VERSION, $req = FLEXTYPE_MINIMUM_PHP, '<') and exit(s
|
||||
// Register The Auto Loader
|
||||
$loader = require_once $autoload;
|
||||
|
||||
// Init Flextype
|
||||
// Init Flextype Application
|
||||
Flextype::instance();
|
||||
|
Loading…
x
Reference in New Issue
Block a user