Started implementing the Factory.
This will have huge consequences for FuzeWorks.
This commit is contained in:
parent
3343c08594
commit
7d3323bfe7
|
@ -23,3 +23,4 @@ Modules/admin/themes/adminlte2.1/dist/
|
|||
Modules/admin/themes/adminlte2.1/bootstrap/
|
||||
doc
|
||||
nbproject
|
||||
Application/Cache
|
||||
|
|
|
@ -151,6 +151,7 @@ class Core
|
|||
include_once 'Core/System/class.security.php';
|
||||
include_once 'Core/System/class.input.php';
|
||||
include_once 'Core/System/class.output.php';
|
||||
include_once 'Core/System/class.factory.php';
|
||||
|
||||
// Load the core classes
|
||||
new Config();
|
||||
|
@ -169,6 +170,7 @@ class Core
|
|||
new Input();
|
||||
new Router();
|
||||
new Output();
|
||||
new Factory();
|
||||
|
||||
self::$loaded = true;
|
||||
}
|
||||
|
|
|
@ -40,4 +40,112 @@ namespace FuzeWorks;
|
|||
class Factory
|
||||
{
|
||||
|
||||
private static $sharedFactoryInstance;
|
||||
|
||||
private $instances = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->instances['Layout'] = new Layout();
|
||||
self::$sharedFactoryInstance = $this;
|
||||
}
|
||||
|
||||
public function newInstance($className, $namespace = 'FuzeWorks\\')
|
||||
{
|
||||
$instanceName = ucfirst($className);
|
||||
$className = $namespace.$instanceName;
|
||||
$this->instances[$instanceName] = new $className();
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
return clone self::$sharedFactoryInstance;
|
||||
}
|
||||
|
||||
public function getConfig()
|
||||
{
|
||||
return new Config();
|
||||
}
|
||||
|
||||
public function getCore()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getDatabase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getEvents()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getHelpers()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getInput()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getLanguage()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getLayout()
|
||||
{
|
||||
return $this->instances['Layout'];
|
||||
}
|
||||
|
||||
public function getLibraries()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getLogger()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getModels()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getModules()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getOutput()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getRouter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getSecurity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getUri()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getUtf8()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue