Updated directory consistency and notice in copyright.

This commit is contained in:
Abel Hoogeveen 2018-12-13 23:45:55 +01:00
parent 78c92471e2
commit 4086af2040
No known key found for this signature in database
GPG Key ID: 96C2234920BF4292
102 changed files with 727 additions and 286 deletions

View File

@ -8,7 +8,7 @@ stages:
- deploy
build:composer:
image: php:7.1
image: php:7.2
stage: build
script:
- curl -sS https://getcomposer.org/installer | php
@ -18,9 +18,9 @@ build:composer:
paths:
- vendor/
test:7.0:
test:7.1:
stage: test
image: php:7.0
image: php:7.1
script:
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
cache:
@ -28,9 +28,9 @@ test:7.0:
paths:
- vendor
test:7.1:
test:7.2:
stage: test
image: php:7.1
image: php:7.2
script:
- vendor/bin/phpunit -c tests/phpunit.xml --coverage-text
cache:
@ -40,7 +40,7 @@ test:7.1:
release:
stage: deploy
image: php:7.1
image: php:7.2
only:
- master
script:

View File

@ -14,10 +14,10 @@
}
],
"require": {
"php": ">=7.0.0"
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "6.2.*",
"phpunit/phpunit": "^7",
"mikey179/vfsStream": "1.1.*",
"tracy/tracy": "2.4.*"
},

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -36,6 +36,7 @@
namespace FuzeWorks;
use FuzeWorks\ConfigORM\ConfigORM;
use FuzeWorks\Event\ConfigGetEvent;
use FuzeWorks\Exception\ConfigException;
/**
@ -44,8 +45,7 @@ use FuzeWorks\Exception\ConfigException;
* This class gives access to the config files. It allows you to open configurations and edit them.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @todo Implement config extensions
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Config
{
@ -55,7 +55,7 @@ class Config
*
* @var array Array of all loaded config file ORM's
*/
protected $cfg = array();
protected $cfg = [];
/**
* Paths where Helpers can be found.
@ -64,7 +64,7 @@ class Config
*
* @var array Array of paths where helpers can be found
*/
protected $configPaths = array();
protected $configPaths = [];
public function __construct()
{
@ -79,7 +79,7 @@ class Config
* @return ConfigORM of the config file. Allows for easy reading and editing of the file
* @throws ConfigException
*/
public function getConfig($configName, array $configPaths = array()): ConfigORM
public function getConfig(string $configName, array $configPaths = []): ConfigORM
{
// First determine what directories to use
$directories = (empty($configPaths) ? $this->configPaths : $configPaths);
@ -97,12 +97,22 @@ class Config
$this->cfg[$configName] = $this->loadConfigFile($configName, $directories);
return $this->cfg[$configName];
}
/**
* @param $configName
* @return ConfigORM
* @throws ConfigException
*/
public function get($configName): ConfigORM
{
return $this->getConfig($configName);
}
/**
* @param $configName
* @return ConfigORM
* @throws ConfigException
*/
public function __get($configName): ConfigORM
{
return $this->getConfig($configName);
@ -113,7 +123,7 @@ class Config
*/
public function discardConfigFiles()
{
$this->cfg = array();
$this->cfg = [];
}
/**
@ -124,30 +134,46 @@ class Config
* @return ConfigORM of the config file. Allows for easy reading and editing of the file
* @throws ConfigException
*/
protected function loadConfigFile($configName, array $configPaths): ConfigORM
protected function loadConfigFile(string $configName, array $configPaths): ConfigORM
{
// Fire event to intercept the loading of a config file
/** @var ConfigGetEvent $event */
try {
$event = Events::fireEvent('configGetEvent', $configName, $configPaths);
// @codeCoverageIgnoreStart
} catch (Exception\EventException $e) {
throw new ConfigException("Could not load config. ConfigGetEvent fired exception: '" . $e->getMessage() . "''", 1);
// @codeCoverageIgnoreEnd
}
// If cancelled, load empty config
if ($event->isCancelled())
{
return new ConfigORM();
}
// Cycle through all directories
foreach ($configPaths as $directory)
foreach ($event->configPaths as $configPath)
{
// If file exists, load it and break the loop
$file = $directory . DS . 'config.'.$configName.'.php';
$file = $configPath . DS . 'config.'.$event->configName.'.php';
if (file_exists($file))
{
// Load object
return new ConfigORM($file);
return (new ConfigORM())->load($file);
break;
}
}
// Try fallback
$file = Core::$coreDir . DS . 'Config' . DS . 'config.' . $configName . '.php';
$file = Core::$coreDir . DS . 'Config' . DS . 'config.' . $event->configName . '.php';
if (file_exists($file))
{
// Load object
return new ConfigORM($file);
return (new ConfigORM())->load($file);
}
throw new ConfigException("Could not load config. File $configName not found", 1);
throw new ConfigException("Could not load config. File $event->configName not found", 1);
}
/**
@ -157,7 +183,7 @@ class Config
*/
public function setDirectories(array $directories)
{
$this->configPaths = $directories;
$this->configPaths = array_merge($this->configPaths, $directories);
}
/**

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -43,7 +43,7 @@ use FuzeWorks\Exception\ConfigException;
* Handles entries in the config directory of FuzeWorks and is able to dynamically update them when requested
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class ConfigORM extends ConfigORMAbstract
{
@ -55,28 +55,30 @@ class ConfigORM extends ConfigORMAbstract
private $file;
/**
* Sets up the class and the connection to the PHP file.
* Load the ConfigORM file.
*
* @param string $filename The current filename
*
* @throws ConfigException on fatal error
* @param string $file
* @return ConfigORM
* @throws ConfigException
*/
public function __construct($file = null)
public function load(string $file = ''): ConfigORM
{
if (is_null($file))
if (empty($file))
{
throw new ConfigException('Could not load config file. No file provided', 1);
}
elseif (file_exists($file))
elseif (file_exists($file))
{
$this->file = $file;
$this->cfg = (array) include $file;
$this->originalCfg = $this->cfg;
}
else
}
else
{
throw new ConfigException('Could not load config file. Config file does not exist', 1);
}
return $this;
}
/**
@ -84,7 +86,7 @@ class ConfigORM extends ConfigORMAbstract
*
* @throws ConfigException on fatal error
*/
public function commit()
public function commit(): bool
{
// Write the changes
if (is_writable($this->file)) {

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -44,23 +44,23 @@ use Iterator;
* A file can also be returned using toArray(), so it will be converted to an array
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
abstract class ConfigORMAbstract implements Iterator
{
/**
* The original state of a config file. Can be reverted to using revert().
*
* @var StdObject Config file
* @var array Config file
*/
protected $originalCfg;
protected $originalCfg = [];
/**
* The current state of a config file.
*
* @var StdObject Config file
* @var array Config file
*/
protected $cfg;
protected $cfg = [];
/**
* Revert to the original conditions of the config file.

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -49,7 +49,7 @@ use Tracy\Debugger;
*
* This allows for more flexible startups.
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Configurator
{
@ -88,7 +88,7 @@ class Configurator
* @return Configurator
* @throws InvalidArgumentException
*/
public function setLogDirectory(string $path)
public function setLogDirectory(string $path): Configurator
{
if (!is_dir($path))
throw new InvalidArgumentException("Could not set log directory. Directory does not exist", 1);
@ -104,7 +104,7 @@ class Configurator
* @return Configurator
* @throws InvalidArgumentException
*/
public function setTempDirectory(string $path)
public function setTempDirectory(string $path): Configurator
{
if (!is_dir($path))
throw new InvalidArgumentException("Could not set temp directory. Directory does not exist", 1);
@ -120,7 +120,7 @@ class Configurator
* @param string $category Optional. Defaults to 'app
* @return $this
*/
public function addDirectory(string $directory, string $category = 'app')
public function addDirectory(string $directory, string $category = 'app'): Configurator
{
$this->directories[$category][] = $directory;
@ -135,7 +135,7 @@ class Configurator
* @param iComponent $component
* @return Configurator
*/
public function addComponent(iComponent $component)
public function addComponent(iComponent $component): Configurator
{
foreach ($component->getClasses() as $objectName => $className) {
$this->components[$objectName] = $className;
@ -152,7 +152,7 @@ class Configurator
* @return Configurator
* @throws InvalidArgumentException
*/
public function setTimeZone(string $timezone)
public function setTimeZone(string $timezone): Configurator
{
if (!date_default_timezone_set($timezone))
throw new InvalidArgumentException("Could not set timezone. Invalid timezone provided.", 1);
@ -166,7 +166,7 @@ class Configurator
* @param array $params
* @return Configurator
*/
public function setParameters(array $params)
public function setParameters(array $params): Configurator
{
foreach ($params as $key => $value) {
$this->parameters[$key] = $value;
@ -182,7 +182,7 @@ class Configurator
* @param bool $bool
* @return Configurator
*/
public function enableDebugMode(bool $bool = true)
public function enableDebugMode(bool $bool = true): Configurator
{
$this->parameters['debugEnabled'] = $bool;
@ -197,7 +197,7 @@ class Configurator
* @return Configurator
* @throws InvalidArgumentException
*/
public function setDebugAddress($address = 'NONE')
public function setDebugAddress($address = 'NONE'): Configurator
{
// First we fetch the list
if (!is_string($address) && !is_array($address))
@ -240,7 +240,7 @@ class Configurator
* @param string
* @return Configurator
*/
public function setDebugEmail($email): self
public function setDebugEmail($email): Configurator
{
$this->parameters['debugEmail'] = $email;
@ -303,7 +303,8 @@ class Configurator
if ($component == 'app')
continue;
$container->{$component}->setDirectories($directories);
if (method_exists($container->{$component}, 'setDirectories'))
$container->{$component}->setDirectories($directories);
}
return $container;

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -43,8 +43,9 @@ use FuzeWorks\Exception\CoreException;
*
* Holds all the modules and starts the framework. Allows for starting and managing modules
*
* @todo Test directory priorities in separate components
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Core
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -42,7 +42,7 @@ namespace FuzeWorks;
* A simple class for events. The only current purpose is to be able to cancel events, but it can be easily extended.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Event
{

View File

@ -0,0 +1,72 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
namespace FuzeWorks\Event;
use FuzeWorks\Event;
/**
* Event that gets loaded when a config is retrieved.
*
* Use this to cancel the loading of a config, or change the config to be loaded
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class ConfigGetEvent extends Event
{
/**
* The name of the config that gets retrieved
*
* @var string
*/
public $configName;
/**
* The directories the config might be found in
*
* @var array
*/
public $configPaths;
public function init(string $configName, array $configPaths)
{
$this->configName = $configName;
$this->configPaths = $configPaths;
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -44,7 +44,7 @@ use FuzeWorks\Event;
* Use this to cancel the loading of a helper, or change the helper to be loaded
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class HelperLoadEvent extends Event
{
@ -59,29 +59,14 @@ class HelperLoadEvent extends Event
/**
* The directory of the helper that gets loaded
*
* @var string
* @var array
*/
public $helperFile;
public $helperPaths;
/**
* An optional extension helper name that can get loaded.
*
* @var string|null
*/
public $extendedHelperName = null;
/**
* The directory of an optional extension helper that can get loaded
*
* @var string|null
*/
public $extendedHelperFile = null;
public function init($helperName, $helperFile, $extendedHelperName = null, $extendedHelperFile = null)
public function init(string $helperName, array $helperPaths)
{
$this->helperName = $helperName;
$this->helperFile = $helperFile;
$this->extendedHelperName = $extendedHelperName;
$this->extendedHelperFile = $extendedHelperFile;
$this->helperPaths = $helperPaths;
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -41,7 +41,7 @@ use FuzeWorks\Event;
* Simple event which will notify components of an event, but does not contain any data.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class NotifierEvent extends Event
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -41,7 +41,7 @@ use FuzeWorks\Event;
* Event that will get fired when a plugin is retrieved.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class PluginGetEvent extends Event
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -50,7 +50,7 @@ namespace FuzeWorks;
* EventPriority::LOWEST
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
abstract class EventPriority
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -35,6 +35,7 @@
*/
namespace FuzeWorks;
use FuzeWorks\Event\NotifierEvent;
use FuzeWorks\Exception\EventException;
/**
@ -56,7 +57,7 @@ use FuzeWorks\Exception\EventException;
* $event->title = date('H:i:s ').$event->title;
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Events
{
@ -159,8 +160,6 @@ class Events
*
* @param mixed $input Object for direct event, string for system event or notifierEvent
* @param mixed $parameters,... Parameters for the event
* @todo Implement Application Events
* @todo Implement Directory input for Events from other locations (like Modules)
*
* @return Event The Event
* @throws EventException
@ -197,8 +196,7 @@ class Events
// Try a notifier event
elseif (func_num_args() == 1)
{
$class = "\FuzeWorks\Event\NotifierEvent";
$event = new $class();
$event = new NotifierEvent();
}
// Or throw an exception on failure
@ -249,6 +247,7 @@ class Events
}
// @codeCoverageIgnoreEnd
// Merge arguments and call listener
$args = array_merge(array($event), $callbackArray[1]);
call_user_func_array($callback, $args);
Logger::stopLevel();

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class ConfigException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class ConfigException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class ConfiguratorException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class ConfiguratorException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class CoreException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class CoreException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class EventException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class EventException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class Exception.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Exception extends \Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class FactoryException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class FactoryException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class HelperException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class HelperException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class InvalidArgumentException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class InvalidArgumentException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class LibraryException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class LibraryException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class LoggerException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class LoggerException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -40,7 +40,7 @@ namespace FuzeWorks\Exception;
* Class PluginException.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class PluginException extends Exception
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -56,7 +56,7 @@ use FuzeWorks\Exception\FactoryException;
* The Factory class is also extendible. This allows classes that extend Factory to access all it's properties.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Factory
{

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -35,6 +35,8 @@
*/
namespace FuzeWorks;
use FuzeWorks\Event\HelperLoadEvent;
use FuzeWorks\Exception\EventException;
use FuzeWorks\Exception\HelperException;
/**
@ -54,7 +56,7 @@ use FuzeWorks\Exception\HelperException;
* it becomes globally available to everything.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Helpers
{
@ -64,7 +66,7 @@ class Helpers
*
* @var array Array of loaded helperNames
*/
protected $helpers = array();
protected $helpers = [];
/**
* Paths where Helpers can be found.
@ -73,31 +75,28 @@ class Helpers
*
* @var array Array of paths where helpers can be found
*/
protected $helperPaths = array();
protected $helperPaths = [];
public function __construct()
{
$this->helperPaths = Core::$appDirs;
$this->helperPaths[] = Core::$coreDir . DS . 'Helpers';
}
/**
* Load a helper.
*
*
* Supply the name and the helper will be loaded from the supplied directory,
* or from one of the helperPaths (which you can add).
*
* @param string $helperName Name of the helper
* @param string|null $directory Directory to load the helper from, will ignore $helperPaths
* @return bool Whether the helper was succesfully loaded (true if yes)
*
* @param string $helperName Name of the helper
* @param array $helperDirectories
* @return bool Whether the helper was successfully loaded (true if yes)
* @throws HelperException
*/
public function load($helperName, $directory = null): bool
public function load(string $helperName, array $helperDirectories = []): bool
{
// First determine the name of the helper
$helperName = strtolower(str_replace(array('_helper', '.php'), '', $helperName).'_helper');
// Determine what directories should be checked
$directories = (is_null($directory) ? $this->helperPaths : array($directory));
$helperPaths = (empty($helperDirectories) ? $this->helperPaths : $helperDirectories);
// Check it is already loaded
if (isset($this->helpers[$helperName]))
@ -106,61 +105,44 @@ class Helpers
return false;
}
// First check if there is an 'extension' class
$extendedHelper = Factory::getInstance()->config->get('main')->application_prefix . $helperName;
$extendedHelperLoaded = false;
foreach ($directories as $helperPath)
{
$file = $helperPath . DS . $extendedHelper . '.php';
if (file_exists($file))
{
$extendedHelperLoaded = true;
$extendedHelperFile = $file;
}
/** @var HelperLoadEvent $event */
try {
$event = Events::fireEvent('helperLoadEvent', $helperName, $helperPaths);
// @codeCoverageIgnoreStart
} catch (EventException $e) {
throw new HelperException("Could not load helper. helperLoadEvent failed: '" . $e->getMessage() . "''");
// @codeCoverageIgnoreEnd
}
// If an extension is loaded there needs to be a base helper
if ($extendedHelperLoaded)
// If cancelled by event, abort loading helper
if ($event->isCancelled())
{
$baseHelper = Core::$coreDir . DS . 'Helpers' . DS . $helperName.'.php';
if (!file_exists($baseHelper))
{
throw new HelperException("Could not load helper. Base Helper not found while Extension loaded", 1);
}
// Fire the associated event
$event = Events::fireEvent('helperLoadEvent', $helperName, $baseHelper, $extendedHelper, $extendedHelperFile);
if ($event->isCancelled())
{
Logger::log("Not loading helper. Aborted by event");
return false;
}
include_once($event->extendedHelperFile);
include_once($event->helperFile);
$this->helpers[$event->helperName] = true;
Logger::log("Loading base helper '".$event->helperName."' and extended helper '".$event->extendedHelperName."'");
return true;
Logger::log("Not loading helper. Aborted by event");
return false;
}
// If no extension exists, try loading a regular helper
foreach ($directories as $helperPath)
// Iterate over helperPaths and attempt to load if helper exists
foreach ($event->helperPaths as $helperPath)
{
$file = $helperPath . DS . $helperName . '.php';
$file = $helperPath . DS . $event->helperName . '.php';
$subfile = $helperPath . DS . $event->helperName . DS . $event->helperName . '.php';
if (file_exists($file))
{
// Fire the associated event
$event = Events::fireEvent('helperLoadEvent', $helperName, $file);
if ($event->isCancelled())
{
Logger::log("Not loading helper. Aborted by event");
return false;
}
include_once($event->helperFile);
// Load and register
include_once($file);
$this->helpers[$event->helperName] = true;
Logger::log("Loading helper '".$event->helperName."'");
Logger::log("Loaded helper '".$event->helperName."'");
return true;
}
// If php file not in main directory, check subdirectories
elseif (file_exists($subfile))
{
// Load and register
include_once($subfile);
$this->helpers[$event->helperName] = true;
Logger::log("Loaded helper '".$event->helperName."''");
return true;
}
}
@ -173,13 +155,13 @@ class Helpers
* @see load() for more details
*
* @param string $helperName Name of the helper
* @param string|null $directory Directory to load the helper from, will ignore $helperPaths
* @return bool Whether the helper was succesfully loaded (true if yes)
* @param array $helperPaths
* @return bool Whether the helper was successfully loaded (true if yes)
* @throws HelperException
*/
public function get($helperName, $directory = null): bool
public function get($helperName, array $helperPaths = []): bool
{
return $this->load($helperName, $directory);
return $this->load($helperName, $helperPaths);
}
/**
@ -189,7 +171,7 @@ class Helpers
*/
public function setDirectories(array $directories)
{
$this->helperPaths = $directories;
$this->helperPaths = array_merge($this->helperPaths, $directories);
}
/**

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -78,6 +78,7 @@ class Libraries
public function __construct()
{
$this->factory = Factory::getInstance();
$this->libraryPaths = Core::$appDirs;
}
/**
@ -117,11 +118,11 @@ class Libraries
*
* @param string $libraryName
* @param array $parameters
* @param string $altDirectory
* @param array $altDirectories
* @return object
* @throws LibraryException
*/
public function get(string $libraryName, array $parameters = [], string $altDirectory = '')
public function get(string $libraryName, array $parameters = [], array $altDirectories = [])
{
// Test for empty string
if (empty($libraryName))
@ -142,8 +143,8 @@ class Libraries
// Try and load from the alternate directory if provided
$paths = $this->libraryPaths;
if (!empty($altDirectory))
array_unshift($paths, $altDirectory);
if (!empty($altDirectories))
$paths = $altDirectories;
// Try and find the library in the libraryPaths
foreach ($paths as $path)
@ -218,7 +219,7 @@ class Libraries
*/
public function setDirectories(array $directories)
{
$this->libraryPaths = $directories;
$this->libraryPaths = array_merge($this->libraryPaths, $directories);
}
/**

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -46,7 +46,7 @@ use FuzeWorks\Exception\Exception;
* Also provides utilities to benchmark the application.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Logger {

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -47,7 +47,7 @@ use Tracy\Debugger;
* Afterwards it blocks a screen log so that the content is not shown on the screen as well.
*
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class LoggerTracyBridge implements IBarPanel {

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -35,6 +35,8 @@
*/
namespace FuzeWorks;
use FuzeWorks\ConfigORM\ConfigORM;
use FuzeWorks\Event\PluginGetEvent;
use FuzeWorks\Exception\PluginException;
use ReflectionClass;
use ReflectionException;
@ -54,10 +56,9 @@ use ReflectionException;
*
* Next a plugin class should be created. This file should be named the same as the folder, and be in the Application\Plugin namespace. An alternative classname can be set in the header, by creating a public $className variable. This plugin can be called using the $plugins->get() method.
*
* @todo Implement events
* @todo Add methods to enable and disable plugins
* @author TechFuze <contact@techfuze.net>
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
*/
class Plugins
{
@ -94,8 +95,7 @@ class Plugins
/**
* Called upon creation of the plugins class.
*
* @param string $directory The directory
*
* @return void
*/
public function __construct()
@ -200,7 +200,7 @@ class Plugins
*
* @param string $pluginName Name of the plugin
* @param array $parameters Parameters to send to the __construct() method
* @return object Plugin
* @return mixed Plugin on success, bool on cancellation
* @throws Exception\EventException
* @throws PluginException
* @throws ReflectionException
@ -216,7 +216,8 @@ class Plugins
$pluginName = ucfirst($pluginName);
// Fire pluginGetEvent, and cancel or return custom plugin if required
$event = Events::fireEvent('pluginGetEvent', $pluginName);
/** @var PluginGetEvent $event */
$event = Events::fireEvent('pluginGetEvent', $pluginName);
if ($event->isCancelled())
{
return false;
@ -291,7 +292,7 @@ class Plugins
*/
public function setDirectories(array $directories)
{
$this->pluginPaths = $directories;
$this->pluginPaths = array_merge($this->pluginPaths, $directories);
}
/**

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -0,0 +1,38 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 1.2.0
*
* @version Version 1.2.0
*/
return array(
'it' => 'exists'
);

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -35,6 +35,9 @@
*/
use FuzeWorks\Config;
use FuzeWorks\Event\ConfigGetEvent;
use FuzeWorks\EventPriority;
use FuzeWorks\Events;
/**
* Class ConfigTest.
@ -76,6 +79,38 @@ class configTest extends CoreTestAbstract
$this->config->getConfig('notFound');
}
/**
* @depends testLoadConfig
*/
public function testLoadConfigCancel()
{
// Register listener
Events::addListener(function($event){
$event->setCancelled(true);
}, 'configGetEvent', EventPriority::NORMAL);
// Attempt and load a config file
$config = $this->config->getConfig('loadConfigCancel');
$this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $config);
$this->assertEmpty($config->toArray());
}
/**
* @depends testLoadConfig
*/
public function testLoadConfigIntercept()
{
// Register listener
Events::addListener(function($event){
/** @var ConfigGetEvent $event */
$event->configName = 'testLoadConfigIntercept';
}, 'configGetEvent', EventPriority::NORMAL);
// Load file
$config = $this->config->getConfig('does_not_exist', ['tests'.DS.'config'.DS.'testLoadConfigIntercept']);
$this->assertEquals('exists', $config->it);
}
/**
* @expectedException FuzeWorks\Exception\ConfigException
*/
@ -137,7 +172,9 @@ class configTest extends CoreTestAbstract
$directory = 'tests' . DS . 'config';
$this->config->setDirectories([$directory]);
$this->assertEquals([$directory], $this->config->getConfigPaths());
// Assert expectations
$expected = array_merge(\FuzeWorks\Core::$appDirs, [$directory]);
$this->assertEquals($expected, $this->config->getConfigPaths());
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -86,6 +86,19 @@ class eventsTest extends CoreTestAbstract
Events::fireEvent($event);
}
public function testEventArguments()
{
// Prepare test argument
$argument = 'HelloWorld';
// Create mock event
$event = $this->getMockBuilder(MockEvent::class)->setMethods(['init'])->getMock();
$event->expects($this->once())->method('init')->with($this->equalTo($argument));
// Fire it
Events::fireEvent($event, $argument);
}
/**
* @depends testVariablePassing
*/

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -34,7 +34,8 @@
* @version Version 1.2.0
*/
use FuzeWorks\Factory;
use FuzeWorks\EventPriority;
use FuzeWorks\Events;
use FuzeWorks\Helpers;
/**
@ -52,8 +53,9 @@ class helperTest extends CoreTestAbstract
public function setUp()
{
$factory = Factory::getInstance();
$this->helpers = $factory->helpers;
// Prepare class
$this->helpers = new Helpers();
$this->helpers->setDirectories(['tests' . DS . 'helpers']);
}
public function testGetHelpersClass()
@ -61,20 +63,96 @@ class helperTest extends CoreTestAbstract
$this->assertInstanceOf('FuzeWorks\Helpers', $this->helpers);
}
/**
* @covers \FuzeWorks\Helpers::load
*/
public function testLoadHelper()
{
// First test if the function/helper is not loaded yet
$this->assertFalse(function_exists('testHelperFunction'));
// Test if the helper is properly loaded
$this->assertTrue($this->helpers->load('test', 'tests'.DS.'helpers'.DS.'testLoadHelper'.DS));
$this->assertTrue($this->helpers->load('testLoadHelper'));
// Test if the function exists now
$this->assertTrue(function_exists('testHelperFunction'));
}
/**
* @depends testLoadHelper
* @covers \FuzeWorks\Helpers::load
*/
public function testLoadHelperWithoutSubdirectory()
{
// First test if the function/helper is not loaded yet
$this->assertFalse(function_exists('testLoadHelperWithoutSubdirectory'));
// Try and load the helper
$this->assertTrue($this->helpers->load('testLoadHelperWithoutSubdirectory'));
// Then test if the function/helper is loaded
$this->assertTrue(function_exists('testLoadHelperWithoutSubdirectory'));
}
/**
* @depends testLoadHelper
* @covers \FuzeWorks\Helpers::load
*/
public function testReloadHelper()
{
// First test if the function/helper is not loaded yet
$this->assertFalse(function_exists('testReloadHelper'));
// Try and load the helper
$this->assertTrue($this->helpers->load('testReloadHelper'));
// Then test if the function/helper is loaded
$this->assertTrue(function_exists('testReloadHelper'));
// Try and reload the helper
$this->assertFalse($this->helpers->load('testReloadHelper'));
// Test that the function still exists
$this->assertTrue(function_exists('testReloadHelper'));
}
/**
* @depends testLoadHelper
* @covers \FuzeWorks\Helpers::load
*/
public function testCancelLoadHelper()
{
// First test if the function/helper is not loaded yet
$this->assertFalse(function_exists('testCancelLoadHelper'));
// Prepare listener
Events::addListener(function($event) {
$event->setCancelled(true);
}, 'helperLoadEvent', EventPriority::NORMAL);
$this->assertFalse($this->helpers->load('testCancelLoadHelper'));
}
/**
* @depends testLoadHelper
* @covers \FuzeWorks\Helpers::get
*/
public function testGetHelper()
{
// First test if the function/helper is not loaded yet
$this->assertFalse(function_exists('testGetHelper'));
// Test if the helper is properly loaded
$this->assertTrue($this->helpers->get('testGetHelper'));
// Test if the function exists now
$this->assertTrue(function_exists('testGetHelper'));
}
/**
* @expectedException FuzeWorks\Exception\HelperException
* @covers \FuzeWorks\Helpers::load
*/
public function testAddHelperPathFail()
{
@ -82,11 +160,13 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(function_exists('testAddHelperPathFunction'));
// Now test if the helper can be loaded (hint: it can not)
$this->helpers->load('testAddHelperPath');
$this->helpers->load('testAddHelperPathFail');
}
/**
* @depends testAddHelperPathFail
* @covers \FuzeWorks\Helpers::addHelperPath
* @covers \FuzeWorks\Helpers::getHelperPaths
*/
public function testAddHelperPath()
{
@ -100,6 +180,10 @@ class helperTest extends CoreTestAbstract
$this->assertTrue(function_exists('testAddHelperPathFunction'));
}
/**
* @covers \FuzeWorks\Helpers::removeHelperPath
* @covers \FuzeWorks\Helpers::getHelperPaths
*/
public function testRemoveHelperPath()
{
// Test if the path does NOT exist
@ -118,12 +202,18 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(in_array('tests'.DS.'helpers'.DS.'testRemoveHelperPath', $this->helpers->getHelperPaths()));
}
/**
* @covers \FuzeWorks\Helpers::setDirectories
* @covers \FuzeWorks\Helpers::getHelperPaths
*/
public function testSetDirectories()
{
// Add the directory
$directory = 'tests' . DS . 'helpers';
$this->helpers->setDirectories([$directory]);
$this->assertEquals([$directory], $this->helpers->getHelperPaths());
// Assert expectations
$expected = array_merge(\FuzeWorks\Core::$appDirs, ['tests' . DS . 'helpers', $directory]);
$this->assertEquals($expected, $this->helpers->getHelperPaths());
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -34,6 +34,7 @@
* @version Version 1.2.0
*/
use FuzeWorks\Core;
use FuzeWorks\Factory;
use FuzeWorks\Libraries;
@ -52,11 +53,11 @@ class libraryTest extends CoreTestAbstract
public function setUp()
{
$factory = Factory::getInstance();
$this->libraries = $factory->libraries;
// Load new libraries class
$this->libraries = new Libraries();
// And then remove all paths
$this->libraries->setDirectories([]);
// And then set all paths
$this->libraries->setDirectories(['tests'.DS.'libraries']);
}
public function testLibrariesClass()
@ -66,16 +67,32 @@ class libraryTest extends CoreTestAbstract
/* ---------------------------------- LibraryPaths ---------------------------------------------- */
/**
* @depends testLibrariesClass
*/
public function testSetDirectories()
{
// Test initial
$initial = array_merge(Core::$appDirs, ['tests'.DS.'libraries']);
$this->assertEquals($initial, $this->libraries->getLibraryPaths());
// Add path
$newPath = 'addPath';
$this->libraries->setDirectories([$newPath]);
$initial[] = $newPath;
$this->assertEquals($initial, $this->libraries->getLibraryPaths());
}
/**
* @expectedException FuzeWorks\Exception\LibraryException
*/
public function testAddLibraryPathFail()
{
// First test if the library is not loaded yet
$this->assertFalse(class_exists('TestAddLibraryPath', false));
$this->assertFalse(class_exists('TestAddLibraryPathFail', false));
// Now test if the library can be loaded (hint: it can not)
$this->libraries->get('TestAddLibraryPath');
$this->libraries->get('TestAddLibraryPathFail');
}
/**
@ -84,6 +101,7 @@ class libraryTest extends CoreTestAbstract
public function testAddLibraryPath()
{
// Add the libraryPath
$this->libraries->removeLibraryPath('tests'.DS.'libraries');
$this->libraries->addLibraryPath('tests'.DS.'libraries'.DS.'testAddLibraryPath');
// And try to load it again
@ -115,9 +133,6 @@ class libraryTest extends CoreTestAbstract
*/
public function testGetLibraryFromDirectory()
{
// Add test directory path
$this->libraries->addLibraryPath('tests'.DS.'libraries'.DS.'testGetLibraryFromDirectory');
$this->assertInstanceOf('Application\Library\TestGetLibraryFromDirectory', $this->libraries->get('TestGetLibraryFromDirectory'));
}
@ -139,7 +154,7 @@ class libraryTest extends CoreTestAbstract
{
// Simple test of loading a library and checking if it exists
$this->assertInstanceOf('Application\Library\TestGetLibraryFromAltDirectory',
$this->libraries->get('TestGetLibraryFromAltDirectory', [], 'tests'.DS.'libraries'.DS.'testGetLibraryFromAltDirectory'));
$this->libraries->get('TestGetLibraryFromAltDirectory', [], ['tests'.DS.'libraries'.DS.'testGetLibraryFromAltDirectory']));
}
/**
@ -163,7 +178,7 @@ class libraryTest extends CoreTestAbstract
*/
public function testGetLibraryNoClass()
{
$this->libraries->get('TestGetLibraryNoClass', [], 'tests'.DS.'libraries'.DS.'testGetLibraryNoClass');
$this->libraries->get('TestGetLibraryNoClass');
}
public function testGetLibraryParametersFromConfig()
@ -174,7 +189,7 @@ class libraryTest extends CoreTestAbstract
$config = Factory::getInstance()->config->getConfig(strtolower($libraryName), [$libraryDir]);
// Load the library
$lib = $this->libraries->get('TestGetLibraryParametersFromConfig', [], $libraryDir);
$lib = $this->libraries->get('TestGetLibraryParametersFromConfig');
$this->assertInstanceOf('Application\Library\TestGetLibraryParametersFromConfig', $lib);
// And check the parameters

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
@ -34,6 +34,7 @@
* @version Version 1.2.0
*/
use FuzeWorks\Core;
use FuzeWorks\Factory;
use FuzeWorks\Plugins;
@ -213,10 +214,12 @@ class pluginTest extends CoreTestAbstract
public function testSetDirectories()
{
// Add the directory
$appDir = Core::$appDirs[0];
$directory = 'tests' . DS . 'helpers';
$expected = [$appDir, 'tests'.DS.'plugins', $directory];
$this->plugins->setDirectories([$directory]);
$this->assertEquals([$directory], $this->plugins->getPluginPaths());
$this->assertEquals($expected, $this->plugins->getPluginPaths());
}
public function tearDown()

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -0,0 +1,44 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
if ( ! function_exists('testCancelLoadHelper'))
{
function testCancelLoadHelper($someParameter)
{
return 'SomeResult';
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
if ( ! function_exists('testGetHelper'))
{
function testGetHelper($someParameter)
{
return 'SomeResult';
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -0,0 +1,44 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
if ( ! function_exists('testLoadHelperWithoutSubdirectory'))
{
function testLoadHelperWithoutSubdirectory($someParameter)
{
return 'SomeResult';
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* FuzeWorks Framework Core.
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2018 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 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 0.0.1
*
* @version Version 1.2.0
*/
if ( ! function_exists('testReloadHelper'))
{
function testReloadHelper($someParameter)
{
return 'SomeResult';
}
}

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -17,7 +17,7 @@
<logging>
<log type="json" target="../build/phpunit/logfile.json"/>
<log type="junit" target="../build/phpunit/logfile.xml" logIncompleteSkipped="false"/>
<log type="junit" target="../build/phpunit/logfile.xml"/>
<log type="testdox-html" target="../build/phpunit/testdox.html"/>
<log type="testdox-text" target="../build/phpunit/testdox.txt"/>
</logging>
@ -30,7 +30,6 @@
<directory suffix=".php">../tests/</directory>
<directory suffix=".php">../src/Layout/</directory>
<directory suffix=".php">../src/Config/</directory>
<directory suffix=".php">../src/Language/</directory>
</exclude>
</whitelist>
</filter>

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

View File

@ -25,7 +25,7 @@
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2018, Techfuze. (http://techfuze.net)
* @copyright Copyright (c) 2013 - 2018, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks

Some files were not shown because too many files have changed in this diff Show More