note 78940 added to ref.zip

From: Date: Sat, 03 Nov 2007 15:19:32 +0000
Subject: note 78940 added to ref.zip
Groups: php.notes 
Request: Send a blank email to php-notes+get-131966@lists.php.net to get a copy of this message
With this extension you can Add dirs with files with the ZipArchive Object /** * FlxZipArchive, Extends ZipArchiv. * Add Dirs with Files and Subdirs. * * <code> * $archive = new FlxZipArchive; * // ..... * $archive->addDir( 'test/blub', 'blub' ); * </code> */ class FlxZipArchive extends ZipArchive { /** * Add a Dir with Files and Subdirs to the archive * * @param string $location Real Location * @param string $name Name in Archive * @author Nicolas Heimann * @access private **/ public function addDir($location, $name) { $this->addEmptyDir($name); $this->addDirDo($location, $name); // } // EO addDir; /** * Add Files & Dirs to archive. * * @param string $location Real Location * @param string $name Name in Archive * @author Nicolas Heimann * @access private **/ private function addDirDo($location, $name) { $name .= '/'; $location .= '/'; // Read all Files in Dir $dir = opendir ($location); while ($file = readdir($dir)) { if ($file == '.' || $file == '..') continue; // Rekursiv, If dir: FlxZipArchive::addDir(), else ::File(); $do = (filetype() == 'dir') ? 'addDir' : 'addFile'; $this->$do($location . $file, $name . $file); } } // EO addDirDo(); } ---- Server IP: 217.13.201.10 Probable Submitter: 213.39.189.167 ---- Manual Page -- http://www.php.net/manual/en/ref.zip.php Edit -- https://master.php.net/note/edit/78940 Del: integrated -- https://master.php.net/note/delete/78940/integrated Del: useless -- https://master.php.net/note/delete/78940/useless Del: bad code -- https://master.php.net/note/delete/78940/bad+code Del: spam -- https://master.php.net/note/delete/78940/spam Del: non-english -- https://master.php.net/note/delete/78940/non-english Del: in docs -- https://master.php.net/note/delete/78940/in+docs Del: other reasons-- https://master.php.net/note/delete/78940 Reject -- https://master.php.net/note/reject/78940 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#131966) next »