miniMVC/sys/core/miniMVC.php

72 lines
1.3 KiB
PHP

<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/aviat4ion/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
namespace miniMVC;
/**
* Base class for the framework
*
* @package miniMVC
* @subpackage System
*/
class miniMVC extends MM {
use Singleton;
/**
* Constructor - Any classes loaded here become subclasses of miniMVC
*
* @param array $members
*/
public function __construct($members = [])
{
// Allow the class to be used like an array
parent::__construct($members);
}
// --------------------------------------------------------------------------
/**
* Convenience function to remove an object from the singleton
*
* @param string $name
*/
public function unload($name)
{
if (isset($this->$name))
{
unset($this->$name);
}
}
// --------------------------------------------------------------------------
/**
* Convenience function to load config files
*
* @param string $name
*/
public function load_config($name)
{
$path = MM_APP_PATH . "config/{$name}.php";
if (is_file($path))
{
require_once($path);
}
}
}
// End of miniMVC.php