diff --git a/src/Config.php b/src/Config.php index bdb1255..308047b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -38,6 +38,9 @@ class Config extends \ArrayObject */ public function __construct() { + ini_set('display_errors', true); + error_reporting(-1); + $filename = getcwd() . '/../../pickles.php'; $environments = false; $environment = false; @@ -129,6 +132,12 @@ class Config extends \ArrayObject $config['environment'] = $environment; } + // Disable display errors in production + if ($environment == 'production') + { + ini_set('display_errors', false); + } + // Defaults expected Pickles options to false $this['pickles'] = [ 'cache' => false, diff --git a/src/pickles.php b/src/pickles.php deleted file mode 100644 index 69b263c..0000000 --- a/src/pickles.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @copyright Copyright 2007-2014, Josh Sherman - * @license http://www.opensource.org/licenses/mit-license.html - * @package PICKLES - * @link https://github.com/joshtronic/pickles - * @usage require_once 'pickles.php'; - */ - -// Turns on error before the config is loaded to help catch parse errors -ini_set('display_errors', true); -error_reporting(-1); - -// Defaults timezone to UTC if not set -if (ini_get('date.timezone') == '') -{ - ini_set('date.timezone', 'Etc/UTC'); -} - -// Loads the base config -$config = Pickles\Config::getInstance(); - -// Configures any available PHP configuration options -if (isset($config['php']) && is_array($config['php'])) -{ - foreach ($config['php'] as $variable => $value) - { - ini_set($variable, $value); - } -} -