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


PHP Files::delete方法代码示例

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


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

示例1: remove

 /**
  * Delete the cached config. If no locale is given the whole related cache is removed.
  *
  * @param int         $formId The form id.
  * @param string|null $locale The locale.
  *
  * @return void
  */
 public function remove($formId, $locale = null)
 {
     if ($locale) {
         $this->fileSystem->delete($this->filename($formId, $locale));
     } else {
         $pattern = sprintf('%s/%s/formvalidation-*-%s.js', TL_ROOT, static::BASE_PATH, $formId);
         foreach (glob($pattern) as $path) {
             $this->fileSystem->delete(substr($path, strlen(TL_ROOT) + 1));
         }
     }
 }
开发者ID:netzmacht,项目名称:contao-form-validation,代码行数:19,代码来源:Cache.php

示例2: deleteFile

 /**
  * Delete xml file
  * 
  * @param string $strHash 
  */
 public function deleteFile($strHash)
 {
     if (is_object($this->_arrClipboardElements[$strHash])) {
         $objFile = $this->_arrClipboardElements[$strHash];
         if ($this->_fileExists($objFile->getFileName())) {
             $this->_objFiles->delete($this->getPath() . '/' . $objFile->getFileName());
         }
     }
 }
开发者ID:corelgott,项目名称:clipboard,代码行数:14,代码来源:ClipboardXml.php

示例3: delete_for_anchor

 /**
  * delete all files for a given anchor
  *
  * @param the anchor to check
  *
  * @see shared/anchors.php
  */
 public static function delete_for_anchor($anchor)
 {
     global $context;
     // seek all records attached to this anchor
     $query = "SELECT id FROM " . SQL::table_name('files') . " AS files" . " WHERE files.anchor LIKE '" . SQL::escape($anchor) . "'";
     if (!($result = SQL::query($query))) {
         return;
     }
     // delete silently all matching files
     while ($row = SQL::fetch($result)) {
         Files::delete($row['id']);
     }
 }
开发者ID:rair,项目名称:yacs,代码行数:20,代码来源:files.php

示例4: elseif

} elseif (isset($item['assign_id']) && $item['assign_id'] && !Surfer::is($item['assign_id'])) {
    // prevent updates
    $context['text'] .= Skin::build_block(sprintf(i18n::s('This file has been reserved by %s %s, and it is likely that an updated version will be made available soon.'), Users::get_link($item['assign_name'], $item['assign_address'], $item['assign_id']), Skin::build_date($item['assign_date'])), 'caution');
    // follow-up commands
    $menu = array();
    $menu[] = Skin::build_link($anchor->get_url('files'), i18n::s('Done'), 'button');
    $menu[] = Skin::build_link(Files::get_url($item['id'], 'release'), i18n::s('Release reservation'), 'span');
    $context['text'] .= Skin::build_block(Skin::finalize_list($menu, 'menu_bar'), 'bottom');
    // deletion is confirmed
} elseif (isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 'yes') {
    // touch the related anchor before actual deletion, since the file has to be accessible at that time
    if (is_object($anchor)) {
        $anchor->touch('file:delete', $item['id']);
    }
    // if no error, back to the anchor or to the index page
    if (Files::delete($item['id'])) {
        // log item deletion
        $label = sprintf(i18n::c('Deletion: %s'), strip_tags($item['title']));
        $description = Files::get_permalink($item);
        Logger::remember('files/delete.php: ' . $label, $description);
        Files::clear($item);
        if ($render_overlaid) {
            echo 'delete done';
            die;
        }
        if (is_object($anchor)) {
            Safe::redirect($anchor->get_url() . '#_attachments');
        } else {
            Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'files/');
        }
    }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:delete.php

示例5: delete_image

 public static function delete_image($image, $from)
 {
     $path = $_SERVER['DOCUMENT_ROOT'] . '/img/' . $from . '/' . $image;
     return Files::delete($path);
 }
开发者ID:Julietdragonfly,项目名称:authorization,代码行数:5,代码来源:files.php


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