当前位置: 首页>>代码示例>>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;未经允许,请勿转载。