Actions

API15

Difference between revisions of "JArchiveZip/create"

From Joomla! Documentation

< API15:JArchiveZip
(New page: ===Description=== Create a ZIP compressed file from an array of file data. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JArchiveZip/create|Edit De...)
 
m (removing red link to edit, no existant pages)
 
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JArchiveZip/create|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JArchiveZip/create}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 55: Line 55:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JArchiveZip/create|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JArchiveZip/create}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 70: Line 70:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Latest revision as of 08:43, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Create a ZIP compressed file from an array of file data.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />