本文整理汇总了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));
}
}
}
示例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());
}
}
}
示例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']);
}
}
示例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/');
}
}
示例5: delete_image
public static function delete_image($image, $from)
{
$path = $_SERVER['DOCUMENT_ROOT'] . '/img/' . $from . '/' . $image;
return Files::delete($path);
}