public function archive($filepath)
{
if (!($fp = @fopen($filepath, 'w+b'))) {
return FALSE;
}
flock($fp, LOCK_EX);
for ($result = $written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result) {
if (($result = fwrite($fp, substr($data, $written))) === FALSE) {
break;
}
}
flock($fp, LOCK_UN);
fclose($fp);
return is_int($result);
}