diff options
author | Marvin Borner | 2018-05-23 22:23:28 +0200 |
---|---|---|
committer | Marvin Borner | 2018-05-23 22:23:28 +0200 |
commit | b66a61addb6c8e66cb26fcf74b532d68891267e4 (patch) | |
tree | 05e9449ff25bdc98f68105f41923ccb9f6ef5095 /main/app/sprinkles/core/config | |
parent | 1d4ef435177a5f9b6d1a289800d933e49be0c550 (diff) |
Refactored code, many fixes and improvements in chat backend+frontend
Diffstat (limited to 'main/app/sprinkles/core/config')
-rw-r--r-- | main/app/sprinkles/core/config/default.php | 332 | ||||
-rw-r--r-- | main/app/sprinkles/core/config/dev.php | 50 | ||||
-rw-r--r-- | main/app/sprinkles/core/config/production.php | 68 | ||||
-rw-r--r-- | main/app/sprinkles/core/config/testing.php | 38 |
4 files changed, 244 insertions, 244 deletions
diff --git a/main/app/sprinkles/core/config/default.php b/main/app/sprinkles/core/config/default.php index 60e3345..7e861df 100644 --- a/main/app/sprinkles/core/config/default.php +++ b/main/app/sprinkles/core/config/default.php @@ -1,183 +1,183 @@ <?php - /** - * Core configuration file for UserFrosting. You must override/extend this in your site's configuration file. - * - * Sensitive credentials should be stored in an environment variable or your .env file. - * Database password: DB_PASSWORD - * SMTP server password: SMTP_PASSWORD - */ +/** + * Core configuration file for UserFrosting. You must override/extend this in your site's configuration file. + * + * Sensitive credentials should be stored in an environment variable or your .env file. + * Database password: DB_PASSWORD + * SMTP server password: SMTP_PASSWORD + */ - return [ - 'address_book' => [ - 'admin' => [ - 'email' => getenv('SMTP_USER') ?: null, - 'name' => 'Site Administrator' - ] +return [ + 'address_book' => [ + 'admin' => [ + 'email' => getenv('SMTP_USER') ?: NULL, + 'name' => 'Site Administrator' + ] + ], + 'alert' => [ + 'storage' => 'session', // Set to one of `cache` or `session` + 'key' => 'site.alerts', // the key to use to store flash messages + ], + 'assets' => [ + 'compiled' => [ + 'path' => 'assets', + 'schema' => 'bundle.result.json' ], - 'alert' => [ - 'storage' => 'session', // Set to one of `cache` or `session` - 'key' => 'site.alerts', // the key to use to store flash messages + 'raw' => [ + 'path' => 'assets-raw', + 'schema' => 'asset-bundles.json' ], - 'assets' => [ - 'compiled' => [ - 'path' => 'assets', - 'schema' => 'bundle.result.json' - ], - 'raw' => [ - 'path' => 'assets-raw', - 'schema' => 'asset-bundles.json' - ], - 'use_raw' => true + 'use_raw' => TRUE + ], + 'cache' => [ + 'driver' => 'file', // Set to one of `file`, `memcached`, `redis` + 'prefix' => 'userfrosting', // Edit prefix to something unique when multiple instance of memcached/redis are used on the same server + 'memcached' => [ + 'host' => '127.0.0.1', + 'port' => 11211, + 'weight' => 100 ], - 'cache' => [ - 'driver' => 'file', // Set to one of `file`, `memcached`, `redis` - 'prefix' => 'userfrosting', // Edit prefix to something unique when multiple instance of memcached/redis are used on the same server - 'memcached' => [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'weight' => 100 - ], - 'redis' => [ - 'host' => '127.0.0.1', - 'password' => null, - 'port' => 6379, - 'database' => 0 - ], - 'twig' => false + 'redis' => [ + 'host' => '127.0.0.1', + 'password' => NULL, + 'port' => 6379, + 'database' => 0 ], - // CSRF middleware settings (see https://github.com/slimphp/Slim-Csrf) - 'csrf' => [ - 'name' => 'csrf', - 'storage_limit' => 200, - 'strength' => 16, - 'persistent_token' => true, - // A list of url paths to ignore CSRF checks on - 'blacklist' => [ - // URL paths will be matched against each regular expression in this list. - // Each regular expression should map to an array of methods. - // Regular expressions will be delimited with ~ in preg_match, so if you - // have routes with ~ in them, you must escape this character in your regex. - // Also, remember to use ^ when you only want to match the beginning of a URL path! - ] - ], - 'db' => [ - 'default' => [ - 'driver' => getenv('DB_DRIVER') ?: 'mysql', - 'host' => getenv('DB_HOST') ?: null, - 'port' => getenv('DB_PORT') ?: null, - 'database' => getenv('DB_NAME') ?: null, - 'username' => getenv('DB_USER') ?: null, - 'password' => getenv('DB_PASSWORD') ?: null, - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '' - ] + 'twig' => FALSE + ], + // CSRF middleware settings (see https://github.com/slimphp/Slim-Csrf) + 'csrf' => [ + 'name' => 'csrf', + 'storage_limit' => 200, + 'strength' => 16, + 'persistent_token' => TRUE, + // A list of url paths to ignore CSRF checks on + 'blacklist' => [ + // URL paths will be matched against each regular expression in this list. + // Each regular expression should map to an array of methods. + // Regular expressions will be delimited with ~ in preg_match, so if you + // have routes with ~ in them, you must escape this character in your regex. + // Also, remember to use ^ when you only want to match the beginning of a URL path! + ] + ], + 'db' => [ + 'default' => [ + 'driver' => getenv('DB_DRIVER') ?: 'mysql', + 'host' => getenv('DB_HOST') ?: NULL, + 'port' => getenv('DB_PORT') ?: NULL, + 'database' => getenv('DB_NAME') ?: NULL, + 'username' => getenv('DB_USER') ?: NULL, + 'password' => getenv('DB_PASSWORD') ?: NULL, + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '' + ] + ], + 'debug' => [ + 'queries' => FALSE, + 'smtp' => FALSE, + 'twig' => FALSE + ], + 'mail' => [ + 'mailer' => 'smtp', // Set to one of 'smtp', 'mail', 'qmail', 'sendmail' + 'host' => getenv('SMTP_HOST') ?: NULL, + 'port' => 465, + 'auth' => TRUE, + 'secure' => 'ssl', + 'username' => getenv('SMTP_USER') ?: NULL, + 'password' => getenv('SMTP_PASSWORD') ?: NULL, + 'smtp_debug' => 4, + 'message_options' => [ + 'CharSet' => 'UTF-8', + 'isHtml' => TRUE, + 'Timeout' => 15 + ] + ], + // Filesystem paths + 'path' => [ + 'document_root' => str_replace(DIRECTORY_SEPARATOR, \UserFrosting\DS, $_SERVER['DOCUMENT_ROOT']), + 'public_relative' => dirname($_SERVER['SCRIPT_NAME']) // The location of `index.php` relative to the document root. Use for sites installed in subdirectories of your web server's document root. + ], + 'session' => [ + 'handler' => 'file', + // Config values for when using db-based sessions + 'database' => [ + 'table' => 'sessions' ], - 'debug' => [ - 'queries' => false, - 'smtp' => false, - 'twig' => false + 'name' => 'uf4', + 'minutes' => 120, + 'cache_limiter' => FALSE, + // Decouples the session keys used to store certain session info + 'keys' => [ + 'csrf' => 'site.csrf', // the key (prefix) used to store an ArrayObject of CSRF tokens. + ] + ], + // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings + 'settings' => [ + 'displayErrorDetails' => TRUE + ], + // "Site" settings that are automatically passed to Twig + 'site' => [ + 'AdminLTE' => [ + 'skin' => 'blue' ], - 'mail' => [ - 'mailer' => 'smtp', // Set to one of 'smtp', 'mail', 'qmail', 'sendmail' - 'host' => getenv('SMTP_HOST') ?: null, - 'port' => 465, - 'auth' => true, - 'secure' => 'ssl', - 'username' => getenv('SMTP_USER') ?: null, - 'password' => getenv('SMTP_PASSWORD') ?: null, - 'smtp_debug' => 4, - 'message_options' => [ - 'CharSet' => 'UTF-8', - 'isHtml' => true, - 'Timeout' => 15 + 'analytics' => [ + 'google' => [ + 'code' => 'UA-109245179-2', + 'enabled' => TRUE ] ], - // Filesystem paths - 'path' => [ - 'document_root' => str_replace(DIRECTORY_SEPARATOR, \UserFrosting\DS, $_SERVER['DOCUMENT_ROOT']), - 'public_relative' => dirname($_SERVER['SCRIPT_NAME']) // The location of `index.php` relative to the document root. Use for sites installed in subdirectories of your web server's document root. + 'author' => 'Author', + 'csrf' => NULL, // Do not set this variable. The core Twig extension will override it with values from the CSRF service. + 'debug' => [ + 'ajax' => FALSE, + 'info' => TRUE ], - 'session' => [ - 'handler' => 'file', - // Config values for when using db-based sessions - 'database' => [ - 'table' => 'sessions' + 'locales' => [ + // Should be ordered according to https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers, + // with the exception of English, which as the default language comes first. + 'available' => [ + 'en_US' => 'English', + 'zh_CN' => '中文', + 'es_ES' => 'Español', + 'ar' => 'العربية', + 'pt_PT' => 'Português', + 'ru_RU' => 'русский', + 'tlh' => 'tlhIngan Hol', + 'de_DE' => 'Deutsch', + 'fr_FR' => 'Français', + 'tr' => 'Türk', + 'it_IT' => 'Italiano', + 'th_TH' => 'ภาษาไทย', + 'fa' => 'فارسی' ], - 'name' => 'uf4', - 'minutes' => 120, - 'cache_limiter' => false, - // Decouples the session keys used to store certain session info - 'keys' => [ - 'csrf' => 'site.csrf', // the key (prefix) used to store an ArrayObject of CSRF tokens. - ] + // This can be a comma-separated list, to load multiple fallback locales + 'default' => 'en_US' ], - // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings - 'settings' => [ - 'displayErrorDetails' => true + 'title' => 'BEAM-Messenger', + // Global ufTable settings + 'uf_table' => [ + 'use_loading_transition' => TRUE ], - // "Site" settings that are automatically passed to Twig - 'site' => [ - 'AdminLTE' => [ - 'skin' => 'blue' - ], - 'analytics' => [ - 'google' => [ - 'code' => 'UA-109245179-2', - 'enabled' => true - ] + // URLs + 'uri' => [ + 'base' => [ + 'host' => isset($_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '/') : 'localhost', + 'scheme' => empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off' ? 'http' : 'https', + 'port' => isset($_SERVER['SERVER_PORT']) ? (int)$_SERVER['SERVER_PORT'] : NULL, + 'path' => isset($_SERVER['SCRIPT_NAME']) ? trim(dirname($_SERVER['SCRIPT_NAME']), '/\\') : '' ], - 'author' => 'Author', - 'csrf' => null, // Do not set this variable. The core Twig extension will override it with values from the CSRF service. - 'debug' => [ - 'ajax' => false, - 'info' => true - ], - 'locales' => [ - // Should be ordered according to https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers, - // with the exception of English, which as the default language comes first. - 'available' => [ - 'en_US' => 'English', - 'zh_CN' => '中文', - 'es_ES' => 'Español', - 'ar' => 'العربية', - 'pt_PT' => 'Português', - 'ru_RU' => 'русский', - 'tlh' => 'tlhIngan Hol', - 'de_DE' => 'Deutsch', - 'fr_FR' => 'Français', - 'tr' => 'Türk', - 'it_IT' => 'Italiano', - 'th_TH' => 'ภาษาไทย', - 'fa' => 'فارسی' - ], - // This can be a comma-separated list, to load multiple fallback locales - 'default' => 'en_US' - ], - 'title' => 'BEAM-Messenger', - // Global ufTable settings - 'uf_table' => [ - 'use_loading_transition' => true - ], - // URLs - 'uri' => [ - 'base' => [ - 'host' => isset($_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '/') : 'localhost', - 'scheme' => empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off' ? 'http' : 'https', - 'port' => isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : null, - 'path' => isset($_SERVER['SCRIPT_NAME']) ? trim(dirname($_SERVER['SCRIPT_NAME']), '/\\') : '' - ], - 'author' => 'https://marvinborner.me', - 'publisher' => 'https://marvinborner.me' - ] - ], - 'php' => [ - 'timezone' => 'Europe/Berlin', - 'error_reporting' => E_ALL, // Development - report all errors and suggestions - 'display_errors' => 'true', - 'log_errors' => 'true', - // Let PHP itself render errors natively. Useful if a fatal error is raised in our custom shutdown handler. - 'display_errors_native' => 'true' + 'author' => 'https://marvinborner.me', + 'publisher' => 'https://marvinborner.me' ] - ]; + ], + 'php' => [ + 'timezone' => 'Europe/Berlin', + 'error_reporting' => E_ALL, // Development - report all errors and suggestions + 'display_errors' => 'true', + 'log_errors' => 'true', + // Let PHP itself render errors natively. Useful if a fatal error is raised in our custom shutdown handler. + 'display_errors_native' => 'true' + ] +]; diff --git a/main/app/sprinkles/core/config/dev.php b/main/app/sprinkles/core/config/dev.php index daab24c..63aeeab 100644 --- a/main/app/sprinkles/core/config/dev.php +++ b/main/app/sprinkles/core/config/dev.php @@ -1,30 +1,30 @@ <?php - /** - * Default development config file for UserFrosting. Sets up UserFrosting for easier development. - * - */ +/** + * Default development config file for UserFrosting. Sets up UserFrosting for easier development. + * + */ - return [ - 'assets' => [ - 'use_raw' => true - ], - 'cache' => [ - 'twig' => false - ], +return [ + 'assets' => [ + 'use_raw' => TRUE + ], + 'cache' => [ + 'twig' => FALSE + ], + 'debug' => [ + 'twig' => TRUE, + 'auth' => TRUE, + 'smtp' => TRUE + ], + // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings + 'settings' => [ + 'displayErrorDetails' => TRUE + ], + 'site' => [ 'debug' => [ - 'twig' => true, - 'auth' => true, - 'smtp' => true - ], - // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings - 'settings' => [ - 'displayErrorDetails' => true - ], - 'site' => [ - 'debug' => [ - 'ajax' => true, - 'info' => true - ] + 'ajax' => TRUE, + 'info' => TRUE ] - ];
\ No newline at end of file + ] +];
\ No newline at end of file diff --git a/main/app/sprinkles/core/config/production.php b/main/app/sprinkles/core/config/production.php index d0154d4..8b970a7 100644 --- a/main/app/sprinkles/core/config/production.php +++ b/main/app/sprinkles/core/config/production.php @@ -1,40 +1,40 @@ <?php - /** - * Default production config file for UserFrosting. You may override/extend this in your site's configuration file to customize deploy settings. - * - */ +/** + * Default production config file for UserFrosting. You may override/extend this in your site's configuration file to customize deploy settings. + * + */ - return [ - 'assets' => [ - 'use_raw' => false - ], - 'cache' => [ - 'twig' => true - ], - 'debug' => [ - 'twig' => false, - 'auth' => false, - 'smtp' => false - ], - // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings - 'settings' => [ - 'routerCacheFile' => \UserFrosting\ROOT_DIR . '/' . \UserFrosting\APP_DIR_NAME . '/' . \UserFrosting\CACHE_DIR_NAME . '/' . 'routes.cache', - 'displayErrorDetails' => false - ], - 'site' => [ - 'analytics' => [ - 'google' => [ - 'enabled' => true - ] - ], - 'debug' => [ - 'ajax' => false, - 'info' => false +return [ + 'assets' => [ + 'use_raw' => FALSE + ], + 'cache' => [ + 'twig' => TRUE + ], + 'debug' => [ + 'twig' => FALSE, + 'auth' => FALSE, + 'smtp' => FALSE + ], + // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings + 'settings' => [ + 'routerCacheFile' => \UserFrosting\ROOT_DIR . '/' . \UserFrosting\APP_DIR_NAME . '/' . \UserFrosting\CACHE_DIR_NAME . '/' . 'routes.cache', + 'displayErrorDetails' => FALSE + ], + 'site' => [ + 'analytics' => [ + 'google' => [ + 'enabled' => TRUE ] ], - 'php' => [ - 'display_errors' => 'false', - 'log_errors' => 'true' + 'debug' => [ + 'ajax' => FALSE, + 'info' => FALSE ] - ]; + ], + 'php' => [ + 'display_errors' => 'false', + 'log_errors' => 'true' + ] +]; diff --git a/main/app/sprinkles/core/config/testing.php b/main/app/sprinkles/core/config/testing.php index 7da03c2..4d5bb04 100644 --- a/main/app/sprinkles/core/config/testing.php +++ b/main/app/sprinkles/core/config/testing.php @@ -1,23 +1,23 @@ <?php - /** - * Default testing config file for UserFrosting. You may override/extend this in your site's configuration file to customize deploy settings. - * - */ +/** + * Default testing config file for UserFrosting. You may override/extend this in your site's configuration file to customize deploy settings. + * + */ - return [ - 'cache' => [ - 'illuminate' => [ - 'default' => 'array', - ] - ], - 'db' => [ - 'test_integration' => [ - 'driver' => 'sqlite', - 'database' => ':memory:', - ] - ], - 'settings' => [ - 'displayErrorDetails' => false +return [ + 'cache' => [ + 'illuminate' => [ + 'default' => 'array', ] - ]; + ], + 'db' => [ + 'test_integration' => [ + 'driver' => 'sqlite', + 'database' => ':memory:', + ] + ], + 'settings' => [ + 'displayErrorDetails' => FALSE + ] +]; |