Пример #1
0
 /**
  *  Convert VFS path into real local filesystem path
  *
  * @param $path :   expected path /mount_point/relative_path/...
  * @return string   :   real local filesystem path
  */
 public function toRealPath($path)
 {
     if (substr($path, 0, 1) == "/") {
         $path = substr($path, 1);
     }
     $split_path = explode("/", $path);
     $mount = reset($split_path);
     $relative = implode(DIRECTORY_SEPARATOR, array_slice($split_path, 1));
     $absPart = $this->toAbsolutePath($mount);
     if (!XApp_Utils_Strings::endsWith($absPart, DIRECTORY_SEPARATOR)) {
         $absPart .= DIRECTORY_SEPARATOR;
     }
     return $absPart . $relative;
 }
Пример #2
0
 private function initVariables()
 {
     if (xapp_has_option(self::RELATIVE_VARIABLES)) {
         $rVariables = xapp_get_option(self::RELATIVE_VARIABLES, $this);
         if (count($rVariables)) {
             foreach ($rVariables as $variable => $value) {
                 $this->registerRelative($variable, $value);
             }
         }
     }
     if (xapp_has_option(self::ABSOLUTE_VARIABLES)) {
         $variables = xapp_get_option(self::ABSOLUTE_VARIABLES, $this);
         if (count($variables)) {
             foreach ($variables as $variable => $value) {
                 if (!XApp_Utils_Strings::endsWith($value, DIRECTORY_SEPARATOR)) {
                     $value .= DIRECTORY_SEPARATOR;
                 }
                 $this->registerAbsolute($variable, $value);
             }
         }
     }
 }