本文整理匯總了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;
}