1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-05 04:37:43 +02:00

refactor(flextype): move some core stuff from index file to flextype core

This commit is contained in:
Awilum
2022-04-05 18:47:24 +03:00
parent dc8fc49160
commit 41848400a5
2 changed files with 11 additions and 15 deletions

View File

@@ -16,19 +16,10 @@ declare(strict_types=1);
namespace Flextype;
use function define;
use function getcwd;
use function is_file;
use function sprintf;
use function str_replace;
use function version_compare;
use const DIRECTORY_SEPARATOR;
use const PHP_VERSION;
/**
* Define the application minimum supported PHP version.
*/
define('FLEXTYPE_MINIMUM_PHP', '7.4.0');
/**
* Define the PATH to the root directory (without trailing slash).
@@ -43,11 +34,6 @@ define('PATH', [
'tmp' => ROOT_DIR . '/var/tmp',
]);
/**
* 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
*/

View File

@@ -55,6 +55,7 @@ use function container;
use function count;
use function date;
use function date_default_timezone_set;
use function define;
use function emitter;
use function extension_loaded;
use function file_exists;
@@ -77,9 +78,18 @@ use function strings;
use function sys_get_temp_dir;
use function trim;
use function var_export;
use function version_compare;
use const DIRECTORY_SEPARATOR;
use const PHP_VERSION;
// Define the Flextype Application minimum supported PHP version.
define('FLEXTYPE_MINIMUM_PHP', '7.4.0');
// 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));
// Init Flextype Instance.
// Creates $app Flextype Application and $container Flextype Application Container objects.
// Creates Flextype Application and Flextype Application Container objects.
flextype();
// Create Flextype CLI Application