Download the PHP package seblucas/tbszip without Composer

On this page you can find all versions of the php package seblucas/tbszip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tbszip

TbsZip - a zip modifier for PHP

version 2.16, 2014-04-08, by Skrol29
document updated on 2014-04-08

Introduction

TbsZip is a PHP class which can read a zip archive, and even edit sub-files in the archive and then create a new archive. It works without any temporary file. While this class is independent from other libraries, it has been first created for the OpenTBS project which is a plugin for the TinyButStrong Template Engine. OpenTBS makes TinyButStrong able to build OpenOffice and Ms Office documents with the technique of templates.

TbsZip is developed under PHP5 but should be compatible with PHP4.

See the OpenTBS demo.
See other TinyButStrong plugins.

Features

Limitations

Example

Synopsis

Class name: clsTbsZip

Open an original Zip archive (it can be an LibreOffice document, an MS Office document or any other Zip archive).

Versioning:

Create a new empty Zip archive. The new archive is virtually prepared in the PHP memory, nothing is written at this point. Methods FileExists(), FileRead() and FileReplace() cannot be used when you work on an new archive created by CreateNew(), simply because the archive is empty.

Versioning:

Return true if the file exists in the original archive. $NameOrIdx must be the full name (including folder name inside the archive) or the index of an existing file in the archive.

Return the contents of the file stored in the original archive. If $Uncompress is true, then TbsZip tryies to uncompressed the contents if needed. If the file is compressed but TbsZip cannot uncompress it then an error is raised. You can check if the result is compressed using property LastReadComp.

Replace or delete an existing file in the archive. Set $Data=false in order to delete the file. $DataType accepts TBSZIP_STRING and TBSZIP_FILE ($Data must then be the path of the external file to insert). $Compress can be true, false or an array with keys ('meth', 'len_u', 'crc32') which means that the data is already previously compressed. Note that the original archive is not modified, modifications will be provided as a new archive when you call the method Flush().

Return value Description
false if the file has not been replaced or deleted.
true if the file has been successfully deleted.
-1 if the file could not be compressed and has been stored uncompressed
0 if the file has been stored uncompressed as expected
1 if the file has been stored compressed has expected
2 if the file has been stored as is with pre-compression as defined in the array $Compress

It's very interesting to know that when you add or replace a file in the archive with an external file (i.e. using option TBSZIP_FILE), then the contents of the file is not loaded immediately in PHP memory. It will be loaded, compressed and output on the fly and one by one when method Flush() is called. Thus, you can add lot of files in an archive without occupying the PHP memory.

Add a new file in the archive, works like FileReplace(). Note that the original archive is not modified, modifications will be provided as a new archive when you call the method Flush().

If $Data is false then the previously add file with the given name is canceled if any.

Cancel add, delete and replacements in the archive for the given file name. Return the number of cancels.

Return a string that represents the state of the file in the archive:

Return value Description
'u' Unchanged
'm' Modified
'd' Deleted
'a' Added
false The file is not found in the archive

Actually create the new archive with all modifications. External files to be inserted as sub-files are loaded during this proces and not before. They are compressed and output on the fly and one by one without staying in the PHP memory. No temporay files are used.

$Render Description
TBSZIP_DOWNLOAD will provide the new archive as a download with HTTP headers. Use $File to customize the name of the downloaded file. Use $ContentType to customize the ContentType header.
TBSZIP_DOWNLOAD + TBSZIP_NOHEADER will provide the new archive as a download without HTTP
TBSZIP_FILE will provide the new archive as a physical file on the server. Use $File to define the path of the physical file
TBSZIP_STRING will make method Flush() to return the new archive as a binary string

Display information about the original archive.

Close the opened original archive.

Full path of the opened original archive.

An array listing all existing files in the original archive with some technical information.

Index of the last file read by FileRead(). false means the file was not found in the archive.

Compression information about of the last file read by FileRead().

Default value is false until version 2.3, and true since version 2.4.

If the value is true, TbsZip error messages are displayed (using echo).

In any case, the last TbsZip error message is saved into property Error. It can be interesting to not display error directly, for example when you flush the new archive with the Download option, the error message may be merged to the downloaded file.

Last error message, or false if no TbsZip error. Use this property in order to check errors when property DisplayError is set to false.

Change log

Version 2.16, date: 2014-04-08

Version 2.15, date: 2013-10-15

Version 2.14, date: 2013-06-11

Version 2.13, date: 2013-04-14

Version 2.12, date: 2013-03-16

Version 2.11, date: 2011-02-14

Version 2.10, date: 2011-08-13

Version 2.9, date: 2011-07-22

Version 2.8, date: 2011-06-08

Version 2.7, date: 2011-06-07

Version 2.6, date: 2011-06-07

Version 2.5, date: 2011-05-12

Version 2.4, date: 2011-03-25

Version 2.3, date: 2010-11-29

Version 2.2, date: 2010-10-28

Version 2.1, date: 2010-07-01

Contact and license

Author: Skrol29

License: LGPL


All versions of tbszip with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-zlib Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package seblucas/tbszip contains the following files

Loading the files please wait ....