diff options
Diffstat (limited to 'public/app')
| -rw-r--r-- | public/app/config/app_constants.php | 25 | ||||
| -rw-r--r-- | public/app/routes/api.php | 29 |
2 files changed, 36 insertions, 18 deletions
diff --git a/public/app/config/app_constants.php b/public/app/config/app_constants.php index b46bc51..64475ba 100644 --- a/public/app/config/app_constants.php +++ b/public/app/config/app_constants.php @@ -25,6 +25,31 @@ if (file_exists("../core/auth/.env")) { define('SITE_TITLE', 'Classroom'); define('SITE_URL', 'http://localhost'); + + + + +/** HOTFIX: */ +define('SESSION_NAME', 'clroom'); // Session Name + + +/** Caching expiration times fpr various expensive objects + * ----------------------------------------------------------------------------- + */ + +// Root objects like product-categories tree +define('CACHE_ROOT_TTL', 28800); // 8 hours + +// Product Category +define('CACHE_CATEGORY_TTL', 18000); // 5 hours + +// Product +define('CACHE_PRODUCT_TTL', 3600); // 1 hour + + + + + // email setup // --- -- -- - - - // SMTP diff --git a/public/app/routes/api.php b/public/app/routes/api.php index 61e485b..80676ff 100644 --- a/public/app/routes/api.php +++ b/public/app/routes/api.php @@ -56,26 +56,19 @@ Route::add('/api/([0-9a-zA-Z-_]*)/([0-9]*)', - /** TEST CALLS * ----------------------------------------------------------------------------- * * direct calls to simple tests - * + * (not on production environment) */ - - -// route for testing... -// --- -Route::add('/test/([0-9a-zA-Z-_\/]*)', function($test) { - - // TODO: - // hide tests from production - - if (file_exists(TESTS_DIRECTORY . $test .'.php')) { - if (!Benchmark::exist('start')) Benchmark::add_spot('start'); - require(TESTS_DIRECTORY . $test .'.php'); - } else { echo "Test {$test} not exist"; - } die(); - -}); +if (!PRODUCTION) { + Route::add('/test/([0-9a-zA-Z-_\/]*)', function($test) { + if (file_exists(TESTS_DIRECTORY . $test .'.php')) { + if (!Benchmark::exist('start')) Benchmark::add_spot('start'); + require(TESTS_DIRECTORY . $test .'.php'); + } else { echo "Test {$test} not exist"; + } die(); + + }); +} |
