Removed main config file and fixed smaller details

This commit is contained in:
Abel Hoogeveen 2019-01-16 20:18:46 +01:00
parent f1beb64ab1
commit 961a4c4081
No known key found for this signature in database
GPG Key ID: 96C2234920BF4292
4 changed files with 7 additions and 97 deletions

View File

@ -1,92 +0,0 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2019 TechFuze
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 1.1.1
*
* @version Version 1.2.0
*/
return array(
'base_url' => '',
'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,
);

View File

@ -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());
}

View File

@ -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'));
}
/**

View File

@ -225,7 +225,7 @@ class libraryTest extends CoreTestAbstract
public function tearDown()
{
Factory::getInstance()->config->getConfig('main')->revert();
Factory::getInstance()->config->getConfig('error')->revert();
}
}