<?php //error_reporting(E_ALL | E_STRICT); function __autoload($class_name) { if (substr($class_name, 0, 4) == 'knl_') { if (substr($class_name, 0, 7) == 'knl_dao') { $location = "dao/" . substr($class_name, 8) . ".php"; } else { if (substr($class_name, 0, 9) == 'knl_model') { $location = "model/" . substr($class_name, 10) . ".php"; } else { $location = str_replace("_", "/", substr($class_name, 4)) . ".php"; } } if (file_exists($location)) { require_once $location; } else { throw new Exception("Classe {$class_name} não foi encontrada"); } } } $path = './lib/adodb5' . PATH_SEPARATOR . "./lib/mailer"; set_include_path(get_include_path() . PATH_SEPARATOR . $path); date_default_timezone_set(knl_lib_Config::getInstance()->get_timezone()); require_once "adodb.inc.php"; header('Content-type: text/html; charset=utf-8'); $shell = isset($argv) ? $argv : array(); knl_controller_FrontController::dispatch($shell);
error_reporting(E_ALL | E_STRICT); function __autoloadKnl($className) { if (substr($className, 0, 4) == 'knl_') { $location = 'knl/' . str_replace("_", "/", substr($className, 4)) . ".php"; if (file_exists($location)) { require_once $location; } else { throw new Exception("Class {$className} not found"); } } if (substr($className, 0, 4) == 'app_') { $location = 'app/' . str_replace("_", "/", substr($className, 4)) . ".php"; if (file_exists($location)) { require_once $location; } else { throw new Exception("Class {$className} not found"); } } } spl_autoload_register('__autoloadKnl'); $path = './libext/adodb5' . PATH_SEPARATOR . "./libext/phpmailer" . PATH_SEPARATOR . "./libext/snoopy"; set_include_path(get_include_path() . PATH_SEPARATOR . $path); header('Content-type: text/html; charset=utf-8'); //date_default_timezone_set(knl_lib_Config::getInstance()->getTimezone()); require_once "adodb.inc.php"; $shell = isset($argv) ? $argv : array(); knl_lib_ShellArgs::getInstance()->setShellArgs($shell); knl_controller_FrontController::dispatch();