summaryrefslogtreecommitdiff
path: root/config/credentials.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
commit7076343338ae3439f3c86f01144818abe8c31978 (patch)
tree794abb1e6b8f821091fd095341885496b6dad51d /config/credentials.php
parent47cbb529f5723b246125ae083a193e11481b89ef (diff)
downloadclassroom-7076343338ae3439f3c86f01144818abe8c31978.tar.gz
classroom-7076343338ae3439f3c86f01144818abe8c31978.tar.bz2
classroom-7076343338ae3439f3c86f01144818abe8c31978.zip
add container helpers; constuct public directory-tree
Diffstat (limited to 'config/credentials.php')
-rw-r--r--config/credentials.php126
1 files changed, 0 insertions, 126 deletions
diff --git a/config/credentials.php b/config/credentials.php
deleted file mode 100644
index 43fa0a4..0000000
--- a/config/credentials.php
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-/** SERVICE PARAMETRES
- * -----------------------------------------------------------------------------
- *
- * Connection parametres and credentials for accssing services
- * needed by the application; Such services may be..
- *
- * - RDBMS
- * -- MySQL
- * -- PotgresSQL
- *
- * - Caching services
- * -- Redis
- * -- MemCached
- *
- * Edit only the constants needed by the application;
- * Comment those you do not need;
- *
- * /////////////////////////////////////////////////////////////////////////////
- */
-
-/** DATABASE CONNECTION PARAMETRES
- * -----------------------------------------------------------------------------
- * Production and staging environments may use different databases.
- *
- * A safe practice is to keep credentials outside plain files like this one
- * in environmental variable or other secret file etc.
- *
- * Uncomment/enable each group of definitions suits your case to define
- * the credentials needed for accessing the database
- */
-
-/** This is a SAFE method (define credentials as OS environmental variables)
- * -----------------------------------------------------------------------------
- */
-# define('DB_NAME', getenv('DB_NAME')); // database name
-#
-# define('DB_USER', getenv('DB_USER')); // database user-name
-#
-# define('DB_PASS', getenv('DB_PASS')); // user's pass
-#
-# define('PDO_HOST', getenv('PDO_HOST')); // database host (connection string)
-
-
-/** This is another SAFE method (keep credentials in an .env file)
- * -----------------------------------------------------------------------------
- */
-
-$ini_array = parse_ini_file("../core/auth/.env");
-
-define('DB_NAME', $ini_array['DB_NAME']);
-
-define('DB_USER', $ini_array['DB_USER']);
-
-define('DB_PASS', $ini_array['DB_PASS']);
-
-define('PDO_HOST', $ini_array['PDO_HOST']);
-
-
-/** This is just good enough
- * -----------------------------------------------------------------------------
- */
-#
-# if (!PRODUCTION) { // == Deployed on staging
-#
-# // STAGING SETTINGS:
-#
-# define('DB_NAME', 'dev_db_name');
-#
-# define('DB_USER', 'devUserName');
-#
-# define('DB_PASS', getenv('DBPASSWORD'));
-#
-# // PDO_HOST can be a hostname/port combination -or- a unix socket
-# // ...examples:
-# // define('PDO_HOST', 'host=/localhost') ## hostname case
-# // define('PDO_HOST', 'host=/localhost;port=3456') ## hostname/port case
-# // define('PDO_HOST', 'unix_socket=/sql/ex123:europe:some-db'); ## unix socket
-# define('PDO_HOST', 'unix_socket=/cloudsql/name-123456:europe-west4:name-db-eu');
-#
-# } else { // == Deployed on production
-#
-# // PRODUCTION SETTINGS:
-#
-# define('DB_NAME', 'your_db_name');
-# define('DB_USER', 'dbusername');
-# define('DB_PASS', getenv('DBPASSWORD'));
-# define('PDO_HOST', 'unix_socket=/cloudsql/name-123456:europe-west4:name-db-eu');
-#
-# }
-
-define('DB_TIMEZONE', "SET time_zone = 'Europe/Athens'");
-
-/** NOTE:
- * Both Redis and Memcached configurations are given as a template to work on;
- * In most cases the default values should do the job -- of course you need to
- * read the README file (check the project's root);
- * As these caching services are not fully tested you may need to ochestrate
- * the services in detail or edit the connection strings into the core classes
- * (hosted under the '/core/classes/cacher' folder)
- */
-
-
-/** REDIS SERVICE
- * -----------------------------------------------------------------------------
- * Most of the times Redis is running on 'localhost' (host = '127.0.0.1')
- * When implemented via anom's docker-composer (redis via bridge) then you need
- * do declare the hostname as 'redis'
- */
-#
-# if (!defined('REDIS_HOST')) define('REDIS_HOST', 'redis');
-#
-# if (!defined('REDIS_PORT')) define('REDIS_PORT', 6379);
-#
-# if (!defined('REDIS_PASS')) define('REDIS_PASS', null);
-
-
-/** MEMCACHED
- * -----------------------------------------------------------------------------
- * Memcached looks very much like Redis (plus, both are serving from RAM)
- * Usualy Memcashed is running localy so host is 'localhost' ('127.0.0.1')
- * If you use the framework's docker-composer implementation then
- * the hostname is 'anomemcached'
- */
-#
-#if (!defined('MEMCACHE_HOST')) define('MEMCACHE_HOST', 'anomemcached');