View Source

<ac:macro ac:name="info"><ac:parameter ac:name="title">New Proposal Template</ac:parameter><ac:rich-text-body>
<p>This page has been created from a template that uses &quot;zones.&quot; To proceed:</p>

<ol>
<li>Edit the page</li>
<li>Replace sample content within each zone-data tag with your own content</li>
<li>Remove this notice</li>
<li>Save the page</li>
<li>When you are ready for community review, move this page to the <ac:link><ri:page ri:content-title="Ready for Review" /></ac:link> section on the edit page.</li>
</ol>


<ac:macro ac:name="note"><ac:parameter ac:name="title">No placeholders allowed!</ac:parameter><ac:rich-text-body>
<p>Please do not create placeholders. Wait until you have sufficient content to replace all sample data in the proposal template before creating your proposal document.</p></ac:rich-text-body></ac:macro></ac:rich-text-body></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Archive
{zone-data}

{zone-data:proposer-list}
[~kokx]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 1 January 2008: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Archive is a component that will be able to read and write archives.
{zone-data}

{zone-data:references}
* [Tar Wikipedia Entry|http://en.wikipedia.org/wiki/Tar_(file_format)]
* [Archive formats on Wikipedia|http://en.wikipedia.org/wiki/Archive_formats]
{zone-data}

{zone-data:requirements}
* Zend_Archive *will* be able to read and edit archives.
* Zend_Archive *will* be able to create new archives.
{zone-data}

{zone-data:dependencies}
* Zend_Exception
* Zend_Loader_PluginLoader
{zone-data}

{zone-data:operation}
This component will first read all the metadata from an archive. When requested, it will open a specific file or
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\] Create the proposal
* Milestone 2: Initial class design
* Milestone 3: Submit the proposal for community review
* Milestone 4: Create working prototype
* Milestone 5: Create code-covering unit tests.
{zone-data}

{zone-data:class-list}
* Zend_Archive
* Zend_Archive_Tar
* Zend_Archive_Gzip
* Zend_Archive_Zip
* Zend_Archive_Bz2
* Zend_Archive_Abstract
{zone-data}

{zone-data:use-cases}
||UC-01||

Opening and extracting an existing archive.

{code}
<?php
$tgz = Zend_Archive::factory('path/to/archive.tgz');
// $tgz is an instance of Zend_Archive_Gzip

// will place a .tar file in path/to/extract/directory
$tar = $tgz->extract('path/to/extract/directory');
// $tar is an instance of Zend_Archive_Tar for the newly created tar archive

// you can also get the $tar object without specifying the extraction directory:
$tar = $tgz->extract();

// will extract the data completely into the chosen directory
// this function is designed for formats like tar.gz or tar.bz2
$tgz->totalExtract('path/to/extract/directory');
{code}

||UC-02||

Create an archive and save it to a directory

{code}
<?php
$zip = Zend_Archive::factory('zip', Zend_Archive::NEW);
// will create an instance of Zend_Archive_Zip

$zip->addDirectory('path/to/directory', 'internal/path/to/directory');

$zip->addFile('path/to/file.ext', 'internal/path/to/file.ext');

$zip->save('path/to/packing/directory');
{code}
{zone-data}

{zone-data:skeletons}

{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>