forked from flextype/flextype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·42 lines (32 loc) · 1.44 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @package Flextype
*
* @author Sergey Romanenko <[email protected]>
* @link http://flextype.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
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',
'config' => ROOT_DIR . '/site/config',
'cache' => ROOT_DIR . '/site/cache']);
// 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));
// Ensure vendor libraries exist
!is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit("Please run: <i>composer install</i>");
// Register The Auto Loader
$loader = require_once $autoload;
// Get Flextype Instance
$flextype = Flextype::getInstance();