本文整理汇总了PHP中Media::rm方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::rm方法的具体用法?PHP Media::rm怎么用?PHP Media::rm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::rm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_backup
function delete_backup()
{
global $globals;
if ($globals['Amazon_S3_media_bucket']) {
return Media::rm($this->type . '/' . $this->filename());
}
}
示例2: delete_thumb
function delete_thumb($base = '')
{
global $globals;
if (!empty($base)) {
// Don't delete if not the original (smaller) thumbnail
return;
}
$this->thumb = '';
$this->thumb_status = 'deleted';
$this->thumb_x = 0;
$this->thumb_y = 0;
$this->store_thumb();
if ($globals['Amazon_S3_media_bucket'] && $globals['Amazon_S3_media_url']) {
Media::rm("thumbs/{$this->id}*");
}
$dir = Upload::get_cache_dir($this->id);
$files = glob("{$dir}/thumb*-{$this->id}.jpg");
foreach ($files as $file) {
if (is_file($file)) {
@unlink($file);
}
}
}
示例3: delete_thumb
function delete_thumb() {
global $globals;
$this->thumb = '';
$this->thumb_status = 'deleted';
$this->thumb_x = 0;
$this->thumb_y = 0;
$this->store_thumb();
if ($globals['Amazon_S3_media_bucket'] && $globals['Amazon_S3_media_url']) {
Media::rm("thumbs/$this->id*");
}
}
示例4: avatars_remove_user_files
function avatars_remove_user_files($user)
{
global $globals;
if ($globals['Amazon_S3_media_bucket']) {
Media::rm("avatars/{$user}-*");
}
if ($globals['Amazon_S3_local_cache'] || !$globals['Amazon_S3_media_bucket']) {
$subdir = @get_avatars_dir() . '/' . get_cache_dir_chain($user);
if ($subdir && ($handle = @opendir($subdir))) {
while (false !== ($file = readdir($handle))) {
if (preg_match("/^{$user}-/", $file)) {
@unlink($subdir . '/' . $file);
}
}
closedir($handle);
}
}
}