Skip to end of metadata
Go to start of metadata

<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 "zones." 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[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Archive Component Proposal

Proposed Component Name Zend_Archive
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Archive
Proposers Pieter Kokx
Zend Liaison TBD
Revision 1.0 - 1 January 2008: Initial Draft. (wiki revision: 9)

Table of Contents

1. Overview

Zend_Archive is a component that will be able to read and write archives.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • Zend_Archive will be able to read and edit archives.
  • Zend_Archive will be able to create new archives.

4. Dependencies on Other Framework Components

  • Zend_Exception
  • Zend_Loader_PluginLoader

5. Theory of Operation

This component will first read all the metadata from an archive. When requested, it will open a specific file or

6. Milestones / Tasks

  • 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.

7. Class Index

  • Zend_Archive
  • Zend_Archive_Tar
  • Zend_Archive_Gzip
  • Zend_Archive_Zip
  • Zend_Archive_Bz2
  • Zend_Archive_Abstract

8. Use Cases

UC-01

Opening and extracting an existing archive.

UC-02

Create an archive and save it to a directory

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 09, 2008

    <p>Maybe a method to return instead of save, would be handy.</p>

    1. Jun 09, 2008

      <p>Do you mean that if you are using UC-01, that you can do something like this:</p>

      <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
      <?php
      $tar = $tgz->extract();
      ]]></ac:plain-text-body></ac:macro>

      <p>Well, that is possible, and it is a good idea.</p>

      1. Jun 10, 2008

        <p>No, I mean:</p>

        <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
        <?php

        $zip = Zend_Archive::factory('zip', Zend_Archive::NEW);

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

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

        echo $zip->return();
        ]]></ac:plain-text-body></ac:macro>

        1. Oct 25, 2008

          <p>Well, that is also possible. And it is not that hard.</p>

  2. Nov 05, 2008

    <p>Pieter, how is this component comming along? I would like to see it in the 1.8 release.</p>

  3. Nov 18, 2008

    <p>Important for ZIP<br />
    PASSWORD for extract and add<br />
    it's very usefull method don't forget it.</p>

    <p><?php<br />
    $zip = Zend_Archive::factory('zip', Zend_Archive::NEW);<br />
    // will create an instance of Zend_Archive_Zip</p>

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

    <p>// do a password string for creating in archive .....<br />
    $zip->addFile('path/to/file.ext', 'internal/path/to/file.ext', 'password string 444');</p>

    <p>$zip->save('path/to/packing/directory');</p>

  4. Dec 18, 2008

    <p>Maybe you could add a few constants:</p>

    <ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[

    Zend_Archive::RECURSE_ARCHIVES = 1;
    Zend_Archive::RECURSE_DIRECTORIES = 2;

    ]]></ac:plain-text-body></ac:macro>

    <p>And then add an optional argument to the extract method:</p>

    <ac:macro ac:name="code"><ac:default-parameter>php</ac:default-parameter><ac:plain-text-body><![CDATA[

    $tgz = Zend_Archive::factory('path/to/archive.tgz');

    // will recursively extract archives and directories
    $tgz->extract('path/to/extract/directory', Zend_Archive::RECURSE_ARCHIVES | Zend_Archive::RECURSE_DIRECTORIES);

    // in stead of, or complementing
    $tgz->totalExtract('path/to/extract/directory');

    ]]></ac:plain-text-body></ac:macro>

    1. Dec 19, 2008

      <p>Thanks for the tip, i will add it to my proposal <ac:emoticon ac:name="wink" />.</p>

  5. Feb 05, 2011

    <p>Archiving this proposal, feel free to recover it when you want to work on it again. For more details see <a href="http://framework.zend.com/wiki/display/ZFDEV/Archiving+of+abandoned+proposals+(Feb+5+2011)">this email</a>.</p>