예제 #1
0
파일: Action.php 프로젝트: hovenko/Madcow
 protected function prepare_path()
 {
     $path = NULL;
     if ($this->has('path')) {
         $path = $this->get('path');
     } else {
         $path = $this->get_name();
     }
     return DF_Web_Path::fromString("{$path}");
 }
예제 #2
0
파일: Path.php 프로젝트: hovenko/Madcow
 /**
  * 
  * @param DF_Web_Path $sub
  * @return DF_Web_Path
  */
 public function append_path($sub)
 {
     if (!$sub instanceof DF_Web_Path) {
         throw new DF_Error_InvalidArgumentException('sub', $sub, DF_Web_Path);
     }
     $sub_str = "{$sub}";
     if ($sub->is_absolute()) {
         $sub_str = substr($sub_str, 1);
     }
     $base_str = "{$this}";
     if (!$this->has_trailing_slash()) {
         $base_str .= "/";
     }
     $new_path = "{$base_str}{$sub_str}";
     return DF_Web_Path::fromString($new_path);
 }
예제 #3
0
파일: Web.php 프로젝트: hovenko/Madcow
 public function log_execution_time()
 {
     $time = $this->get_execution_time();
     $time = round($time, 3);
     $request = $this->request;
     $path = DF_Web_Path::fromString($request->get_path());
     self::$LOGGER->debug("Page processing time: {$time} seconds ({$path})");
 }
예제 #4
0
 /**
  * @return DF_Web_Path
  */
 protected function prepare_path()
 {
     $path = DF_Web_Path::fromString($this->namespace);
     return $path;
 }
예제 #5
0
파일: Action.php 프로젝트: hovenko/Madcow
 public function get_private_path()
 {
     $name = $this->get_name();
     $ctrlpath = $this->controller_path;
     $private_path = "{$name}";
     if (strlen($private_path)) {
         $private_path = "/{$private_path}";
     }
     if ("{$ctrlpath}") {
         $private_path = "/{$ctrlpath}{$private_path}";
     }
     return DF_Web_Path::fromString($private_path);
 }
예제 #6
0
파일: Chained.php 프로젝트: hovenko/Madcow
 /**
  * 
  * @param DF_Web_Routing_Config_Action $config
  * @return DF_Web_Path
  */
 protected function prepare_path($config)
 {
     $stars = array();
     $captures = $this->captures;
     for ($i = 0; $i < $captures->get_numargs(); $i++) {
         $stars[] = "*";
     }
     $argspath = join("/", $stars);
     $path = $config->get_path();
     #if (!$path->is_absolute()) {
     #    $controller = new DF_Web_Path("/".$this->controller->get_path());
     #    $path = $controller->append_path($path);
     #}
     if ($argspath) {
         $path = $path->append_path(DF_Web_Path::fromString($argspath));
     }
     return $path;
 }
예제 #7
0
파일: Part.php 프로젝트: hovenko/Madcow
 public static function fromString($string)
 {
     $path = DF_Web_Path::fromString($string);
     return new DF_Web_Path_Part($path);
 }