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


PHP FileManager::delete方法代码示例

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


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

示例1: clear

 public static function clear($key)
 {
     // Clear cache by deleting requested file
     $filename = md5($key);
     $path = __DIR__ . self::$cache_root . $filename;
     $file = new FileManager($path);
     $file->delete();
 }
开发者ID:julianburr,项目名称:project-nutmouse,代码行数:8,代码来源:Cache.php

示例2: remove

 /**
  * Remove entity. If entity has been removed, delete related file.
  *
  * @access     public
  * @return    boolean
  * @since      1.0.0-alpha
  * @version    1.0.0-alpha
  */
 public function remove()
 {
     $bRemoved = parent::remove();
     if ($bRemoved) {
         // set path to file
         $sPath = $this->getPath() . DS . $this->getNameWithExt();
         // if it's an image, remove all its styles
         if (in_array($this->getExt(), ['jpg', 'jpeg', 'gif', 'png', 'tiff'])) {
             ImageStyles::removeStyledImgCache($sPath);
         }
         // remove file
         \FileManager::delete($sPath);
     }
     return $bRemoved;
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:23,代码来源:File.php

示例3: Exception

    $oResponse->setData($oFtp->getContent(Request::getApiParam('path')));
    $oResponse->flushJson();
}
if (Request::getApiParam('mode') === 'rename') {
    $path = Request::getApiParam('path');
    $newPath = Request::getApiParam('newPath');
    $result = $oFtp->move($path, $newPath);
    if (!$result) {
        throw new Exception("Unknown error renaming this folder");
    }
    $oResponse->setData($result);
    $oResponse->flushJson();
}
if (Request::getApiParam('mode') === 'delete') {
    $path = Request::getApiParam('path');
    $result = $oFtp->delete($path);
    if (!$result) {
        throw new Exception("Unknown error removing this item");
    }
    $oResponse->setData($result);
    $oResponse->flushJson();
}
if (Request::getApiParam('mode') === 'addfolder') {
    $path = Request::getApiParam('path');
    $name = Request::getApiParam('name');
    $result = $oFtp->mkdir($path . '/' . $name);
    if (!$result) {
        throw new Exception("Unknown error creating this folder");
    }
    $oResponse->setData($result);
    $oResponse->flushJson();
开发者ID:sagarora77,项目名称:angular-filemanager-1,代码行数:31,代码来源:handler.php

示例4: httpredir

    httpredir(currentPage(array('rebuild')));
}
if (Admin::getInstance()->permissions('filemanager', CC_PERM_EDIT) && !empty($_FILES)) {
    if ($fm->upload()) {
        if (count($_FILES) > 1) {
            $GLOBALS['main']->setACPNotify($lang['filemanager']['notify_files_upload']);
        } else {
            $GLOBALS['main']->setACPNotify($lang['filemanager']['notify_file_upload']);
        }
    } else {
        $GLOBALS['main']->setACPWarning($lang['filemanager']['error_file_upload']);
    }
    httpredir(currentPage());
}
if (Admin::getInstance()->permissions('filemanager', CC_PERM_DELETE) && isset($_GET['delete'])) {
    if ($fm->delete($_GET['delete'])) {
        $GLOBALS['main']->setACPNotify($lang['filemanager']['notify_file_delete']);
    } else {
        $GLOBALS['main']->setACPWarning($lang['filemanager']['error_file_delete']);
    }
    httpredir(currentPage(array('delete')));
}
$GLOBALS['smarty']->assign('UPLOAD_LIMIT', ini_get('post_max_size'));
if (isset($_GET['fm-edit']) && is_numeric($_GET['fm-edit'])) {
    $page_content = $fm->editor($_GET['fm-edit']);
} else {
    $GLOBALS['main']->addTabControl($lang['filemanager']['tab_files'], 'filemanager');
    $GLOBALS['main']->addTabControl($lang['filemanager']['file_upload'], 'upload');
    $GLOBALS['main']->addTabControl($lang['filemanager']['folder_create'], 'folder');
    $GLOBALS['main']->addTabControl($lang['filemanager']['tab_rebuild'], false, currentPage(null, array('rebuild' => 'true')));
    $page_content = $fm->admin($select_button);
开发者ID:Geotex,项目名称:v6,代码行数:31,代码来源:filemanager.index.inc.php

示例5: cleanupSourceFiles

 protected function cleanupSourceFiles()
 {
     $fileManger = new FileManager($this->bookId);
     foreach ($this->sourceFiles as $sourceFile) {
         CakeLog::debug('[ImportBookManager::cleanupSourceFiles] Deleting source file ' . $sourceFile);
         $fileManger->delete($sourceFile);
     }
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:8,代码来源:ImportBookManager.php

示例6: Exception

        $result = $item ? $oFtp->move($item, $finalPath) : false;
        if (!$result) {
            $errors[] = $item . ' to ' . $finalPath;
        }
    }
    if ($errors) {
        throw new Exception("Unknown error moving: \n\n" . implode(", \n", $errors));
    }
    $oResponse->setData($result);
    $oResponse->flushJson();
}
if (Request::getApiParam('action') === 'remove') {
    $items = Request::getApiParam('items');
    $errors = array();
    foreach ($items as $item) {
        $result = $item ? $oFtp->delete($item) : false;
        if (!$result) {
            $errors[] = $item;
        }
    }
    if ($errors) {
        throw new Exception("Unknown error deleting: \n\n" . implode(", \n", $errors));
    }
    $oResponse->setData($result);
    $oResponse->flushJson();
}
if (Request::getApiParam('action') === 'createFolder') {
    $newPath = Request::getApiParam('newPath');
    $result = $oFtp->mkdir($newPath);
    if (!$result) {
        throw new Exception("Unknown error creating this folder");
开发者ID:bhupendra-bhudia,项目名称:angular-filemanager,代码行数:31,代码来源:handler.php


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