當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MOXMAN_Util_PathUtils::verifyPath方法代碼示例

本文整理匯總了PHP中MOXMAN_Util_PathUtils::verifyPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP MOXMAN_Util_PathUtils::verifyPath方法的具體用法?PHP MOXMAN_Util_PathUtils::verifyPath怎麽用?PHP MOXMAN_Util_PathUtils::verifyPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MOXMAN_Util_PathUtils的用法示例。


在下文中一共展示了MOXMAN_Util_PathUtils::verifyPath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFile

 /**
  * Returns a MOXMAN_Vfs_IFile instance based on the specified path.
  *
  * @param string $path Path of the file to retrive.
  * @return MOXMAN_Vfs_IFile File instance for the specified path.
  */
 public function getFile($path)
 {
     // Get file from cache
     if ($this->cache->has($path)) {
         return $this->cache->get($path);
     }
     // Never give access to the mc_access file
     if ($this->getConfig()->get("filesystem.local.access_file_name") === basename($path)) {
         throw new MOXMAN_Exception("Can't access the access_file_name.");
     }
     MOXMAN_Util_PathUtils::verifyPath($path, true);
     // Force the path to an absolute path
     $path = MOXMAN_Util_PathUtils::toAbsolute(MOXMAN_ROOT, $path);
     // If the path is out side the root then return null
     if (!MOXMAN_Util_PathUtils::isChildOf($path, $this->rootPath)) {
         $null = null;
         return $null;
     }
     // Create the file and put it in the cache
     $file = new MOXMAN_Vfs_Local_File($this, $path);
     $this->cache->put($path, $file);
     return $file;
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:29,代碼來源:FileSystem.php

示例2: copyDir

 /** @ignore */
 private function copyDir($from, $to)
 {
     $fromPathRoot = $from->getPath();
     $files = $this->getFiles($fromPathRoot);
     foreach ($files as $fromPath) {
         $toPath = MOXMAN_Util_PathUtils::combine($to->getPath(), substr($fromPath, strlen($fromPathRoot)));
         if (is_file($fromPath)) {
             if ($to instanceof MOXMAN_Vfs_Local_File) {
                 copy($fromPath, $toPath);
             } else {
                 $to->getFileSystem()->getFile($toPath)->importFrom($fromPath);
             }
         } else {
             if ($to instanceof MOXMAN_Vfs_Local_File) {
                 MOXMAN_Util_PathUtils::verifyPath($toPath, true, "dir");
                 mkdir($toPath);
             } else {
                 $to->getFileSystem()->getFile($toPath)->mkdir();
             }
         }
     }
 }
開發者ID:vidalweb,項目名稱:MoxieManager,代碼行數:23,代碼來源:File.php


注:本文中的MOXMAN_Util_PathUtils::verifyPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。