CI_Zip::archive PHP Method

archive() public method

Lets you write a file
public archive ( string $filepath ) : boolean
$filepath string the file name
return boolean
    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);
    }