Framework/Server/Cache.php
/**
         * Get all the route information to add it to the database
         * @param type $moduleName Name of the module
         * @param type $routingClassUrl url of the controller
         */
Get all the route information to add it to the database
@param type $moduleName Name of the module
@param type $routingClassUrl url of the controller
Get all the route information to add it to the database @param type $moduleName Name of the module @param type $routingClassUrl url of the controller
protected function addRoutsToDatabase($moduleName, $routingFile)
        {
                $routes = json_decode(\file_get_contents($routingFile));
                if ( is_array($routes)){
                        foreach ($routes as $rout) {
                                $routeArray = json_decode(json_encode($rout), true);
                                $identifier = $routeArray["identifier"];
                                $requestType = $routeArray["request"];
                                $path = $routeArray["path"];
                                $route = $routeArray["route"];
                                $action = $routeArray["action"];
                                $pathRegex = $path;
                                if (isset($routeArray["gets"])) {
                                        foreach ($routeArray["gets"] as $get) {
                                                $pathRegex = \str_replace($get["name"], $get["regex"], $pathRegex);
                                        }
                                }
                                $this->setCacheUrl($identifier, $requestType, $path, $pathRegex, $moduleName, $route, $action);
                        }
                }
        }
protected function addRoutsToDatabase ( $ moduleName , $ routingFile ) { $ routes = json_decode ( \ file_get_contents ( $ routingFile ) ) ; if ( is_array ( $ routes ) ) { foreach ( $ routes as $ rout ) { $ routeArray = json_decode ( json_encode ( $ rout ) , true ) ; $ identifier = $ routeArray [ " identifier " ] ; $ requestType = $ routeArray [ " request " ] ; $ path = $ routeArray [ " path " ] ; $ route = $ routeArray [ " route " ] ; $ action = $ routeArray [ " action " ] ; $ pathRegex = $ path ; if ( isset ( $ routeArray [ " gets " ] ) ) { foreach ( $ routeArray [ " gets " ] as $ get ) { $ pathRegex = \ str_replace ( $ get [ " name " ] , $ get [ " regex " ] , $ pathRegex ) ; } } $ this -> setCacheUrl ( $ identifier , $ requestType , $ path , $ pathRegex , $ moduleName , $ route , $ action ) ; } } }
Get all the route information to add it to the database
 @param type $moduleName Name of the module
 @param type $routingClassUrl url of the controller
Get all the route information to add it to the database @param type $moduleName Name of the module @param type $routingClassUrl url of the controller
//echo "add routes module:" . $moduleName . "<br/>";