summaryrefslogtreecommitdiff
path: root/public/app
diff options
context:
space:
mode:
Diffstat (limited to 'public/app')
-rw-r--r--public/app/config/app_constants.php70
-rw-r--r--public/app/routes/api.php28
2 files changed, 58 insertions, 40 deletions
diff --git a/public/app/config/app_constants.php b/public/app/config/app_constants.php
index f788946..cabd0b8 100644
--- a/public/app/config/app_constants.php
+++ b/public/app/config/app_constants.php
@@ -1,7 +1,15 @@
<?php
-// Contents
-// Central Defaults (name)
-// Default Values (user-privileges and user-roles)
+/** Custom Application Constants
+ * -----------------------------------------------------------------------------
+ *
+ * Constants defined for your own application
+ *
+ * Here you may fing
+ *
+ * It is rec
+ *
+ * -----------------------------------------------------------------------------
+ */
// read ini file if exist
@@ -11,37 +19,53 @@ if (file_exists("../core/auth/.env")) {
}
+/** Main default constants / strings / names / etc
+ * -----------------------------------------------------------------------------
+ */
+define('SITE_TITLE', 'schoolGov'); // Site Title (the end-users' title)
-// CENTRAL DEFAULTS ////////////////////////////////////////////////////////////
-// -----------------------------------------------------------------------------
-// NOTE:
-// if .env file exists ... do not touch anything
-// else ... replace $env[*] values with your setup
-// WEB-APP name and url
-// --- -- -- - - -
-define('SITE_TITLE', 'Classroom');
-define('SITE_URL', $env['ANOM_HOSTNAME']);
+/** Autoload paths
+ * -----------------------------------------------------------------------------
+ *
+ * CLASSPATHS : array of paths where classes are saved
+ * Needed only when the custom autoloader is used
+ *
+ * NOTE:
+ * if the custom autoloader is used (instead of composer's)
+ * then you need to defing CLASSPATHS constant-array too;
+ *
+ * In most cases you won't need this,
+ * so comment the next lines out of the code-base
+ *
+ * -----------------------------------------------------------------------------
+ */
+
+# define('CLASSPATHS', array(
+# '/../core/classes/',
+# '/app/controllers/',
+# '/app/models/',
+# '/../vendor/'
+# )
+# );
+
+
+// if FileSession is selected, a path for session-files is needed
+#define('FILESESSION_PATH', '../storage/session');
+
+
+
+
// Session and cookie names
// --- -- -- - - -
define('SESSION_NAME', 'offticket'); // cookie for session (office ticket)
define('CONNECTION_COOKIE', 'con'); // cookie for connection
define('MAX_SESSION_LIFE', 2*60*60); // maximum session lifetime (2 hours)
-// Cookie Policy
-// --- -- -- - - -
-# define('COOKIE_DOMAIN', $env['ANOM_HOSTNAME']); // domain to be visible on
-define('COOKIE_SECURE', false); // Secure cookie policy [true|false]
-define('COOKIE_SAMESITE', 'Strict'); // SameSite cookie policy [Strict|Lax|None]
- // recomended values:
- // COOKIE_SECURE=true, COOKIE_SAMESITE='Strict'
- // --- -- -- - - -
- // for more info about cookie policy read:
- // https://www.php.net/manual/en/function.session-set-cookie-params.php
-
+
// email setup
diff --git a/public/app/routes/api.php b/public/app/routes/api.php
index 61e485b..94ae2a6 100644
--- a/public/app/routes/api.php
+++ b/public/app/routes/api.php
@@ -61,21 +61,15 @@ Route::add('/api/([0-9a-zA-Z-_]*)/([0-9]*)',
* -----------------------------------------------------------------------------
*
* 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();
+
+ });
+}