.ApplicationComposer/lib/frdl/Compress/Zip/Helper.php
public static function zip($i, $o, $del = false, $afilename = null, $s = 0){
        $i     = str_replace('\\', '/', $i);
        $zp = new \ZipArchive();
        
        if(file_exists($o)){
            $flags = 0;
        }else{
            $flags = \ZipArchive::CREATE;
        }
        
        $zp->open($o, $flags);
        
		$afilename = (is_string($afilename)) ? $afilename : basename($i);
        $success = $zp->addFile($i, $afilename);
        
        $zp->close();
        
        if(true===$del)unlink($afilename);
         
        if($success){
            if($s > 0){
                return self::split($o, $s);
            }
        }else{
            return false;
        }
        
       
    }
public static function zip($i, $o, $del = false, $afilename = null, $s = 0){
        $i     = str_replace('\\', '/', $i);
        $zp = new \ZipArchive();
        
        if(file_exists($o)){
            $flags = 0;
        }else{
            $flags = \ZipArchive::CREATE;
        }
        
        $zp->open($o, $flags);
        
		$afilename = (is_string($afilename)) ? $afilename : basename($i);
        $success = $zp->addFile($i, $afilename);
        
        $zp->close();
        
        if(true===$del)unlink($afilename);
         
        if($success){
            if($s > 0){
                return self::split($o, $s);
            }
        }else{
            return false;
        }
        
       
    }
public static function zip ( $ i , $ o , $ del = false , $ afilename = null , $ s = 0 ) { $ i = str_replace ( '\\' , '/' , $ i ) ; $ zp = new \ ZipArchive ( ) ; if ( file_exists ( $ o ) ) { $ flags = 0 ; } else { $ flags = \ ZipArchive :: CREATE ; } $ zp -> open ( $ o , $ flags ) ; $ afilename = ( is_string ( $ afilename ) ) ? $ afilename : basename ( $ i ) ; $ success = $ zp -> addFile ( $ i , $ afilename ) ; $ zp -> close ( ) ; if ( true === $ del ) unlink ( $ afilename ) ; if ( $ success ) { if ( $ s > 0 ) { return self :: split ( $ o , $ s ) ; } } else { return false ; } }
Compact a file in multipart zip archive.
@param string $i The file to compact.
@param string $o The zip archive (*.zip).
@param integer $s The mnax size (in byte) for the parts. 0 to no parts.
@return boolean Return number of parts created.
Compact a file in multipart zip archive .