diff --git a/src/Config/config.main.php b/src/Config/config.main.php deleted file mode 100644 index f05b0b6..0000000 --- a/src/Config/config.main.php +++ /dev/null @@ -1,92 +0,0 @@ - '', - 'index_page' => 'index.php', - 'server_name' => '', - - 'administrator_mail' => '', - - 'default_controller' => 'standard', - 'default_function' => 'index', - 'application_prefix' => 'MY_', - - 'charset' => 'UTF-8', - - /* - |-------------------------------------------------------------------------- - | Cookie Related Variables - |-------------------------------------------------------------------------- - | - | 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions - | 'cookie_domain' = Set to .your-domain.com for site-wide cookies - | 'cookie_path' = Typically will be a forward slash - | 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists. - | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript) - | - | Note: These settings (with the exception of 'cookie_prefix' and - | 'cookie_httponly') will also affect sessions. - | - */ - 'cookie_prefix' => '', - 'cookie_domain' => '', - 'cookie_path' => '/', - 'cookie_secure' => FALSE, - 'cookie_httponly' => FALSE, - - /* - |-------------------------------------------------------------------------- - | Output Compression - |-------------------------------------------------------------------------- - | - | Enables Gzip output compression for faster page loads. When enabled, - | the output class will test whether your server supports Gzip. - | Even if it does, however, not all browsers support compression - | so enable only if you are reasonably sure your visitors can handle it. - | - | Only used if zlib.output_compression is turned off in your php.ini. - | Please do not use it together with httpd-level output compression. - | - | VERY IMPORTANT: If you are getting a blank page when compression is enabled it - | means you are prematurely outputting something to your browser. It could - | even be a line of whitespace at the end of one of your scripts. For - | compression to work, nothing can be sent before the output buffer is called - | by the output class. Do not 'echo' any values with compression enabled. - | - */ - 'compress_output' => FALSE, -); diff --git a/src/FuzeWorks/Factory.php b/src/FuzeWorks/Factory.php index 1ef3e45..568a894 100644 --- a/src/FuzeWorks/Factory.php +++ b/src/FuzeWorks/Factory.php @@ -35,7 +35,9 @@ */ namespace FuzeWorks; +use FuzeWorks\Exception\ConfigException; use FuzeWorks\Exception\CoreException; +use FuzeWorks\Exception\EventException; use FuzeWorks\Exception\FactoryException; /** @@ -149,12 +151,12 @@ class Factory * @return Factory * @throws CoreException */ - public function init() + public function init(): Factory { // Load the config file of the FuzeWorks core try { $cfg = $this->config->get('core'); - } catch (Exception\ConfigException $e) { + } catch (ConfigException $e) { throw new CoreException("Could not initiate Factory. Config 'core 'could not be found."); } @@ -177,7 +179,7 @@ class Factory // And fire the coreStartEvent try { Events::fireEvent('coreStartEvent'); - } catch (Exception\EventException $e) { + } catch (EventException $e) { throw new CoreException("Could not initiate Factory. coreStartEvent threw exception: ".$e->getMessage()); } diff --git a/test/core/core_configTest.php b/test/core/core_configTest.php index 24051bf..3a09be5 100644 --- a/test/core/core_configTest.php +++ b/test/core/core_configTest.php @@ -67,7 +67,7 @@ class configTest extends CoreTestAbstract */ public function testLoadConfig() { - $this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $this->config->getConfig('main')); + $this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $this->config->getConfig('error')); } /** diff --git a/test/core/core_libraryTest.php b/test/core/core_libraryTest.php index 68027b8..3a72d33 100644 --- a/test/core/core_libraryTest.php +++ b/test/core/core_libraryTest.php @@ -225,7 +225,7 @@ class libraryTest extends CoreTestAbstract public function tearDown() { - Factory::getInstance()->config->getConfig('main')->revert(); + Factory::getInstance()->config->getConfig('error')->revert(); } }