mirror of
https://github.com/flextype/flextype.git
synced 2025-08-05 20:57:41 +02:00
- next round of code improvements
This commit is contained in:
40
index.php
40
index.php
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @package Flextype
|
||||
*
|
||||
* @author Sergey Romanenko <hello@romanenko.digital>
|
||||
* @link http://romanenko.digital
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
@@ -12,6 +11,15 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use const DIRECTORY_SEPARATOR;
|
||||
use const PHP_VERSION;
|
||||
use function define;
|
||||
use function getcwd;
|
||||
use function is_file;
|
||||
use function sprintf;
|
||||
use function str_replace;
|
||||
use function version_compare;
|
||||
|
||||
/**
|
||||
* Define the application minimum supported PHP version.
|
||||
*/
|
||||
@@ -25,17 +33,19 @@ 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',
|
||||
'entries' => ROOT_DIR . '/site/entries',
|
||||
'snippets' => ROOT_DIR . '/site/snippets',
|
||||
'fieldsets' => ROOT_DIR . '/site/fieldsets',
|
||||
'config' => [
|
||||
'default' => ROOT_DIR . '/flextype/config',
|
||||
'site' => ROOT_DIR . '/site/config'
|
||||
],
|
||||
'cache' => ROOT_DIR . '/site/cache']);
|
||||
define('PATH', [
|
||||
'site' => ROOT_DIR . '/site',
|
||||
'plugins' => ROOT_DIR . '/site/plugins',
|
||||
'themes' => ROOT_DIR . '/site/themes',
|
||||
'entries' => ROOT_DIR . '/site/entries',
|
||||
'snippets' => ROOT_DIR . '/site/snippets',
|
||||
'fieldsets' => ROOT_DIR . '/site/fieldsets',
|
||||
'config' => [
|
||||
'default' => ROOT_DIR . '/flextype/config',
|
||||
'site' => ROOT_DIR . '/site/config',
|
||||
],
|
||||
'cache' => ROOT_DIR . '/site/cache',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Check PHP Version
|
||||
@@ -45,7 +55,7 @@ version_compare($ver = PHP_VERSION, $req = FLEXTYPE_MINIMUM_PHP, '<') and exit(s
|
||||
/**
|
||||
* Ensure vendor libraries exist
|
||||
*/
|
||||
!is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit("Please run: <i>composer install</i>");
|
||||
! is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: <i>composer install</i>');
|
||||
|
||||
/**
|
||||
* Register The Auto Loader
|
||||
|
Reference in New Issue
Block a user