Esempio n. 1
0
 /**
  * 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;
         }
     }
 }
Esempio n. 2
0
	/**
	 * 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();
		}
	}