本文整理汇总了PHP中dir::get_couch_thumbs方法的典型用法代码示例。如果您正苦于以下问题:PHP dir::get_couch_thumbs方法的具体用法?PHP dir::get_couch_thumbs怎么用?PHP dir::get_couch_thumbs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dir
的用法示例。
在下文中一共展示了dir::get_couch_thumbs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act_rm_cbd
protected function act_rm_cbd()
{
if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files'])) {
$this->errorMsg("Unknown error.");
}
$error = array();
foreach ($this->post['files'] as $file) {
$file = path::normalize($file);
if (substr($file, 0, 1) == ".") {
continue;
}
$type = explode("/", $file);
$type = $type[0];
if ($type != $this->type) {
continue;
}
$path = "{$this->config['uploadDir']}/{$file}";
$base = basename($file);
$replace = array('file' => $base);
if (!is_file($path)) {
$error[] = $this->label("The file '{file}' does not exist.", $replace);
} elseif (!@unlink($path)) {
$error[] = $this->label("Cannot delete '{file}'.", $replace);
} else {
$thumb = "{$this->thumbsDir}/{$file}";
if (is_file($thumb)) {
@unlink($thumb);
}
// Couch thumbs
$thumbs = dir::get_couch_thumbs($path);
foreach ($thumbs as $thumb) {
@unlink($thumb);
}
}
}
if (count($error)) {
return json_encode(array('error' => $error));
}
return true;
}