controllers/ */ $file .= strtolower($m[2]) . "s/"; /* CamelCase -> camel_case_controller.php */ $words = preg_split('/(?<=\\w)(?=[A-Z])/', $m[1]); $file .= strtolower(join("_", $words)) . "_" . strtolower($m[2]) . ".php"; if (file_exists($file)) require_once($file); } } spl_autoload_register("halfmoon_autoload", false, false); if (defined("PHP_ACTIVERECORD_ROOT")) HalfMoon\Config::initialize_activerecord(); /* bring in any post-framework but pre-route code */ if (file_exists($f = HALFMOON_ROOT . "/config/application.php")) require_once($f); /* bring in the route table and route our request */ if (file_exists(HALFMOON_ROOT . "/config/routes.php")) HalfMoon\Router::initialize(function($router) { require_once(HALFMOON_ROOT . "/config/routes.php"); }); ?>