From da223475e01e5103b046945262381eb28b1069bc Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 24 Jun 2022 22:02:44 +0300 Subject: [PATCH] feat(core): Added ability to override default constants --- bin/flextype | 16 +++++--------- index.php | 16 +++++--------- src/flextype/defines.php | 45 +++++++++++++++++++++++++++++++++++++++ src/flextype/flextype.php | 4 ++-- 4 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 src/flextype/defines.php diff --git a/bin/flextype b/bin/flextype index a165d33a..1e8fc8d2 100755 --- a/bin/flextype +++ b/bin/flextype @@ -15,22 +15,16 @@ namespace Flextype; +/** + * Define the Flextype start time in current unix timestamp (microseconds). + */ +define('START_TIME', microtime(true)); + /** * Define the PATH to the root directory (without trailing slash). */ define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd())); -/** - * Define the project name. - */ -define('PROJECT_NAME', 'project'); - -/** - * Define the PATH (without trailing slash). - */ -define('PATH_PROJECT', ROOT_DIR . '/' . PROJECT_NAME); -define('PATH_TMP', ROOT_DIR . '/var/tmp'); - /** * Ensure vendor libraries exist */ diff --git a/index.php b/index.php index 725de3a7..9c949770 100755 --- a/index.php +++ b/index.php @@ -21,22 +21,16 @@ use function is_file; use function sprintf; use function str_replace; +/** + * Define the Flextype start time in current unix timestamp (microseconds). + */ +define('START_TIME', microtime(true)); + /** * Define the PATH to the root directory (without trailing slash). */ define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd())); -/** - * Define the project name. - */ -define('PROJECT_NAME', 'project'); - -/** - * Define the PATH (without trailing slash). - */ -define('PATH_PROJECT', ROOT_DIR . '/' . PROJECT_NAME); -define('PATH_TMP', ROOT_DIR . '/var/tmp'); - /** * Ensure vendor libraries exist */ diff --git a/src/flextype/defines.php b/src/flextype/defines.php new file mode 100644 index 00000000..19dbff50 --- /dev/null +++ b/src/flextype/defines.php @@ -0,0 +1,45 @@ +PHP %s to run.', $ver, $req));