API15

Difference between revisions of "JArchiveZip/extract"

From Joomla! Documentation

< API15:JArchiveZip
(New page: ===Description=== Extract a ZIP compressed file to a given path <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton...)
 
m (preparing for archive only)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
Extract a ZIP compressed file to a given path
 
Extract a ZIP compressed file to a given path
  
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JArchiveZip/extract|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
  
{{Description:JArchiveZip/extract}}
+
 
 +
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 56: Line 54:
 
</source>
 
</source>
  
<span class="editsection" style="font-size:76%;">
+
 
<nowiki>[</nowiki>[[SeeAlso:JArchiveZip/extract|Edit See Also]]<nowiki>]</nowiki>
+
<! removed transcluded page call, red link never existed >
</span>
 
{{SeeAlso:JArchiveZip/extract}}
 
  
 
===Examples===
 
===Examples===
<CodeExamplesForm />
+
=== Code Examples ===
 
<dpl>
 
<dpl>
 
  noresultsheader=\n
 
  noresultsheader=\n
 
  category=extract
 
  category=extract
 
  category=JArchiveZip
 
  category=JArchiveZip
  category=CodeExample
+
  namespace=CodeExample
 
  category=MethodExample
 
  category=MethodExample
 
  include=*
 
  include=*
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Latest revision as of 19:18, 24 March 2017

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Extract a ZIP compressed file to a given path


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

Syntax[edit]

extract($archive, $destination, $options=array())
Parameter Name Default Value Description
$archive $archive Path to ZIP archive to extract
$destination $destination Path to extract archive into
$options array() $options Extraction options [unused]

Returns[edit]

boolean True if successful

Defined in[edit]

libraries/joomla/filesystem/archive/zip.php

Importing[edit]

jimport( 'joomla.filesystem.archive.zip' );

Source Body[edit]

function extract($archive, $destination, $options = array ())
{
        if ( ! is_file($archive) )
        {
                $this->set('error.message', 'Archive does not exist');
                return false;
        }

        if ($this->hasNativeSupport()) {
                return ($this->_extractNative($archive, $destination, $options))? true : JError::raiseWarning(100, $this->get('error.message'));
        } else {
                return ($this->_extract($archive, $destination, $options))? true : JError::raiseWarning(100, $this->get('error.message'));
        }
}


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

Examples[edit]

Code Examples[edit]