diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-05-16 02:48:50 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-05-16 02:48:50 +0300 |
| commit | b49941608a8d37ca6bedf2529a703876530124d4 (patch) | |
| tree | ecdef8a36a36f495fe996606729bb1db3023d156 | |
| parent | 59cd40235bf4746a119421609b25d7e9b7f65f83 (diff) | |
| download | gyraf1gov-b49941608a8d37ca6bedf2529a703876530124d4.tar.gz gyraf1gov-b49941608a8d37ca6bedf2529a703876530124d4.tar.bz2 gyraf1gov-b49941608a8d37ca6bedf2529a703876530124d4.zip | |
anom refactoring; remove noisy depricated files
| -rw-r--r-- | core/config/xx--anom_settings.php | 66 | ||||
| -rw-r--r-- | core/config/xx--constants.php | 28 | ||||
| -rw-r--r-- | docker-compose.yml | 1 | ||||
| -rw-r--r-- | env.example | 2 | ||||
| -rw-r--r-- | public/app/config/bootstrap.php (renamed from core/config/init.php) | 5 | ||||
| -rw-r--r-- | public/app/config/setup_application.php (renamed from public/app/config/setup-application.php) | 0 | ||||
| -rw-r--r-- | public/app/config/setup_framework.php (renamed from public/app/config/setup-framework.php) | 9 | ||||
| -rw-r--r-- | public/index.php | 19 |
8 files changed, 24 insertions, 106 deletions
diff --git a/core/config/xx--anom_settings.php b/core/config/xx--anom_settings.php deleted file mode 100644 index 06fe5af..0000000 --- a/core/config/xx--anom_settings.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - - - - - - - - - - - - - - - - - - - - - - -/* ADVANCED OPTIMIZATION /////////////////////////////////////////////////////// - * ----------------------------------------------------------------------------- - * - * APP_CACHE defines the cache-driver; - * accepted values are the name of the Cache-interface impementations (the exact - * names of the classes) - * - * 'FileCache' : caching in filesystem; fair if caching on HDD; great on SSD - * 'RedisCache' : caching in Redis server; generally recommended if available - * 'MemCachedCache' : caching in Memcached server; recommended if available - * - * NOTE: FileCache on a NVMe SDD is the fastest option; - * Redis and Memcached are really-fast caching options and are available for - * scaling horizontaly your application (eache one has it's own strngths; - * study, then choose the one that fulfills your needs; - * ----------------------------------------------------------------------------- - */ - -define('CACHE_DRIVER', $env['CACHE_DRIVER'] ?? 'FileCache'); - - - - -/** HOTFIX: (needs refactoring) */ - -// CONNECTIONS ... - -define('FILECACHE_PATH', APP_ROOT.'/storage/cache/'); // if CACHE_DRIVER is set to 'FileCache' - -define('MEDIA_STORAGE_ROOT', APP_ROOT.'/storage/uploads/'); // Media files root directory - -# define('REDIS_HOST', '127.0.0.1'); // if CACHE_DRIVER is set to 'RedisCache' - -# define('MEMCAHCED_SERVER', '127.0.0.1'); // if CACHE_DRIVER is set to 'MemCached' - - - - -/** CREDENTIALS - * ----------------------------------------------------------------------------- - */ - -
\ No newline at end of file diff --git a/core/config/xx--constants.php b/core/config/xx--constants.php deleted file mode 100644 index d2ecc41..0000000 --- a/core/config/xx--constants.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** Constants - * --- - */ - -// COMMON CONTENT TYPES -// ----------------------------------------------------------------------------- -define('COMMON_CONTENT_TYPES', array( - 'text' => 'text/html; charset=UTF-8', - 'html' => 'text/html; charset=UTF-8', - 'json' => 'application/json; charset=utf-8', - 'js' => 'application/javascript; charset=utf-8', - 'css' => 'text/css', - 'png' => 'image/png', - 'jpeg' => 'image/jpeg', - 'webp' => 'image/web' - ) -); - - -// PROXY_FLAGS -// ----------------------------------------------------------------------------- -// These options represend altered/non-default behaviour -// and will be resolved bitwise, so use powers of 2 -// ----------------------------------------------------------------------------- -define('PROXY_CACHE_ERRORS', 1); // cache result even if error -define('PROXY_IGNORE_CACHE', 2); // ignore cache if exist -define('PROXY_DO_NOT_CACHE', 4); // do not cache result diff --git a/docker-compose.yml b/docker-compose.yml index adf7b7d..e41843d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: - "./storage:/var/www/storage" - "./tests:/var/www/tests" - "./tests:/var/www/public/files" + - "./.env:/var/www/.env" environment: PORT: 8080 # for xdebug uncomment next subsection diff --git a/env.example b/env.example index fd47dd8..49e0882 100644 --- a/env.example +++ b/env.example @@ -1,4 +1,6 @@ ENVIRONMENT='development' +ANOM_HOSTNAME= +APP_VERSION='init-alfa' # MySQL connection # --- -- -- - - - diff --git a/core/config/init.php b/public/app/config/bootstrap.php index 40624d3..a51272e 100644 --- a/core/config/init.php +++ b/public/app/config/bootstrap.php @@ -1,7 +1,8 @@ <?php /** initialize System - * --- + * ----------------------------------------------------------------------------- + * * Finalalize the MVC framework and construct the central objects * (Registry and Request) * @@ -14,6 +15,8 @@ * Always try to keep the app as light as possible, so load only what is * critical for the MVC to operate; * anything else can be injected on-demand + * + * ----------------------------------------------------------------------------- */ // setup error-handliing diff --git a/public/app/config/setup-application.php b/public/app/config/setup_application.php index ec9a7bb..ec9a7bb 100644 --- a/public/app/config/setup-application.php +++ b/public/app/config/setup_application.php diff --git a/public/app/config/setup-framework.php b/public/app/config/setup_framework.php index 63eb486..69c3402 100644 --- a/public/app/config/setup-framework.php +++ b/public/app/config/setup_framework.php @@ -16,6 +16,8 @@ * You may rewrite the defines setting any values manualy; * SETTING anom CONSTANTS VIA an `.env` FILE IS HIGHLY RECOMMENDED; * The default `.env` file is saved into project's root + * + * Blueprint: * * ----------------------------------------------------------------------------- */ @@ -101,8 +103,9 @@ define('SITE_URL', $env['ANOM_HOSTNAME']); define('URL_ROOT', '/'); -define('INIT_APPLICATION', APP_ROOT.'/core/config/init.php'); - +// main initialization script +define('APPLICATION_BOOTSTRAP', WEB_ROOT.'/app/config/bootstrap.php'); + define('VIEWS_DIRECTORY', $env['VIEWS_DIRECTORY'] ?? (WEB_ROOT.'/app/views/')); define('TESTS_DIRECTORY', $env['TESTS_DIRECTORY'] ?? (APP_ROOT."/tests/")); @@ -466,4 +469,4 @@ define('PROXY_DO_NOT_CACHE', 4); // do not cache result * * ----------------------------------------------------------------------------- */ -require_once WEB_ROOT.'/app/config/setup-application.php';
\ No newline at end of file +require_once WEB_ROOT.'/app/config/setup_application.php'; diff --git a/public/index.php b/public/index.php index 5c84e97..9dea217 100644 --- a/public/index.php +++ b/public/index.php @@ -2,23 +2,26 @@ /** anom * ANOther MVC framefork /////////////////////////////////////////////////////// * ----------------------------------------------------------------------------- + * * This is where the whole thing stats. * Let's keep it simple and clear * - * anom is an Object-Oriented MVC php-framework. - * It is super-light, fast and extensible. - * Contains almost anything you need to start - * and optimize a server-based web-application. + * anom is an(other) Object-Oriented MVC php-framework. + * It is a super-light, fast and extensible development + * tool. + * + * Contains implementations of almost anything you need + * to start and optimize a server-based web-application. * And as long as you write code using secure practices, - * it will be secure. + * it shall be secure. * * Copyleft: George Halkiadakis * Licence: BSD + * * \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ * ----------------------------------------------------------------------------- */ - // specify base paths // ----------------------------------------------------------------------------- @@ -35,7 +38,7 @@ define('WEB_ROOT', APP_ROOT.'/'.$pub); // root of public directory // contants and constant arrays // ----------------------------------------------------------------------------- -require_once WEB_ROOT.'/app/config/setup-framework.php'; // application constants +require_once WEB_ROOT.'/app/config/setup_framework.php'; // application constants @@ -62,7 +65,7 @@ if (!PRODUCTION) Benchmark::add_spot('start'); // benchmark request's life // finalize framework; handle credentials; setup app-engine; insert routes // ----------------------------------------------------------------------------- -require_once INIT_APPLICATION; +require_once APPLICATION_BOOTSTRAP; // Application is ready! |
