示例#1
0
 /**
  * Initialize working of Router
  * 
  * @param Router $router
  * @param array $option
  * @return void
  */
 public function init(Router $router, array $option = array())
 {
     $router->init($option);
     $router->run();
 }
示例#2
0
 *
 * @param object $object Name of Class
 * @return void
 */
function __autoload($object)
{
    $split = explode("\\", $object);
    $className = end($split);
    require_once "{$className}.php";
}
$container = ObjectContainer::getInstance();
$container->offsetSet('FRAMEWORK', Framework::getInstance());
// Create the instance of framework and let your handlers initialized.
$container->offsetSet('SESSION', Session::getInstance());
$container->offsetSet('MYSQLI', new DatabaseBean("MYSQLI", "localhost", "root", "nitesha", "phpmyadmin", 3306));
//$container->offsetSet('ORACLE', new DatabaseBean("ORACLE", "localhost", "root", "nitesha", "thebookmarker", "3306"));
$container->offsetSet('LOGGER', Logger::getInstance());
//$container->offsetSet('MYSQLI-2', new DatabaseBean("MYSQLI", "localhost", "root", "nitesha", "musicplus", "3306")); // another mysql database
//$container->offsetSet('PDO', new DatabaseBean("mysql", "localhost", "root", "nitesha", "musicplus", "3306"));
# Do this when site is in maintenance or offline - Start #
###########################################################################################################################
/* $default = array(
 'controller' => 'Error',
 'action'	 => 'default',
 'params'	=> array('408')
 ); */
###########################################################################################################################
# Do this when site is in maintenance or offline - End #
$default = array();
$container->offsetGet('FRAMEWORK')->init(Router::getInstance(), $default);