本文整理匯總了PHP中Archive::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Archive::remove方法的具體用法?PHP Archive::remove怎麽用?PHP Archive::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Archive
的用法示例。
在下文中一共展示了Archive::remove方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Archive
/**
* Removes ZIPs that are over the specified size
*
* @author Woxxy
* @returns bool
*/
function remove_old() {
while ($this->calculate_size() > (get_setting('fs_dl_archive_max') * 1024 * 1024)) {
$archive = new Archive();
$archive->order_by('lastdownload', 'ASC')->limit(1)->get();
$archive->remove();
}
}
示例2: while
/**
* Removes ZIPs that are over the specified size
*
* @author Woxxy
* @returns bool
*/
function remove_old()
{
$unlink_errors = 0;
while ($this->calculate_size() > get_setting('fs_dl_archive_max') * 1024 * 1024) {
$archive = new Archive();
$archive->order_by('lastdownload', 'ASC')->limit(1, $unlink_errors)->get();
if ($archive->result_count() == 1) {
if (!$archive->remove()) {
$unlink_errors++;
}
} else {
break;
}
}
}
示例3: on_change
/**
* Triggers the necessary calculations when a page is added, edited or removed
*
* @author Woxxy
*/
public function on_change($chapter_id)
{
// cleanup the archive if there is one for this chapter
$archive = new Archive();
$archive->where('chapter_id', $chapter_id)->get();
if ($archive->result_count() == 1) {
$archive->remove();
}
}