diff --git a/app/sprinkles/core/config/default.php b/app/sprinkles/core/config/default.php index adab1bb51..b507b4a70 100755 --- a/app/sprinkles/core/config/default.php +++ b/app/sprinkles/core/config/default.php @@ -25,7 +25,7 @@ */ 'address_book' => [ 'admin' => [ - 'email' => getenv('SMTP_USER') ?: null, + 'email' => env('SMTP_USER'), 'name' => 'Site Administrator', ], ], @@ -97,7 +97,7 @@ * Note : CSRF Middleware should only be disabled for dev or debug purposes. */ 'csrf' => [ - 'enabled' => (getenv('CSRF_ENABLED') !== false) ? getenv('CSRF_ENABLED') : true, + 'enabled' => env('CSRF_ENABLED', true), 'name' => 'csrf', 'storage_limit' => 200, 'strength' => 16, @@ -124,12 +124,12 @@ */ 'db' => [ 'default' => [ - 'driver' => getenv('DB_DRIVER') ?: 'mysql', - 'host' => getenv('DB_HOST') ?: 'localhost', - 'port' => getenv('DB_PORT') ?: null, - 'database' => getenv('DB_NAME') ?: null, - 'username' => getenv('DB_USER') ?: null, - 'password' => getenv('DB_PASSWORD') ?: null, + 'driver' => env('DB_DRIVER', 'mysql'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT'), + 'database' => env('DB_NAME'), + 'username' => env('DB_USER'), + 'password' => env('DB_PASSWORD'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', @@ -160,8 +160,8 @@ * Supported Drivers for disk: "local", "ftp", "sftp", "s3", "rackspace" */ 'filesystems' => [ - 'default' => getenv('FILESYSTEM_DRIVER') ?: 'local', - 'cloud' => getenv('FILESYSTEM_CLOUD') ?: 's3', + 'default' => env('FILESYSTEM_DRIVER', 'local'), + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 'disks' => [ /* @@ -196,11 +196,11 @@ */ 's3' => [ 'driver' => 's3', - 'key' => getenv('AWS_ACCESS_KEY_ID') ?: '', - 'secret' => getenv('AWS_SECRET_ACCESS_KEY') ?: '', - 'region' => getenv('AWS_DEFAULT_REGION') ?: '', // See : http://docs.aws.amazon.com/general/latest/gr/rande.html - 'bucket' => getenv('AWS_BUCKET') ?: '', - 'url' => getenv('AWS_URL') ?: '', + 'key' => env('AWS_ACCESS_KEY_ID', ''), + 'secret' => env('AWS_SECRET_ACCESS_KEY', ''), + 'region' => env('AWS_DEFAULT_REGION', ''), // See : http://docs.aws.amazon.com/general/latest/gr/rande.html + 'bucket' => env('AWS_BUCKET', ''), + 'url' => env('AWS_URL', ''), ], /* * Rackspace Config. Config should go in .env file. see : @@ -213,12 +213,12 @@ */ 'rackspace' => [ 'driver' => 'rackspace', - 'username' => getenv('RACKSPACE_USERNAME') ?: '', - 'key' => getenv('RACKSPACE_KEY') ?: '', - 'container' => getenv('RACKSPACE_CONTAINER') ?: '', - 'endpoint' => getenv('RACKSPACE_ENDPOINT') ?: '', - 'region' => getenv('RACKSPACE_REGION') ?: '', - 'url_type' => getenv('RACKSPACE_URL_TYPE') ?: '', + 'username' => env('RACKSPACE_USERNAME', ''), + 'key' => env('RACKSPACE_KEY', ''), + 'container' => env('RACKSPACE_CONTAINER', ''), + 'endpoint' => env('RACKSPACE_ENDPOINT', ''), + 'region' => env('RACKSPACE_REGION', ''), + 'url_type' => env('RACKSPACE_URL_TYPE', ''), ], ], ], @@ -231,12 +231,12 @@ */ 'mail' => [ 'mailer' => 'smtp', // Set to one of 'smtp', 'mail', 'qmail', 'sendmail' - 'host' => getenv('SMTP_HOST') ?: null, + 'host' => env('SMTP_HOST'), 'port' => 587, 'auth' => true, 'secure' => 'tls', // Enable TLS encryption. Set to `tls`, `ssl` or `false` (to disabled) - 'username' => getenv('SMTP_USER') ?: null, - 'password' => getenv('SMTP_PASSWORD') ?: null, + 'username' => env('SMTP_USER'), + 'password' => env('SMTP_PASSWORD'), 'smtp_debug' => 4, 'message_options' => [ 'CharSet' => 'UTF-8', diff --git a/app/sprinkles/core/config/testing.php b/app/sprinkles/core/config/testing.php index 38a87253f..6d1231f88 100755 --- a/app/sprinkles/core/config/testing.php +++ b/app/sprinkles/core/config/testing.php @@ -61,12 +61,12 @@ * Disable native sessions in tests */ 'session' => [ - 'handler' => getenv('TEST_SESSION_HANDLER') ?: 'array', + 'handler' => env('TEST_SESSION_HANDLER', 'array'), ], /* * Database to use when using the TestDatabase Trait */ 'testing' => [ - 'dbConnection' => getenv('TEST_DB') ?: 'test_integration', + 'dbConnection' => env('TEST_DB', 'test_integration'), ], ]; diff --git a/app/sprinkles/core/src/Bakery/DebugCommand.php b/app/sprinkles/core/src/Bakery/DebugCommand.php index 083db3ea2..7f30f8d72 100644 --- a/app/sprinkles/core/src/Bakery/DebugCommand.php +++ b/app/sprinkles/core/src/Bakery/DebugCommand.php @@ -49,10 +49,10 @@ protected function execute(InputInterface $input, OutputInterface $output) // Perform tasks & display info $this->io->definitionList( - ['UserFrosing version' => \UserFrosting\VERSION], + ['UserFrosting version' => \UserFrosting\VERSION], ['OS Name' => php_uname('s')], ['Project Root' => \UserFrosting\ROOT_DIR], - ['Environment mode' => getenv('UF_MODE')], + ['Environment mode' => env('UF_MODE', 'default')], ['PHP Version' => $this->checkPhpVersion()], ['Node Version' => $this->checkNodeVersion()], ['NPM Version' => $this->checkNpmVersion()] diff --git a/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php b/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php index e9c61dd4a..3d1ed6450 100755 --- a/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php +++ b/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php @@ -240,7 +240,7 @@ public function register(ContainerInterface $container) } // Get configuration mode from environment - $mode = getenv('UF_MODE') ?: ''; + $mode = env('UF_MODE', ''); // Construct and load config repository $builder = new ConfigPathBuilder($c->locator, 'config://'); diff --git a/app/sprinkles/core/src/Util/CheckEnvironment.php b/app/sprinkles/core/src/Util/CheckEnvironment.php index 055fe4ec8..987af879e 100644 --- a/app/sprinkles/core/src/Util/CheckEnvironment.php +++ b/app/sprinkles/core/src/Util/CheckEnvironment.php @@ -382,7 +382,7 @@ public function checkPhp() */ public function isProduction() { - return getenv('UF_MODE') == 'production'; + return env('UF_MODE') == 'production'; } /** @@ -392,6 +392,6 @@ public function isProduction() */ public function skipPermissionsCheck() { - return getenv('SKIP_PERMISSION_CHECK') ? true : false; + return env('SKIP_PERMISSION_CHECK', false); } } diff --git a/app/system/Bakery/BaseCommand.php b/app/system/Bakery/BaseCommand.php index e91fe136a..3ce30f816 100644 --- a/app/system/Bakery/BaseCommand.php +++ b/app/system/Bakery/BaseCommand.php @@ -62,7 +62,7 @@ protected function isProduction(): bool { // Need to touch the config service first to load dotenv values $config = $this->ci->config; - $mode = getenv('UF_MODE') ?: ''; + $mode = env('UF_MODE', ''); return $mode === 'production'; }