/** * Build routes for the app. * * Allows other plugins to register routes to be used in the app and builds * the routes from the database. */ private static function __buildRoutes() { App::uses('ClassRegistry', 'Utility'); EventCore::trigger(new StdClass(), 'setupRoutes'); if (InfinitasPlugin::infinitasInstalled()) { $routes = ClassRegistry::init('Routes.Route')->getRoutes(); if (!empty($routes)) { foreach ($routes as $route) { if (false) { debugRoute($route); continue; } call_user_func_array(array('InfinitasRouter', 'connect'), $route['Route']); } } if (!defined('INFINITAS_ROUTE_HASH')) { define('INFINITAS_ROUTE_HASH', md5(serialize($routes))); } } }