X7ROOT File Manager
Current Path:
/opt/alt/php53/usr/share/doc/pear/Archive/docs
opt
/
alt
/
php53
/
usr
/
share
/
doc
/
pear
/
Archive
/
docs
/
ðŸ“
..
📄
CREDITS
(229 B)
📄
LICENSE
(1.53 KB)
📄
example.php
(1.44 KB)
📄
tutorial.txt
(4.96 KB)
📄
tutorial_autoload.php
(495 B)
📄
tutorial_directories.php
(390 B)
📄
tutorial_extract.php
(532 B)
📄
tutorial_iterator.php
(298 B)
📄
tutorial_read_only.php
(383 B)
📄
tutorial_recursive.php
(949 B)
📄
tutorial_replacing.php
(390 B)
Editing: tutorial_recursive.php
<?php require_once 'tutorial_autoload.php'; date_default_timezone_set( "UTC" ); class ArchiveContext extends ezcBaseFileFindContext { public $archive; public $prefix; } function findRecursiveCallback( ezcBaseFileFindContext $context, $sourceDir, $fileName, $fileInfo ) { $path = "{$sourceDir}/{$fileName}"; if ( is_dir( $path ) ) { $path .= '/'; } $context->archive->append( array( $path ), $context->prefix ); } function appendRecursive( $archive, $sourceDir, $prefix ) { $context = new ArchiveContext(); $context->archive = $archive; $context->prefix = $prefix; ezcBaseFile::walkRecursive( $sourceDir, array(), array(), 'findRecursiveCallback', $context ); } $archive = ezcArchive::open( "my_archive.zip", ezcArchive::ZIP ); $archive->truncate(); // the 2nd parameter is the directory, the 3rd parameter is the prefix appendRecursive( $archive, '/tmp/directory/', '/tmp/directory/' ); ?>
Upload File
Create Folder