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


PHP Files::delFile方法代码示例

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


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

示例1: _delFile

 /**
  * Delete the relative file, and any thumbnails.
  * @param string $relative the relative file.
  * @return boolean true if deleted, false otherwise.
  */
 function _delFile($relative)
 {
     $fullpath = Files::makeFile($this->getImagesDir(), $relative);
     //check that the file is an image
     if ($this->config['validate_images'] == true) {
         if (!is_array($this->getImageInfo($fullpath))) {
             return false;
         }
         //hmmm not an Image!!???
     }
     $thumbnail = $this->getThumbName($fullpath);
     if (Files::delFile($fullpath)) {
         return Files::delFile($thumbnail);
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:22,代码来源:ImageManager.php

示例2: cleanUp

 /**
  * Delete any tmp image files.
  * @param string $path the full path 
  * where the clean should take place.
  */
 function cleanUp($path, $file)
 {
     $path = Files::fixPath($path);
     if (!is_dir($path)) {
         return false;
     }
     $d = @dir($path);
     $tmp = $this->manager->getTmpPrefix();
     $tmpLen = strlen($tmp);
     $prefix = $tmp . $this->_uid;
     $len = strlen($prefix);
     while (false !== ($entry = $d->read())) {
         //echo $entry."<br>";
         if (is_file($path . $entry) && $this->manager->isTmpFile($entry)) {
             if (substr($entry, 0, $len) == $prefix && $entry != $file) {
                 Files::delFile($path . $entry);
             } else {
                 if (substr($entry, 0, $tmpLen) == $tmp && $entry != $file) {
                     if (filemtime($path . $entry) + $this->lapse_time < time()) {
                         Files::delFile($path . $entry);
                     }
                 }
             }
         }
     }
     $d->close();
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:32,代码来源:ImageEditor.php

示例3: 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

示例4: processRenames

 /**
  * Renames files if certain GET variables are set
  * @return bool
  */
 function processRenames()
 {
     if (!empty($_GET['rename']) && !empty($_GET['renameTo'])) {
         // new file name (without path and extension)
         $newName = Files::escape(rawurldecode($_GET['renameTo']));
         $newName = str_replace('.', '', $newName);
         // path to file (from base images directory)
         $oldName = rawurldecode($_GET['rename']);
         // strip parent dir ("..") to avoid escaping from base directiory
         $oldName = preg_replace('#\\.\\.#', '', $oldName);
         if (is_dir($oldPath = Files::makeFile($this->getImagesDir(), $_GET['dir'] . $oldName))) {
             $newPath = Files::makeFile($this->getImagesDir(), $_GET['dir'] . $newName);
             return Files::rename($oldPath, $newPath);
         } else {
             // path to old file
             $oldPath = Files::makeFile($this->getImagesDir(), $oldName);
             $ret = Files::renameFile($oldPath, $newName);
             if ($ret === true) {
                 // delete old thumbnail
                 Files::delFile($this->getThumbname($oldPath));
             }
         }
         return $ret;
     }
     return null;
 }
开发者ID:vnotebaert,项目名称:qcmphp,代码行数:30,代码来源:ExtendedFileManager.php

示例5: _delFile

 /**
  * Delete the relative file, and any thumbnails.
  * @param string $relative the relative file.
  * @return boolean true if deleted, false otherwise.
  */
 function _delFile($relative)
 {
     $fullpath = Files::makeFile($this->getBaseDir(), $relative);
     //check that the file is an image
     if ($this->config['validate_images']) {
         if (!is_array($this->getImageInfo($fullpath))) {
             return false;
         }
         //hmmm not an Image!!???
     }
     $thumbnail = $this->getThumbName($fullpath);
     if (Files::delFile($fullpath)) {
         //deleting from the DB
         global $_course;
         if (isset($_course) && !empty($_course) && isset($_course['code'])) {
             $document_path = substr($fullpath, strpos($fullpath, '/document/') + 9, strlen($fullpath));
             //   /shared_folder/4/name
             DocumentManager::delete_document($_course, $document_path, $fullpath);
         }
         return Files::delFile($thumbnail);
     } else {
         return false;
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:29,代码来源:ImageManager.php

示例6: Session

<?php

require_once '../classes/Autoload.php';
$session = new Session();
if ($session->isLoggeg()) {
    $cancion = new Cancion(Request::get('c'));
    var_dump($cancion);
    if ($cancion != null) {
        $rutaCan = "../canciones/" . $cancion->getNombre();
        $rutaImg = "../caratulas/" . $cancion->getImagen();
        Files::delFile($rutaCan);
        if (is_file($rutaImg) && Files::getFileName($rutaCan) === Files::getFileName($rutaImg)) {
            Files::delFile($rutaImg);
        }
    }
}
Utils::redirect();
开发者ID:jmroldan91,项目名称:podcast,代码行数:17,代码来源:borrar.php


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