



 

Elibyy/Zip 1.0 documentation

 body {

 padding-top: 60px;

 padding-bottom: 40px;

 }

 

[Elibyy/Zip documentation](index.html#document-index)

* 

* [API](_static/API/)

* 

* [Phraseanet Libraries](#)

	+ [Phraseanet.github.com](http://phraseanet.github.com/)

[![Fork me on GitHub](https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png)](https://github.com/elibyy/Zip)

Elibyy/Zip documentation

========================

Documentation[¶](#documentation "Permalink to this headline")

=============================================================

Introduction[¶](#introduction "Permalink to this headline")

-----------------------------------------------------------

Elibyy/Zip is an Object Oriented PHP library that makes PHP Archive handling easier

this library currently supports

* [zip](http://www.info-zip.org/)

* PHP zip

* [Phar](http://php.net/manual/en/book.phar.php)

* [TAR](http://www.gnu.org/software/tar/manual/)

* [BZIP2](http://www.bzip.org/)

* [GZ](http://www.gzip.org/)

which is the following extensions

* .zip

* .phar

* .tar

* .bz2

* .gz

Installation[¶](#installation "Permalink to this headline")

-----------------------------------------------------------

We rely on [composer](http://getcomposer.org/) to use this library. If you do

not still use composer for your project, you can start with this `composer.json`

at the root of your project :

```

{

    "require": {

        "elibyy/zip": "1.0"

    }

}

```

Install composer :

```

# Install composer

curl -s http://getcomposer.org/installer | php

# Upgrade your install

php composer.phar install

```

You now just have to autoload the library to use it :

```

<?php

require 'vendor/autoload.php';

use Elibyy\Reader;

$reader = new Reader('/path/to/file.zip');

```

This is a very short intro to composer.

If you ever experience an issue or want to know more about composer,

you will find help on their web site [composer](http://getcomposer.org/).

Basic Usage[¶](#basic-usage "Permalink to this headline")

---------------------------------------------------------

The Zippy library is very simple and consists of a collection of adapters that

take over for you the most common (de)compression operations (create, list

update, extract, delete) for the chosen format.

**Example usage**

```

<?php

use Elibyy\Reader;

use Elibyy\Creator;

// extract an archive

$reader = new Reader('/path/to/file.zip');

$reader->extract('/destination/folder');

//remove file from archive

$reader->removeFileByName('file.txt');

// create an archive

$creator = new Creator('path/to/new.zip');

$creator->addFolder('/path/to/dir/');

```

this library comes with a smart adapter locating by the specified file

**Creates or opens one archive**

```

<?php

use Elibyy\Reader;

use Elibyy\Creator;

$reader = new Reader('/path/to/file.zip');

$creator = new Creator('path/to/new.zip');

```

**Define your custom adapter**

currently the library doesn’t support the addition of adapters not in the namespace of the adapters

`Elibyy\Adapters`

> 

> but you can add in that namespace directory a new class that implements `Elibyy\General\Adapter`

> or extends one of the existing Adapters

Handling Exceptions[¶](#handling-exceptions "Permalink to this headline")

-------------------------------------------------------------------------

the library throws the following exceptions

`\RuntimeException` if the file provided to the reader doesn’t exist

`\RuntimeException` if the adapter folder is missing

`\RuntimeException` if no adapter found for the file provided

Report a bug[¶](#report-a-bug "Permalink to this headline")

-----------------------------------------------------------

If you experience an issue, please report it in our [issue tracker](https://github.com/elibyy/Zip/issues). Before

reporting an issue, please be sure that it is not already reported by browsing

open issues.

Contribute[¶](#contribute "Permalink to this headline")

-------------------------------------------------------

You find a bug and resolved it ? You added a feature and want to share ? You

found a typo in this doc and fixed it ? Feel free to send a [Pull Request](http://help.github.com/send-pull-requests/) on

GitHub, we will be glad to merge your code.

Run tests[¶](#run-tests "Permalink to this headline")

-----------------------------------------------------

the Library relies on [PHPUnit](http://www.phpunit.de/manual/current/en/) for unit tests. To run tests on your system, ensure

you have [PHPUnit](http://www.phpunit.de/manual/current/en/) installed, and, at the root of The library execute it :

```

phpunit

```

About[¶](#about "Permalink to this headline")

---------------------------------------------

this library was built by [elibyy](http://eyurl.com)

License[¶](#license "Permalink to this headline")

-------------------------------------------------

the LICENSE is provided in the archive

---





Traits | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Traits

======

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Index | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Index

[A](#letterA)

 B

 [C](#letterC)

 D

 E

 [F](#letterF)

[G](#letterG)

 H

 I

 J

 K

 L

 M

 N

 [O](#letterO)

 P

 Q

 [R](#letterR)

[S](#letterS)

 T

 [U](#letterU)

 V

 W

 X

 Y

 Z

 

A

-

[PharAdapter::addFolder](Elibyy/Adapters/PharAdapter.html#method_addFolder)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::addFile](Elibyy/Adapters/PharAdapter.html#method_addFile)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::addGlob](Elibyy/Adapters/PharAdapter.html#method_addGlob)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::addPattern](Elibyy/Adapters/PharAdapter.html#method_addPattern)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::addFolder](Elibyy/Adapters/ZipAdapter.html#method_addFolder)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::addFile](Elibyy/Adapters/ZipAdapter.html#method_addFile)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::addGlob](Elibyy/Adapters/ZipAdapter.html#method_addGlob)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::addPattern](Elibyy/Adapters/ZipAdapter.html#method_addPattern)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter](Elibyy/General/Adapter.html) — *Class in namespace [Elibyy\General](Elibyy/General.html)*

Interface Adapter the adapter interface for adapters to implement[Adapter::addFolder](Elibyy/General/Adapter.html#method_addFolder)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

adds a new folder recursively to the archive[Adapter::addFile](Elibyy/General/Adapter.html#method_addFile)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

adds a new file into the archive.[Adapter::addGlob](Elibyy/General/Adapter.html#method_addGlob)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

adds files using[Adapter::addPattern](Elibyy/General/Adapter.html#method_addPattern)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

[Reader::addFolder](Elibyy/Reader.html#method_addFolder)() — *Method in class [Reader](Elibyy/Reader.html)*

adds a new folder to the archive recursively[Reader::addFile](Elibyy/Reader.html#method_addFile)() — *Method in class [Reader](Elibyy/Reader.html)*

adds a new file into the archive[Reader::addGlob](Elibyy/Reader.html#method_addGlob)() — *Method in class [Reader](Elibyy/Reader.html)*

adds files using[Reader::addPattern](Elibyy/Reader.html#method_addPattern)() — *Method in class [Reader](Elibyy/Reader.html)*

 C

-

[PharAdapter::compress](Elibyy/Adapters/PharAdapter.html#method_compress)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::compress](Elibyy/Adapters/ZipAdapter.html#method_compress)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Creator](Elibyy/Creator.html) — *Class in namespace [Elibyy](Elibyy.html)*

Class Creator this class is just removing the file existent check[Adapter::compress](Elibyy/General/Adapter.html#method_compress)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

[Reader::compress](Elibyy/Reader.html#method_compress)() — *Method in class [Reader](Elibyy/Reader.html)*

creates a new archive from the current archive with the new format specified F

-

[File](Elibyy/General/File.html) — *Class in namespace [Elibyy\General](Elibyy/General.html)*

Interface File[File](Elibyy/Phar/File.html) — *Class in namespace [Elibyy\Phar](Elibyy/Phar.html)*

Class File[File](Elibyy/Zip/File.html) — *Class in namespace [Elibyy\Zip](Elibyy/Zip.html)*

Class File this class is a wrapper for the file in archive G

-

[PharAdapter::getFiles](Elibyy/Adapters/PharAdapter.html#method_getFiles)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::getArchive](Elibyy/Adapters/PharAdapter.html#method_getArchive)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::getFilename](Elibyy/Adapters/PharAdapter.html#method_getFilename)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::getFilesCount](Elibyy/Adapters/PharAdapter.html#method_getFilesCount)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::getComment](Elibyy/Adapters/PharAdapter.html#method_getComment)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::getFiles](Elibyy/Adapters/ZipAdapter.html#method_getFiles)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::getFilesCount](Elibyy/Adapters/ZipAdapter.html#method_getFilesCount)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::getArchive](Elibyy/Adapters/ZipAdapter.html#method_getArchive)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::getFilename](Elibyy/Adapters/ZipAdapter.html#method_getFilename)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::getComment](Elibyy/Adapters/ZipAdapter.html#method_getComment)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter::getFiles](Elibyy/General/Adapter.html#method_getFiles)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

returns an array of {@link File} object to iterate on[Adapter::getArchive](Elibyy/General/Adapter.html#method_getArchive)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

returns the archive object depends on the adapter[Adapter::getFilename](Elibyy/General/Adapter.html#method_getFilename)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

returns the archive file name[Adapter::getFilesCount](Elibyy/General/Adapter.html#method_getFilesCount)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

returns the number of files in the archive[Adapter::getComment](Elibyy/General/Adapter.html#method_getComment)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

returns the archive comment if supported by the archive or false if not supported[File::getName](Elibyy/General/File.html#method_getName)() — *Method in class [File](Elibyy/General/File.html)*

[File::getExtension](Elibyy/General/File.html#method_getExtension)() — *Method in class [File](Elibyy/General/File.html)*

[File::getModifiedAt](Elibyy/General/File.html#method_getModifiedAt)() — *Method in class [File](Elibyy/General/File.html)*

[File::getIndex](Elibyy/General/File.html#method_getIndex)() — *Method in class [File](Elibyy/General/File.html)*

[File::getSize](Elibyy/General/File.html#method_getSize)() — *Method in class [File](Elibyy/General/File.html)*

[File::getCompressedSize](Elibyy/General/File.html#method_getCompressedSize)() — *Method in class [File](Elibyy/General/File.html)*

[File::getCrc](Elibyy/General/File.html#method_getCrc)() — *Method in class [File](Elibyy/General/File.html)*

[File::getCompressionMethod](Elibyy/General/File.html#method_getCompressionMethod)() — *Method in class [File](Elibyy/General/File.html)*

[File::getStringCompressionMethod](Elibyy/General/File.html#method_getStringCompressionMethod)() — *Method in class [File](Elibyy/General/File.html)*

[File::getComment](Elibyy/General/File.html#method_getComment)() — *Method in class [File](Elibyy/General/File.html)*

[File::getAdapter](Elibyy/General/File.html#method_getAdapter)() — *Method in class [File](Elibyy/General/File.html)*

[File::getName](Elibyy/Phar/File.html#method_getName)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getExtension](Elibyy/Phar/File.html#method_getExtension)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getModifiedAt](Elibyy/Phar/File.html#method_getModifiedAt)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getIndex](Elibyy/Phar/File.html#method_getIndex)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getSize](Elibyy/Phar/File.html#method_getSize)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getCompressedSize](Elibyy/Phar/File.html#method_getCompressedSize)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getCrc](Elibyy/Phar/File.html#method_getCrc)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getCompressionMethod](Elibyy/Phar/File.html#method_getCompressionMethod)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getStringCompressionMethod](Elibyy/Phar/File.html#method_getStringCompressionMethod)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getComment](Elibyy/Phar/File.html#method_getComment)() — *Method in class [File](Elibyy/Phar/File.html)*

[File::getAdapter](Elibyy/Phar/File.html#method_getAdapter)() — *Method in class [File](Elibyy/Phar/File.html)*

[Reader::getAdapter](Elibyy/Reader.html#method_getAdapter)() — *Method in class [Reader](Elibyy/Reader.html)*

returns the current adapter instance provided by {@link Reader#\_getAdapter(string $file)}[Reader::getFilename](Elibyy/Reader.html#method_getFilename)() — *Method in class [Reader](Elibyy/Reader.html)*

this function returns the loaded archive name from the adapter[Reader::getArchive](Elibyy/Reader.html#method_getArchive)() — *Method in class [Reader](Elibyy/Reader.html)*

returns the archive object from the adapter[Reader::getFiles](Elibyy/Reader.html#method_getFiles)() — *Method in class [Reader](Elibyy/Reader.html)*

returns an array of {@link File} object to iterate on[Reader::getFilesCount](Elibyy/Reader.html#method_getFilesCount)() — *Method in class [Reader](Elibyy/Reader.html)*

returns the number of files in the archive[Reader::getComment](Elibyy/Reader.html#method_getComment)() — *Method in class [Reader](Elibyy/Reader.html)*

returns the archive comment from the adapter[File::getName](Elibyy/Zip/File.html#method_getName)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getExtension](Elibyy/Zip/File.html#method_getExtension)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getModifiedAt](Elibyy/Zip/File.html#method_getModifiedAt)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getIndex](Elibyy/Zip/File.html#method_getIndex)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getSize](Elibyy/Zip/File.html#method_getSize)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getCompressedSize](Elibyy/Zip/File.html#method_getCompressedSize)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getCrc](Elibyy/Zip/File.html#method_getCrc)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getCompressionMethod](Elibyy/Zip/File.html#method_getCompressionMethod)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getStringCompressionMethod](Elibyy/Zip/File.html#method_getStringCompressionMethod)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getComment](Elibyy/Zip/File.html#method_getComment)() — *Method in class [File](Elibyy/Zip/File.html)*

[File::getAdapter](Elibyy/Zip/File.html#method_getAdapter)() — *Method in class [File](Elibyy/Zip/File.html)*

 O

-

[PharAdapter::open](Elibyy/Adapters/PharAdapter.html#method_open)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::open](Elibyy/Adapters/ZipAdapter.html#method_open)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter::open](Elibyy/General/Adapter.html#method_open)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

opens the archive file or creates one by the file name supplied P

-

[PharAdapter](Elibyy/Adapters/PharAdapter.html) — *Class in namespace [Elibyy\Adapters](Elibyy/Adapters.html)*

Class PharAdapter \* this class is an adapter for phar,tar,tar.gz,bz2,gz files R

-

[PharAdapter::removeFileByObject](Elibyy/Adapters/PharAdapter.html#method_removeFileByObject)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::removeFileByName](Elibyy/Adapters/PharAdapter.html#method_removeFileByName)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::removeFileByObject](Elibyy/Adapters/ZipAdapter.html#method_removeFileByObject)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::removeFileByName](Elibyy/Adapters/ZipAdapter.html#method_removeFileByName)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter::removeFileByObject](Elibyy/General/Adapter.html#method_removeFileByObject)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

removes a file from the archive using a {@link File} Object[Adapter::removeFileByName](Elibyy/General/Adapter.html#method_removeFileByName)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

removes a file from the archive using the file name in the archive[Reader](Elibyy/Reader.html) — *Class in namespace [Elibyy](Elibyy.html)*

Class Elibyy\Reader   

 this class is abstract layer for the adapters for files[Reader::removeFileByObject](Elibyy/Reader.html#method_removeFileByObject)() — *Method in class [Reader](Elibyy/Reader.html)*

removes a file from the archive using a {@link File} Object[Reader::removeFileByName](Elibyy/Reader.html#method_removeFileByName)() — *Method in class [Reader](Elibyy/Reader.html)*

removes a file from the archive using the file name in the archive S

-

[PharAdapter::supports](Elibyy/Adapters/PharAdapter.html#method_supports)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::setComment](Elibyy/Adapters/PharAdapter.html#method_setComment)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::supports](Elibyy/Adapters/ZipAdapter.html#method_supports)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::setComment](Elibyy/Adapters/ZipAdapter.html#method_setComment)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter::setComment](Elibyy/General/Adapter.html#method_setComment)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

if supported by the adapter will set the new comment for the archive[Adapter::supports](Elibyy/General/Adapter.html#method_supports)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

checks if the file type is supported by the adapter[File::setComment](Elibyy/General/File.html#method_setComment)() — *Method in class [File](Elibyy/General/File.html)*

[File::setComment](Elibyy/Phar/File.html#method_setComment)() — *Method in class [File](Elibyy/Phar/File.html)*

[Reader::setComment](Elibyy/Reader.html#method_setComment)() — *Method in class [Reader](Elibyy/Reader.html)*

[File::setComment](Elibyy/Zip/File.html#method_setComment)() — *Method in class [File](Elibyy/Zip/File.html)*

 T

-

[TestAdapter](Elibyy/Adapters/TestAdapter.html) — *Class in namespace [Elibyy\Adapters](Elibyy/Adapters.html)*

Class TestAdapter this file is to cover the test of working extending adapter U

-

[PharAdapter::unzip](Elibyy/Adapters/PharAdapter.html#method_unzip)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[PharAdapter::updateArchive](Elibyy/Adapters/PharAdapter.html#method_updateArchive)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::unzip](Elibyy/Adapters/ZipAdapter.html#method_unzip)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[ZipAdapter::updateArchive](Elibyy/Adapters/ZipAdapter.html#method_updateArchive)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Adapter::unzip](Elibyy/General/Adapter.html#method_unzip)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

return true if the unzipping was success else failure[Adapter::updateArchive](Elibyy/General/Adapter.html#method_updateArchive)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

updates the archive in the adapter to show latest changes[Reader::unzip](Elibyy/Reader.html#method_unzip)() — *Method in class [Reader](Elibyy/Reader.html)*

[Reader::updateArchive](Elibyy/Reader.html#method_updateArchive)() — *Method in class [Reader](Elibyy/Reader.html)*

refreshes the archive in the adapter Z

-

[ZipAdapter](Elibyy/Adapters/ZipAdapter.html) — *Class in namespace [Elibyy\Adapters](Elibyy/Adapters.html)*

Class ZipAdapter this class is an adapter for zip files \_

--

[PharAdapter::\_\_construct](Elibyy/Adapters/PharAdapter.html#method___construct)() — *Method in class [PharAdapter](Elibyy/Adapters/PharAdapter.html)*

[ZipAdapter::\_\_construct](Elibyy/Adapters/ZipAdapter.html#method___construct)() — *Method in class [ZipAdapter](Elibyy/Adapters/ZipAdapter.html)*

[Creator::\_\_construct](Elibyy/Creator.html#method___construct)() — *Method in class [Creator](Elibyy/Creator.html)*

initiate a new instance of the creator with the file specified[Adapter::\_\_construct](Elibyy/General/Adapter.html#method___construct)() — *Method in class [Adapter](Elibyy/General/Adapter.html)*

[File::\_\_construct](Elibyy/General/File.html#method___construct)() — *Method in class [File](Elibyy/General/File.html)*

[File::\_\_construct](Elibyy/Phar/File.html#method___construct)() — *Method in class [File](Elibyy/Phar/File.html)*

[Reader::\_\_construct](Elibyy/Reader.html#method___construct)() — *Method in class [Reader](Elibyy/Reader.html)*

initiate a new instance of the reader with the file specified[File::\_\_construct](Elibyy/Zip/File.html#method___construct)() — *Method in class [File](Elibyy/Zip/File.html)*

  

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Namespace

Elibyy

======

|  |  |

| --- | --- |

| [Creator](Elibyy/Creator.html) | Class Creator this class is just removing the file existent check |

| [Reader](Elibyy/Reader.html) | Class Elibyy\Reader  this class is abstract layer for the adapters for files |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





All Classes | API





Classes | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Classes

=======

|  |  |

| --- | --- |

| [Elibyy\Adapters\PharAdapter](Elibyy/Adapters/PharAdapter.html) | 

 Class PharAdapter \* this class is an adapter for phar,tar,tar.gz,bz2,gz files

  |

| [Elibyy\Adapters\TestAdapter](Elibyy/Adapters/TestAdapter.html) | 

 Class TestAdapter this file is to cover the test of working extending adapter

  |

| [Elibyy\Adapters\ZipAdapter](Elibyy/Adapters/ZipAdapter.html) | 

 Class ZipAdapter this class is an adapter for zip files

  |

| [Elibyy\Creator](Elibyy/Creator.html) | 

 Class Creator this class is just removing the file existent check

  |

|  *[Elibyy\General\Adapter](Elibyy/General/Adapter.html)* | 

 Interface Adapter the adapter interface for adapters to implement

  |

|  *[Elibyy\General\File](Elibyy/General/File.html)* | 

 Interface File

  |

| [Elibyy\Phar\File](Elibyy/Phar/File.html) | 

 Class File

  |

| [Elibyy\Reader](Elibyy/Reader.html) | 

 Class Elibyy\Reader  this class is abstract layer for the adapters for files

  |

| [Elibyy\Zip\File](Elibyy/Zip/File.html) | 

 Class File this class is a wrapper for the file in archive

  |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





API

![](i/loader.gif) loading...

 

API

===

|  |

| --- |

|  |





Namespaces | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Namespaces

==========

|  |

| --- |

| [Elibyy](Elibyy.html) |

| [Elibyy\Adapters](Elibyy/Adapters.html) |

| [Elibyy\General](Elibyy/General.html) |

| [Elibyy\Phar](Elibyy/Phar.html) |

| [Elibyy\Zip](Elibyy/Zip.html) |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





API

 Your browser does not support frames. Go to the [non-frame version](namespaces.html).

 





Interfaces | API

* [Classes](classes.html)

* [Namespaces](namespaces.html)

* [Interfaces](interfaces.html)

* [Traits](traits.html)

* [Index](doc-index.html)

API

Interfaces

==========

|  |  |

| --- | --- |

| [Elibyy\General\Adapter](Elibyy/General/Adapter.html) | 

 Interface Adapter the adapter interface for adapters to implement

  |

| [Elibyy\General\File](Elibyy/General/File.html) | 

 Interface File

  |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Namespaces | API





Elibyy\General | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Namespace

Elibyy\General

==============

Interfaces

----------

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | Interface Adapter the adapter interface for adapters to implement |

| [File](../Elibyy/General/File.html) | Interface File |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Reader | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Class

[Elibyy](../Elibyy.html)\Reader

===============================

 class

 **Reader**

Class Elibyy\Reader   

 this class is abstract layer for the adapters for files

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)(string $file)

 initiate a new instance of the reader with the file specified |  |

| [Adapter](../Elibyy/General/Adapter.html) | [getAdapter](#method_getAdapter)()

 returns the current adapter instance provided by {@link Reader#\_getAdapter(string $file)} |  |

| 

 mixed

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 

 |  |

| 

 string

  | [getFilename](#method_getFilename)()

 this function returns the loaded archive name from the adapter |  |

| 

 mixed

  | [getArchive](#method_getArchive)()

 returns the archive object from the adapter |  |

| [File](../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 returns an array of {@link File} object to iterate on |  |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 returns the number of files in the archive |  |

| 

 string

  | [getComment](#method_getComment)()

 returns the archive comment from the adapter |  |

| [Adapter](../Elibyy/General/Adapter.html) | [setComment](#method_setComment)(string $comment)

 

 |  |

| [Adapter](../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = null)

 adds a new folder to the archive recursively |  |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, int $length = null)

 adds a new file into the archive |  |

| [Adapter](../Elibyy/General/Adapter.html) | [updateArchive](#method_updateArchive)()

 refreshes the archive in the adapter |  |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../Elibyy/General/File.html) $file)

 removes a file from the archive using a {@link File} Object |  |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 removes a file from the archive using the file name in the archive |  |

| 

 bool

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 adds files using |  |

| 

 bool

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 |  |

| [Adapter](../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format)

 creates a new archive from the current archive with the new format specified |  |

Details

-------

### 

at line 43

 `public 

 **\_\_construct**(string $file)`

initiate a new instance of the reader with the file specified

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the file to load with the reader |

#### Exceptions

|  |  |

| --- | --- |

| [RuntimeException](http://php.net/RuntimeException) | if no adapter found |

### 

at line 113

 `public [Adapter](../Elibyy/General/Adapter.html)

**getAdapter**()`

returns the current adapter instance provided by {@link Reader#\_getAdapter(string $file)}

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the current adapter instance |

### 

at line 127

 `public mixed

 **unzip**(string $destination = null, string|array $entries = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination | the destination folder to unzip to |

| string|array | $entries | the specific entries to extract from the archive can be either  a specific file (string) or an array for files |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 138

 `public string

 **getFilename**()`

this function returns the loaded archive name from the adapter

#### Return Value

|  |  |

| --- | --- |

| string | the archive filename |

### 

at line 149

 `public mixed

 **getArchive**()`

returns the archive object from the adapter

#### Return Value

|  |  |

| --- | --- |

| mixed | the archive received from the adapter |

### 

at line 160

 `public [File](../Elibyy/General/File.html)[]

 **getFiles**()`

returns an array of {@link File} object to iterate on

#### Return Value

|  |  |

| --- | --- |

| [File](../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

at line 171

 `public int

 **getFilesCount**()`

returns the number of files in the archive

#### Return Value

|  |  |

| --- | --- |

| int | the total files in the archive |

### 

at line 182

 `public string

 **getComment**()`

returns the archive comment from the adapter

#### Return Value

|  |  |

| --- | --- |

| string | the archive comment |

### 

at line 193

 `public [Adapter](../Elibyy/General/Adapter.html)

**setComment**(string $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new comment to set to the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) |  |

### 

at line 207

 `public [Adapter](../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = null)`

adds a new folder to the archive recursively

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the full path of the directory in the file system |

| string | $parent | the relative path of the parent in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the adapter instance |

### 

at line 223

 `public bool

 **addFile**(string $path, string $localName = null, int $start, int $length = null)`

adds a new file into the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the full path of the file in the file system |

| string | $localName | the local name of the file in the archive |

| int | $start | the start point to read from the file |

| int | $length | the end point to read from the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

at line 234

 `public [Adapter](../Elibyy/General/Adapter.html)

**updateArchive**()`

refreshes the archive in the adapter

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the adapter with updated archive |

### 

at line 247

 `public bool

 **removeFileByObject**([File](../Elibyy/General/File.html) $file)`

removes a file from the archive using a {@link File} Object

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 260

 `public bool

 **removeFileByName**(string $name)`

removes a file from the archive using the file name in the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 284

 `public bool

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

adds files using

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| bool | was glob added? |

### 

at line 298

 `public bool

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| bool | was pattern added? |

### 

at line 311

 `public [Adapter](../Elibyy/General/Adapter.html)

**compress**(string $format)`

creates a new archive from the current archive with the new format specified

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Adapters | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Namespace

Elibyy\Adapters

===============

|  |  |

| --- | --- |

| [PharAdapter](../Elibyy/Adapters/PharAdapter.html) | Class PharAdapter \* this class is an adapter for phar,tar,tar.gz,bz2,gz files |

| [TestAdapter](../Elibyy/Adapters/TestAdapter.html) | Class TestAdapter this file is to cover the test of working extending adapter |

| [ZipAdapter](../Elibyy/Adapters/ZipAdapter.html) | Class ZipAdapter this class is an adapter for zip files |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Phar | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Namespace

Elibyy\Phar

===========

|  |  |

| --- | --- |

| [File](../Elibyy/Phar/File.html) | Class File |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Zip | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Namespace

Elibyy\Zip

==========

|  |  |

| --- | --- |

| [File](../Elibyy/Zip/File.html) | Class File this class is a wrapper for the file in archive |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Creator | API

* [Classes](../classes.html)

* [Namespaces](../namespaces.html)

* [Interfaces](../interfaces.html)

* [Traits](../traits.html)

* [Index](../doc-index.html)

API

Class

[Elibyy](../Elibyy.html)\Creator

================================

 class

 **Creator** extends [Reader](../Elibyy/Reader.html)

Class Creator this class is just removing the file existent check

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)(string $file)

 initiate a new instance of the creator with the file specified |  |

| [Adapter](../Elibyy/General/Adapter.html) | [getAdapter](#method_getAdapter)()

 returns the current adapter instance provided by {@link Reader#\_getAdapter(string $file)} | from [Reader](../Elibyy/Reader.html#method_getAdapter) |

| 

 mixed

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 

 | from [Reader](../Elibyy/Reader.html#method_unzip) |

| 

 string

  | [getFilename](#method_getFilename)()

 this function returns the loaded archive name from the adapter | from [Reader](../Elibyy/Reader.html#method_getFilename) |

| 

 mixed

  | [getArchive](#method_getArchive)()

 returns the archive object from the adapter | from [Reader](../Elibyy/Reader.html#method_getArchive) |

| [File](../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 returns an array of {@link File} object to iterate on | from [Reader](../Elibyy/Reader.html#method_getFiles) |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 returns the number of files in the archive | from [Reader](../Elibyy/Reader.html#method_getFilesCount) |

| 

 string

  | [getComment](#method_getComment)()

 returns the archive comment from the adapter | from [Reader](../Elibyy/Reader.html#method_getComment) |

| [Adapter](../Elibyy/General/Adapter.html) | [setComment](#method_setComment)(string $comment)

 

 | from [Reader](../Elibyy/Reader.html#method_setComment) |

| [Adapter](../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = null)

 adds a new folder to the archive recursively | from [Reader](../Elibyy/Reader.html#method_addFolder) |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, int $length = null)

 adds a new file into the archive | from [Reader](../Elibyy/Reader.html#method_addFile) |

| [Adapter](../Elibyy/General/Adapter.html) | [updateArchive](#method_updateArchive)()

 refreshes the archive in the adapter | from [Reader](../Elibyy/Reader.html#method_updateArchive) |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../Elibyy/General/File.html) $file)

 removes a file from the archive using a {@link File} Object | from [Reader](../Elibyy/Reader.html#method_removeFileByObject) |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 removes a file from the archive using the file name in the archive | from [Reader](../Elibyy/Reader.html#method_removeFileByName) |

| 

 bool

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 adds files using | from [Reader](../Elibyy/Reader.html#method_addGlob) |

| 

 bool

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 | from [Reader](../Elibyy/Reader.html#method_addPattern) |

| [Adapter](../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format)

 creates a new archive from the current archive with the new format specified | from [Reader](../Elibyy/Reader.html#method_compress) |

Details

-------

### 

at line 32

 `public 

 **\_\_construct**(string $file)`

initiate a new instance of the creator with the file specified

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the file to load with the reader |

#### Exceptions

|  |  |

| --- | --- |

| [RuntimeException](http://php.net/RuntimeException) | if no adapter found |

### 

in [Reader](../Elibyy/Reader.html#method_getAdapter) at line 113

 `public [Adapter](../Elibyy/General/Adapter.html)

**getAdapter**()`

returns the current adapter instance provided by {@link Reader#\_getAdapter(string $file)}

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the current adapter instance |

### 

in [Reader](../Elibyy/Reader.html#method_unzip) at line 127

 `public mixed

 **unzip**(string $destination = null, string|array $entries = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination | the destination folder to unzip to |

| string|array | $entries | the specific entries to extract from the archive can be either  a specific file (string) or an array for files |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

in [Reader](../Elibyy/Reader.html#method_getFilename) at line 138

 `public string

 **getFilename**()`

this function returns the loaded archive name from the adapter

#### Return Value

|  |  |

| --- | --- |

| string | the archive filename |

### 

in [Reader](../Elibyy/Reader.html#method_getArchive) at line 149

 `public mixed

 **getArchive**()`

returns the archive object from the adapter

#### Return Value

|  |  |

| --- | --- |

| mixed | the archive received from the adapter |

### 

in [Reader](../Elibyy/Reader.html#method_getFiles) at line 160

 `public [File](../Elibyy/General/File.html)[]

 **getFiles**()`

returns an array of {@link File} object to iterate on

#### Return Value

|  |  |

| --- | --- |

| [File](../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

in [Reader](../Elibyy/Reader.html#method_getFilesCount) at line 171

 `public int

 **getFilesCount**()`

returns the number of files in the archive

#### Return Value

|  |  |

| --- | --- |

| int | the total files in the archive |

### 

in [Reader](../Elibyy/Reader.html#method_getComment) at line 182

 `public string

 **getComment**()`

returns the archive comment from the adapter

#### Return Value

|  |  |

| --- | --- |

| string | the archive comment |

### 

in [Reader](../Elibyy/Reader.html#method_setComment) at line 193

 `public [Adapter](../Elibyy/General/Adapter.html)

**setComment**(string $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new comment to set to the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) |  |

### 

in [Reader](../Elibyy/Reader.html#method_addFolder) at line 207

 `public [Adapter](../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = null)`

adds a new folder to the archive recursively

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the full path of the directory in the file system |

| string | $parent | the relative path of the parent in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the adapter instance |

### 

in [Reader](../Elibyy/Reader.html#method_addFile) at line 223

 `public bool

 **addFile**(string $path, string $localName = null, int $start, int $length = null)`

adds a new file into the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the full path of the file in the file system |

| string | $localName | the local name of the file in the archive |

| int | $start | the start point to read from the file |

| int | $length | the end point to read from the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

in [Reader](../Elibyy/Reader.html#method_updateArchive) at line 234

 `public [Adapter](../Elibyy/General/Adapter.html)

**updateArchive**()`

refreshes the archive in the adapter

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the adapter with updated archive |

### 

in [Reader](../Elibyy/Reader.html#method_removeFileByObject) at line 247

 `public bool

 **removeFileByObject**([File](../Elibyy/General/File.html) $file)`

removes a file from the archive using a {@link File} Object

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

in [Reader](../Elibyy/Reader.html#method_removeFileByName) at line 260

 `public bool

 **removeFileByName**(string $name)`

removes a file from the archive using the file name in the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

in [Reader](../Elibyy/Reader.html#method_addGlob) at line 284

 `public bool

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

adds files using

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| bool | was glob added? |

### 

in [Reader](../Elibyy/Reader.html#method_addPattern) at line 298

 `public bool

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| bool | was pattern added? |

### 

in [Reader](../Elibyy/Reader.html#method_compress) at line 311

 `public [Adapter](../Elibyy/General/Adapter.html)

**compress**(string $format)`

creates a new archive from the current archive with the new format specified

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy | API





Elibyy\General\File | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Interface

[Elibyy\General](../../Elibyy/General.html)\File

================================================

 interface

 **File**

Interface File

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)(array|string $args, [Adapter](../../Elibyy/General/Adapter.html) $adapter)

 

 |  |

| 

 mixed

  | [getName](#method_getName)()

 

 |  |

| 

 mixed

  | [getExtension](#method_getExtension)()

 

 |  |

| 

 mixed

  | [getModifiedAt](#method_getModifiedAt)(null $format = null)

 

 |  |

| 

 mixed

  | [getIndex](#method_getIndex)()

 

 |  |

| 

 mixed

  | [getSize](#method_getSize)()

 

 |  |

| 

 mixed

  | [getCompressedSize](#method_getCompressedSize)()

 

 |  |

| 

 mixed

  | [getCrc](#method_getCrc)()

 

 |  |

| 

 mixed

  | [getCompressionMethod](#method_getCompressionMethod)()

 

 |  |

| 

 mixed

  | [getStringCompressionMethod](#method_getStringCompressionMethod)()

 

 |  |

| 

 mixed

  | [setComment](#method_setComment)($comment $comment)

 

 |  |

| 

 mixed

  | [getComment](#method_getComment)()

 

 |  |

| 

 mixed

  | [getAdapter](#method_getAdapter)()

 

 |  |

Details

-------

### 

at line 27

 `public 

 **\_\_construct**(array|string $args, [Adapter](../../Elibyy/General/Adapter.html) $adapter)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| array|string | $args |  |

| [Adapter](../../Elibyy/General/Adapter.html) | $adapter |  |

### 

at line 33

 `public mixed

 **getName**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 39

 `public mixed

 **getExtension**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 47

 `public mixed

 **getModifiedAt**(null $format = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| null | $format |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 53

 `public mixed

 **getIndex**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 59

 `public mixed

 **getSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 65

 `public mixed

 **getCompressedSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 71

 `public mixed

 **getCrc**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 77

 `public mixed

 **getCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 83

 `public mixed

 **getStringCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 91

 `public mixed

 **setComment**($comment $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| $comment | $comment |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 97

 `public mixed

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 103

 `public mixed

 **getAdapter**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\General\Adapter | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Interface

[Elibyy\General](../../Elibyy/General.html)\Adapter

===================================================

 interface

 **Adapter**

Interface Adapter the adapter interface for adapters to implement

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)()

 

 |  |

| 

 void

  | [open](#method_open)(string $file, int $flags)

 opens the archive file or creates one by the file name supplied |  |

| [File](../../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 returns an array of {@link File} object to iterate on |  |

| 

 bool

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 return true if the unzipping was success else failure |  |

| 

 object

  | [getArchive](#method_getArchive)()

 returns the archive object depends on the adapter |  |

| 

 string

  | [getFilename](#method_getFilename)()

 returns the archive file name |  |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 returns the number of files in the archive |  |

| 

 string|bool

  | [getComment](#method_getComment)()

 returns the archive comment if supported by the archive or false if not supported |  |

| [Adapter](../../Elibyy/General/Adapter.html)|bool

  | [setComment](#method_setComment)(string $comment)

 if supported by the adapter will set the new comment for the archive |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = '')

 adds a new folder recursively to the archive |  |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

 adds a new file into the archive. |  |

| $this | [updateArchive](#method_updateArchive)()

 updates the archive in the adapter to show latest changes |  |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../../Elibyy/General/File.html) $file)

 removes a file from the archive using a {@link File} Object |  |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 removes a file from the archive using the file name in the archive |  |

| 

 array

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 adds files using |  |

| 

 array

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 |  |

| 

 static bool

  | [supports](#method_supports)(string $type)

 checks if the file type is supported by the adapter |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format)

 

 |  |

Details

-------

### 

at line 25

 `public 

 **\_\_construct**()`

### 

at line 36

 `public void

 **open**(string $file, int $flags)`

opens the archive file or creates one by the file name supplied

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the Archive filename |

| int | $flags | the flags depend on the adapter |

#### Return Value

|  |  |

| --- | --- |

| void |  |

### 

at line 44

 `public [File](../../Elibyy/General/File.html)[]

 **getFiles**()`

returns an array of {@link File} object to iterate on

#### Return Value

|  |  |

| --- | --- |

| [File](../../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

at line 55

 `public bool

 **unzip**(string $destination = null, string|array $entries = null)`

return true if the unzipping was success else failure

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination |  |

| string|array | $entries |  |

#### Return Value

|  |  |

| --- | --- |

| bool | was it success ? |

### 

at line 63

 `public object

 **getArchive**()`

returns the archive object depends on the adapter

#### Return Value

|  |  |

| --- | --- |

| object | the archive object instance depend on the adapter |

### 

at line 71

 `public string

 **getFilename**()`

returns the archive file name

#### Return Value

|  |  |

| --- | --- |

| string | the archive file name |

### 

at line 79

 `public int

 **getFilesCount**()`

returns the number of files in the archive

#### Return Value

|  |  |

| --- | --- |

| int | the number of files in the archive |

### 

at line 87

 `public string|bool

 **getComment**()`

returns the archive comment if supported by the archive or false if not supported

#### Return Value

|  |  |

| --- | --- |

| string|bool | the comment of the archive |

### 

at line 97

 `public [Adapter](../../Elibyy/General/Adapter.html)|bool

 **setComment**(string $comment)`

if supported by the adapter will set the new comment for the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new archive comment |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html)|bool | the adapter instance on suceess else false |

### 

at line 108

 `public [Adapter](../../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = '')`

adds a new folder recursively to the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the folder full path |

| string | $parent | the parent path used for relative path in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) |  |

### 

at line 124

 `public bool

 **addFile**(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)`

adds a new file into the archive.

please note if $noUpdate is set to true you must run {@link Adapter#updateArchive()} manually,  

or your archive info might not be updated

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the file full path |

| string | $localName | the file local name in the archive |

| int | $start | the start position to start from when reading the file |

| null | $length | the end position to stop when reading the file |

| bool | $noUpdate | if set will not update the archive after adding the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

at line 132

 `public $this

**updateArchive**()`

updates the archive in the adapter to show latest changes

#### Return Value

|  |  |

| --- | --- |

| $this |  |

### 

at line 142

 `public bool

 **removeFileByObject**([File](../../Elibyy/General/File.html) $file)`

removes a file from the archive using a {@link File} Object

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 152

 `public bool

 **removeFileByName**(string $name)`

removes a file from the archive using the file name in the archive

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 173

 `public array

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

adds files using

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| array | the result of the glob |

### 

at line 184

 `public array

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| array | the result of the pattern |

### 

at line 194

 `static public bool

 **supports**(string $type)`

checks if the file type is supported by the adapter

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $type | the file type |

#### Return Value

|  |  |

| --- | --- |

| bool | is the type supported |

### 

at line 202

 `public [Adapter](../../Elibyy/General/Adapter.html)

**compress**(string $format)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\General | API





Elibyy\Zip\File | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Class

[Elibyy\Zip](../../Elibyy/Zip.html)\File

========================================

 class

 **File** implements

 [File](../../Elibyy/General/File.html)

Class File this class is a wrapper for the file in archive

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)(array|string $args, [Adapter](../../Elibyy/General/Adapter.html) $adapter)

 

 |  |

| 

 mixed

  | [getName](#method_getName)()

 

 |  |

| 

 mixed

  | [getExtension](#method_getExtension)()

 

 |  |

| 

 mixed

  | [getModifiedAt](#method_getModifiedAt)(null $format = null)

 

 |  |

| 

 mixed

  | [getIndex](#method_getIndex)()

 

 |  |

| 

 mixed

  | [getSize](#method_getSize)()

 

 |  |

| 

 mixed

  | [getCompressedSize](#method_getCompressedSize)()

 

 |  |

| 

 mixed

  | [getCrc](#method_getCrc)()

 

 |  |

| 

 mixed

  | [getCompressionMethod](#method_getCompressionMethod)()

 

 |  |

| 

 mixed

  | [getStringCompressionMethod](#method_getStringCompressionMethod)()

 

 |  |

| 

 mixed

  | [setComment](#method_setComment)($comment $comment)

 

 |  |

| 

 mixed

  | [getComment](#method_getComment)()

 

 |  |

| 

 mixed

  | [getAdapter](#method_getAdapter)()

 

 |  |

Details

-------

### 

at line 67

 `public 

 **\_\_construct**(array|string $args, [Adapter](../../Elibyy/General/Adapter.html) $adapter)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| array|string | $args |  |

| [Adapter](../../Elibyy/General/Adapter.html) | $adapter |  |

### 

at line 76

 `public mixed

 **getName**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 84

 `public mixed

 **getExtension**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 92

 `public mixed

 **getModifiedAt**(null $format = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| null | $format |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 104

 `public mixed

 **getIndex**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 112

 `public mixed

 **getSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 120

 `public mixed

 **getCompressedSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 125

 `public mixed

 **getCrc**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 133

 `public mixed

 **getCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 141

 `public mixed

 **getStringCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 149

 `public mixed

 **setComment**($comment $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| $comment | $comment |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 157

 `public mixed

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 167

 `public mixed

 **getAdapter**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Zip | API





Elibyy\Adapters\PharAdapter | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Class

[Elibyy\Adapters](../../Elibyy/Adapters.html)\PharAdapter

=========================================================

 class

 **PharAdapter** implements

 [Adapter](../../Elibyy/General/Adapter.html)

Class PharAdapter \* this class is an adapter for phar,tar,tar.gz,bz2,gz files

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)()

 

 |  |

| 

 static bool

  | [supports](#method_supports)(string $type)

 

 |  |

| [File](../../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 

 |  |

| 

 object

  | [getArchive](#method_getArchive)()

 

 |  |

| 

 bool

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 

 |  |

| 

 string

  | [getFilename](#method_getFilename)()

 

 |  |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 

 |  |

| 

 string|bool

  | [getComment](#method_getComment)()

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html)|bool

  | [setComment](#method_setComment)(string $comment)

 

 |  |

| $this | [updateArchive](#method_updateArchive)()

 

 |  |

| 

 void

  | [open](#method_open)(string $file, int $flags = Phar::KEY\_AS\_FILENAME)

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = '')

 

 |  |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

 

 |  |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../../Elibyy/General/File.html) $file)

 

 |  |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 

 |  |

| 

 array

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 

 |  |

| 

 array

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format = \PharData::GZ)

 

 |  |

Details

-------

### 

at line 57

 `public 

 **\_\_construct**()`

### 

at line 67

 `static public bool

 **supports**(string $type)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $type | the file type |

#### Return Value

|  |  |

| --- | --- |

| bool | is the type supported |

### 

at line 75

 `public [File](../../Elibyy/General/File.html)[]

 **getFiles**()`

#### Return Value

|  |  |

| --- | --- |

| [File](../../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

at line 93

 `public object

 **getArchive**()`

#### Return Value

|  |  |

| --- | --- |

| object | the archive object instance depend on the adapter |

### 

at line 101

 `public bool

 **unzip**(string $destination = null, string|array $entries = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination |  |

| string|array | $entries |  |

#### Return Value

|  |  |

| --- | --- |

| bool | was it success ? |

### 

at line 113

 `public string

 **getFilename**()`

#### Return Value

|  |  |

| --- | --- |

| string | the archive file name |

### 

at line 121

 `public int

 **getFilesCount**()`

#### Return Value

|  |  |

| --- | --- |

| int | the number of files in the archive |

### 

at line 129

 `public string|bool

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| string|bool | the comment of the archive |

### 

at line 137

 `public [Adapter](../../Elibyy/General/Adapter.html)|bool

 **setComment**(string $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new archive comment |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html)|bool | the adapter instance on suceess else false |

### 

at line 145

 `public $this

**updateArchive**()`

#### Return Value

|  |  |

| --- | --- |

| $this |  |

### 

at line 154

 `public void

 **open**(string $file, int $flags = Phar::KEY_AS_FILENAME)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the Archive filename |

| int | $flags | the flags depend on the adapter |

#### Return Value

|  |  |

| --- | --- |

| void |  |

### 

at line 163

 `public [Adapter](../../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = '')`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the folder full path |

| string | $parent | the parent path used for relative path in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) |  |

### 

at line 191

 `public bool

 **addFile**(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the file full path |

| string | $localName | the file local name in the archive |

| int | $start | the start position to start from when reading the file |

| null | $length | the end position to stop when reading the file |

| bool | $noUpdate | if set will not update the archive after adding the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

at line 209

 `public bool

 **removeFileByObject**([File](../../Elibyy/General/File.html) $file)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 217

 `public bool

 **removeFileByName**(string $name)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 227

 `public array

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| array | the result of the glob |

### 

at line 235

 `public array

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| array | the result of the pattern |

### 

at line 243

 `public [Adapter](../../Elibyy/General/Adapter.html)

**compress**(string $format = \PharData::GZ)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Adapters\TestAdapter | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Class

[Elibyy\Adapters](../../Elibyy/Adapters.html)\TestAdapter

=========================================================

 class

 **TestAdapter** extends [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html)

Class TestAdapter this file is to cover the test of working extending adapter

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method___construct) |

| 

 static bool

  | [supports](#method_supports)(string $type)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_supports) |

| [File](../../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFiles) |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFilesCount) |

| 

 object

  | [getArchive](#method_getArchive)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getArchive) |

| 

 bool

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_unzip) |

| 

 string

  | [getFilename](#method_getFilename)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFilename) |

| 

 string|bool

  | [getComment](#method_getComment)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getComment) |

| [Adapter](../../Elibyy/General/Adapter.html)|bool

  | [setComment](#method_setComment)(string $comment)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_setComment) |

| $this | [updateArchive](#method_updateArchive)()

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_updateArchive) |

| 

 void

  | [open](#method_open)(string $file, int $flags = \ZipArchive::CREATE)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_open) |

| [Adapter](../../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = '')

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addFolder) |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addFile) |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../../Elibyy/General/File.html) $file)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_removeFileByObject) |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_removeFileByName) |

| 

 array

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addGlob) |

| 

 array

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addPattern) |

| [Adapter](../../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format)

 

 | from [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_compress) |

Details

-------

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method___construct) at line 48

 `public 

 **\_\_construct**()`

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_supports) at line 59

 `static public bool

 **supports**(string $type)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $type | the file type |

#### Return Value

|  |  |

| --- | --- |

| bool | is the type supported |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFiles) at line 67

 `public [File](../../Elibyy/General/File.html)[]

 **getFiles**()`

#### Return Value

|  |  |

| --- | --- |

| [File](../../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFilesCount) at line 82

 `public int

 **getFilesCount**()`

#### Return Value

|  |  |

| --- | --- |

| int | the number of files in the archive |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getArchive) at line 90

 `public object

 **getArchive**()`

#### Return Value

|  |  |

| --- | --- |

| object | the archive object instance depend on the adapter |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_unzip) at line 98

 `public bool

 **unzip**(string $destination = null, string|array $entries = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination |  |

| string|array | $entries |  |

#### Return Value

|  |  |

| --- | --- |

| bool | was it success ? |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getFilename) at line 110

 `public string

 **getFilename**()`

#### Return Value

|  |  |

| --- | --- |

| string | the archive file name |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_getComment) at line 118

 `public string|bool

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| string|bool | the comment of the archive |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_setComment) at line 126

 `public [Adapter](../../Elibyy/General/Adapter.html)|bool

 **setComment**(string $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new archive comment |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html)|bool | the adapter instance on suceess else false |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_updateArchive) at line 135

 `public $this

**updateArchive**()`

#### Return Value

|  |  |

| --- | --- |

| $this |  |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_open) at line 144

 `public void

 **open**(string $file, int $flags = \ZipArchive::CREATE)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the Archive filename |

| int | $flags | the flags depend on the adapter |

#### Return Value

|  |  |

| --- | --- |

| void |  |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addFolder) at line 152

 `public [Adapter](../../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = '')`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the folder full path |

| string | $parent | the parent path used for relative path in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) |  |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addFile) at line 180

 `public bool

 **addFile**(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the file full path |

| string | $localName | the file local name in the archive |

| int | $start | the start position to start from when reading the file |

| null | $length | the end position to stop when reading the file |

| bool | $noUpdate | if set will not update the archive after adding the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_removeFileByObject) at line 194

 `public bool

 **removeFileByObject**([File](../../Elibyy/General/File.html) $file)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_removeFileByName) at line 204

 `public bool

 **removeFileByName**(string $name)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addGlob) at line 214

 `public array

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| array | the result of the glob |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_addPattern) at line 224

 `public array

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| array | the result of the pattern |

### 

in [ZipAdapter](../../Elibyy/Adapters/ZipAdapter.html#method_compress) at line 240

 `public [Adapter](../../Elibyy/General/Adapter.html)

**compress**(string $format)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Adapters\ZipAdapter | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Class

[Elibyy\Adapters](../../Elibyy/Adapters.html)\ZipAdapter

========================================================

 class

 **ZipAdapter** implements

 [Adapter](../../Elibyy/General/Adapter.html)

Class ZipAdapter this class is an adapter for zip files

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)()

 

 |  |

| 

 static bool

  | [supports](#method_supports)(string $type)

 

 |  |

| [File](../../Elibyy/General/File.html)[]

  | [getFiles](#method_getFiles)()

 

 |  |

| 

 int

  | [getFilesCount](#method_getFilesCount)()

 

 |  |

| 

 object

  | [getArchive](#method_getArchive)()

 

 |  |

| 

 bool

  | [unzip](#method_unzip)(string $destination = null, string|array $entries = null)

 

 |  |

| 

 string

  | [getFilename](#method_getFilename)()

 

 |  |

| 

 string|bool

  | [getComment](#method_getComment)()

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html)|bool

  | [setComment](#method_setComment)(string $comment)

 

 |  |

| $this | [updateArchive](#method_updateArchive)()

 

 |  |

| 

 void

  | [open](#method_open)(string $file, int $flags = \ZipArchive::CREATE)

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [addFolder](#method_addFolder)(string $path, string $parent = '')

 

 |  |

| 

 bool

  | [addFile](#method_addFile)(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

 

 |  |

| 

 bool

  | [removeFileByObject](#method_removeFileByObject)([File](../../Elibyy/General/File.html) $file)

 

 |  |

| 

 bool

  | [removeFileByName](#method_removeFileByName)(string $name)

 

 |  |

| 

 array

  | [addGlob](#method_addGlob)(string $glob, int $flags = GLOB\_BRACE, array $options = array())

 

 |  |

| 

 array

  | [addPattern](#method_addPattern)(string $pattern, string $directory, array $options = array())

 

 |  |

| [Adapter](../../Elibyy/General/Adapter.html) | [compress](#method_compress)(string $format)

 

 |  |

Details

-------

### 

at line 48

 `public 

 **\_\_construct**()`

### 

at line 59

 `static public bool

 **supports**(string $type)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $type | the file type |

#### Return Value

|  |  |

| --- | --- |

| bool | is the type supported |

### 

at line 67

 `public [File](../../Elibyy/General/File.html)[]

 **getFiles**()`

#### Return Value

|  |  |

| --- | --- |

| [File](../../Elibyy/General/File.html)[] | the array of the files in the archive |

### 

at line 82

 `public int

 **getFilesCount**()`

#### Return Value

|  |  |

| --- | --- |

| int | the number of files in the archive |

### 

at line 90

 `public object

 **getArchive**()`

#### Return Value

|  |  |

| --- | --- |

| object | the archive object instance depend on the adapter |

### 

at line 98

 `public bool

 **unzip**(string $destination = null, string|array $entries = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $destination |  |

| string|array | $entries |  |

#### Return Value

|  |  |

| --- | --- |

| bool | was it success ? |

### 

at line 110

 `public string

 **getFilename**()`

#### Return Value

|  |  |

| --- | --- |

| string | the archive file name |

### 

at line 118

 `public string|bool

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| string|bool | the comment of the archive |

### 

at line 126

 `public [Adapter](../../Elibyy/General/Adapter.html)|bool

 **setComment**(string $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $comment | the new archive comment |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html)|bool | the adapter instance on suceess else false |

### 

at line 135

 `public $this

**updateArchive**()`

#### Return Value

|  |  |

| --- | --- |

| $this |  |

### 

at line 144

 `public void

 **open**(string $file, int $flags = \ZipArchive::CREATE)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $file | the Archive filename |

| int | $flags | the flags depend on the adapter |

#### Return Value

|  |  |

| --- | --- |

| void |  |

### 

at line 152

 `public [Adapter](../../Elibyy/General/Adapter.html)

**addFolder**(string $path, string $parent = '')`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the folder full path |

| string | $parent | the parent path used for relative path in the archive |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) |  |

### 

at line 180

 `public bool

 **addFile**(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $path | the file full path |

| string | $localName | the file local name in the archive |

| int | $start | the start position to start from when reading the file |

| null | $length | the end position to stop when reading the file |

| bool | $noUpdate | if set will not update the archive after adding the file |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file added? |

### 

at line 194

 `public bool

 **removeFileByObject**([File](../../Elibyy/General/File.html) $file)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| [File](../../Elibyy/General/File.html) | $file | the File Object to remove |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 204

 `public bool

 **removeFileByName**(string $name)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $name | the file name |

#### Return Value

|  |  |

| --- | --- |

| bool | was the file removed? |

### 

at line 214

 `public array

 **addGlob**(string $glob, int $flags = GLOB_BRACE, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $glob | the glob pattern |

| int | $flags | glob flags |

| array | $options | An associative array of options. Available options are:  "add*path"*   Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "remove |

path" or "remove*all*path" options. 

#### Return Value

|  |  |

| --- | --- |

| array | the result of the glob |

### 

at line 224

 `public array

 **addPattern**(string $pattern, string $directory, array $options = array())`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $pattern | the regular expression pattern |

| string | $directory | the path of the directory |

| array | $options | An associative array of options accepted by **ZipArchive::addGlob**.  |

#### Return Value

|  |  |

| --- | --- |

| array | the result of the pattern |

### 

at line 240

 `public [Adapter](../../Elibyy/General/Adapter.html)

**compress**(string $format)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| string | $format | the format of the compression |

#### Return Value

|  |  |

| --- | --- |

| [Adapter](../../Elibyy/General/Adapter.html) | the resulting adapter |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Adapters | API





Elibyy\Phar\File | API

* [Classes](../../classes.html)

* [Namespaces](../../namespaces.html)

* [Interfaces](../../interfaces.html)

* [Traits](../../traits.html)

* [Index](../../doc-index.html)

API

Class

[Elibyy\Phar](../../Elibyy/Phar.html)\File

==========================================

 class

 **File** implements

 [File](../../Elibyy/General/File.html)

Class File

Methods

-------

|  |  |  |

| --- | --- | --- |

|  | [\_\_construct](#method___construct)([PharFileInfo](http://php.net/PharFileInfo) $file, [Adapter](../../Elibyy/General/Adapter.html) $adapter)

 

 |  |

| 

 mixed

  | [getName](#method_getName)()

 

 |  |

| 

 mixed

  | [getExtension](#method_getExtension)()

 

 |  |

| 

 mixed

  | [getModifiedAt](#method_getModifiedAt)(null $format = null)

 

 |  |

| 

 mixed

  | [getIndex](#method_getIndex)()

 

 |  |

| 

 mixed

  | [getSize](#method_getSize)()

 

 |  |

| 

 mixed

  | [getCompressedSize](#method_getCompressedSize)()

 

 |  |

| 

 mixed

  | [getCrc](#method_getCrc)()

 

 |  |

| 

 mixed

  | [getCompressionMethod](#method_getCompressionMethod)()

 

 |  |

| 

 mixed

  | [getStringCompressionMethod](#method_getStringCompressionMethod)()

 

 |  |

| 

 mixed

  | [setComment](#method_setComment)($comment $comment)

 

 |  |

| 

 mixed

  | [getComment](#method_getComment)()

 

 |  |

| 

 mixed

  | [getAdapter](#method_getAdapter)()

 

 |  |

Details

-------

### 

at line 35

 `public 

 **\_\_construct**([PharFileInfo](http://php.net/PharFileInfo) $file, [Adapter](../../Elibyy/General/Adapter.html) $adapter)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| [PharFileInfo](http://php.net/PharFileInfo) | $file |  |

| [Adapter](../../Elibyy/General/Adapter.html) | $adapter |  |

### 

at line 44

 `public mixed

 **getName**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 52

 `public mixed

 **getExtension**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 60

 `public mixed

 **getModifiedAt**(null $format = null)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| null | $format |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 71

 `public mixed

 **getIndex**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 79

 `public mixed

 **getSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 87

 `public mixed

 **getCompressedSize**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 95

 `public mixed

 **getCrc**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 103

 `public mixed

 **getCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 111

 `public mixed

 **getStringCompressionMethod**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 119

 `public mixed

 **setComment**($comment $comment)`

#### Parameters

|  |  |  |

| --- | --- | --- |

| $comment | $comment |  |

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 127

 `public mixed

 **getComment**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

### 

at line 135

 `public mixed

 **getAdapter**()`

#### Return Value

|  |  |

| --- | --- |

| mixed |  |

 Generated by [Sami, the API Documentation Generator](http://sami.sensiolabs.org/).

 





Elibyy\Phar | API

