original_string: 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;
          }
          
         
      }
code: 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;
          }
          
         
      }
code_tokens: 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 ; } }
docstring: 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.
docstring_tokens: Compact a file in multipart zip archive .