API15

JArchiveZip/checkZipData: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 43: Line 43:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=checkZipData
  category=checkZipData
  category=JArchiveZip
  category=JArchiveZip
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 00:18, 25 March 2017

Description

Checks to see if the data is a valid ZIP file.


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

Syntax

checkZipData(&$data)
Parameter Name Default Value Description
&$data $data ZIP archive data buffer

Returns

boolean True if valid, false if invalid.

Defined in

libraries/joomla/filesystem/archive/zip.php

Importing

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

Source Body

function checkZipData(& $data) {
        if (strpos($data, $this->_fileHeader) === false) {
                return false;
        } else {
                return true;
        }
}


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

Examples

Code Examples