예제 #1
0
/**
 * Time setter
 */
define('TOUCANINE_SET_TIME', microtime(true));
/**
 * Autoloading
 */
require PRO_PATH . DS . 'vendor' . DS . 'autoload.php';
/**
 * Dependency injection
 */
$dependency = new Dependency(array('ApplicationInterface' => 'ToucaNine\\Application\\Application', 'ControllerInterface' => 'ToucaNine\\Controller\\Controller', 'FactoryInterface' => 'ToucaNine\\Factory\\Factory', 'HelperInterface' => 'ToucaNine\\Helper\\Helper', 'HttpInterface' => 'ToucaNine\\Http\\Http', 'IResponse' => '\\Nette\\Http\\Response', 'ModelInterface' => 'ToucaNine\\Model\\Model', 'ViewInterface' => 'ToucaNine\\View\\View'));
/**
 * Dependency container
 */
$container = new Container($dependency);
/**
 * Shutdown register
 */
register_shutdown_function(array('ToucaNine\\Exception\\ErrorException', 'handleShutdown'));
/**
 * Error handler
 */
set_error_handler(array('ToucaNine\\Exception\\ErrorException', 'handleError'), E_ALL ^ E_DEPRECATED ^ E_NOTICE | E_STRICT);
/**
 * Exception handler
 */
set_exception_handler(array('ToucaNine\\Exception\\ErrorException', 'handleException'));
/**
 * Dependency setter
 */
예제 #2
0
 /**
  * Service Locator for Application Model
  *
  * @param string $class_name Model class name
  *
  * @return object
  *
  * @access public
  */
 public function getModel($class_name)
 {
     return $this->_container->get("\\App\\Model\\{$class_name}");
 }