library/Zip.php
/**
     * Add a directory to the zip
     * @param $directory
     */
Add a directory to the zip
@param $directory
Add a directory to the zip @param $directory
public function add_directory( $directory )
    {
        if( is_dir( $directory ) && $handle = opendir( $directory ) )
        {
            $this->zip->addEmptyDir( $directory );
            while( ( $file = readdir( $handle ) ) !== false )
            {
                if (!is_file($directory . '/' . $file))
                {
                    if (!in_array($file, array('.', '..')))
                    {
                        $this->add_directory($directory . '/' . $file );
                    }
                }
                else
                {
                    $this->add_file($directory . '/' . $file);                }
            }
        }
    }
public function add_directory ( $ directory ) { if ( is_dir ( $ directory ) && $ handle = opendir ( $ directory ) ) { $ this -> zip -> addEmptyDir ( $ directory ) ; while ( ( $ file = readdir ( $ handle ) ) !== false ) { if ( ! is_file ( $ directory . '/' . $ file ) ) { if ( ! in_array ( $ file , array ( '.' , '..' ) ) ) { $ this -> add_directory ( $ directory . '/' . $ file ) ; } } else { $ this -> add_file ( $ directory . '/' . $ file ) ; } } } }
Add a directory to the zip
 @param $directory
Add a directory to the zip @param $directory