API15:JArchiveZip/create/ja
出典: Joomla! ドキュメンテーション
目次 |
Description
Create a ZIP compressed file from an array of file data.
Syntax
create($archive, $files, $options=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $archive | $archive Path to save archive | |
| $files | $files Array of files to add to archive | |
| $options | array() | $options Compression options [unused] |
Returns
boolean True if successful
Defined in
libraries/joomla/filesystem/archive/zip.php
Importing
jimport( 'joomla.filesystem.archive.zip' );
Source Body
function create($archive, $files, $options = array ()) { // Initialize variables $contents = array(); $ctrldir = array(); foreach ($files as $file) { $this->_addToZIPFile($file, $contents, $ctrldir); } return $this->_createZIPFile($contents, $ctrldir, $archive); }
Examples
<CodeExamplesForm />
