当前位置: 首页>>代码示例>>PHP>>正文


PHP Files::delFolder方法代码示例

本文整理汇总了PHP中Files::delFolder方法的典型用法代码示例。如果您正苦于以下问题:PHP Files::delFolder方法的具体用法?PHP Files::delFolder怎么用?PHP Files::delFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Files的用法示例。


在下文中一共展示了Files::delFolder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _delDir

 /**
  * Delete directories recursively.
  * @param string $relative the relative path to be deleted.
  * @return boolean true if deleted, false otherwise.
  */
 function _delDir($relative)
 {
     $fullpath = Files::makePath($this->getImagesDir(), $relative);
     if ($this->countFiles($fullpath) <= 0) {
         return Files::delFolder($fullpath, true);
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:14,代码来源:ImageManager.php

示例2: delFolder

 /**
  * Delete folder(s), can delete recursively.
  * @param string $folder the folder to be deleted.
  * @param boolean $recursive if true, all files and sub-directories
  * are delete. If false, tries to delete the folder, can throw
  * error if the directory is not empty.
  * @return boolean true if deleted.
  */
 function delFolder($folder, $recursive = false)
 {
     $deleted = true;
     if ($recursive) {
         $d = dir($folder);
         while (false !== ($entry = $d->read())) {
             if ($entry != '.' && $entry != '..') {
                 $obj = Files::fixPath($folder) . $entry;
                 //var_dump($obj);
                 if (is_file($obj)) {
                     $deleted &= Files::delFile($obj);
                 } else {
                     if (is_dir($obj)) {
                         $deleted &= Files::delFolder($obj, $recursive);
                     }
                 }
             }
         }
         $d->close();
     }
     //$folder= $folder.'/thumbs';
     //var_dump($folder);
     if (is_dir($folder)) {
         $deleted &= rmdir($folder);
     } else {
         $deleted &= false;
     }
     return $deleted;
 }
开发者ID:vnotebaert,项目名称:qcmphp,代码行数:37,代码来源:Files.php

示例3: _delDir

 /**
  * Delete directories recursively.
  * @param string $relative the relative path to be deleted.
  * @return boolean true if deleted, false otherwise.
  */
 function _delDir($relative)
 {
     $fullpath = Files::makePath($this->getImagesDir(), $relative);
     //	if($this->countFiles($fullpath) <= 0)
     return Files::delFolder($fullpath, true);
     //delete recursively.
     //else
     //Return false;
 }
开发者ID:vnotebaert,项目名称:qcmphp,代码行数:14,代码来源:ExtendedFileManager.php

示例4: _delDir

 /**
  * Delete directories recursively.
  * @param string $relative the relative path to be deleted.
  * @return boolean true if deleted, false otherwise.
  */
 function _delDir($relative)
 {
     if (!$this->validRelativePath($relative)) {
         return false;
     }
     $fullpath = Files::makePath($this->getBaseDir(), $relative);
     if ($this->countFiles($fullpath) <= 0) {
         return Files::delFolder($fullpath, true);
     } else {
         return false;
     }
 }
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:17,代码来源:ImageManager.php

示例5: _delDir

 /**
  * Delete directories recursively.
  * @param string $relative the relative path to be deleted.
  * @return boolean true if deleted, false otherwise.
  */
 function _delDir($relative)
 {
     $fullpath = Files::makePath($this->getBaseDir(), $relative);
     //we can delete recursively	even if there are images in the dir
     //if($this->countFiles($fullpath) <= 0) {
     // now we use the default delete_document function
     //return Files::delFolder($fullpath,true); //delete recursively.
     global $_course;
     if (isset($_course) && !empty($_course) && isset($_course['code'])) {
         $path_dir = substr($fullpath, strpos($fullpath, '/document/') + 9, -1);
         //
         $base_dir = substr($fullpath, 0, strlen($fullpath) - strlen($path_dir));
         //
         return DocumentManager::delete_document($_course, $path_dir, $base_dir);
     } else {
         if ($this->countFiles($fullpath) <= 0) {
             return Files::delFolder($fullpath, true);
         } else {
             return false;
         }
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:27,代码来源:ImageManager.php


注:本文中的Files::delFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。