예제 #1
0
파일: url.php 프로젝트: 453111208/bbc
 protected static function getFacadeAccessor()
 {
     if (!static::$__url) {
         $routes = route::getRoutes();
         static::$__url = new base_routing_urlgenerator($routes, request::instance());
     }
     return static::$__url;
 }
예제 #2
0
파일: route.php 프로젝트: 453111208/bbc
 public function command_cache()
 {
     if ($this->files->exists(kernel::getCachedRoutesPath())) {
         $this->command_clear();
     }
     if (!$this->files->isWritable(dirname(kernel::getCachedRoutesPath()))) {
         logger::info(sprintf('Route cache path:%s cannot write', kernel::getCachedRoutesPath()));
         exit;
     }
     $routes = route::getRoutes();
     if (count($routes) == 0) {
         logger::info("Your application doesn't have any routes.");
         exit;
     }
     foreach ($routes as $route) {
         $route->prepareForSerialization();
     }
     $this->files->put(kernel::getCachedRoutesPath(), $this->buildRouteCacheFile($routes));
     logger::info("Routes cached successfully!");
 }