Admin Page Framework Documentation

Packages

  • AdminPageFramework
    • Common
      • Factory
      • Form
        • FieldType
      • Utility
    • Factory
      • AdminPage
      • MetaBox
      • NetworkAdmin
      • PageMetaBox
      • PostType
      • TaxonomyField
      • TermMeta
      • UserMeta
      • Widget
    • Utility

Classes

  • AdminPageFramework_ClassTester
  • AdminPageFramework_PluginBootstrap
  • AdminPageFramework_PointerToolTip
  • AdminPageFramework_Requirement
  • AdminPageFramework_TableOfContents
  • AdminPageFramework_WPReadmeParser
  • AdminPageFramework_WPUtility_Time
  • AdminPageFramework_Zip

Resources

  • Tutorials
  • Support
  • Reporting Issues

Class AdminPageFramework_Zip

Compresses files into a zip file.

Usage

Pass a source directory/file path to the first parameter and a destination directory path to the second parameter. Then use the compress() method to perform archiving.

Example

$_oZip     = new AdminPageFramework_Zip( $sSourcePath, $sDestinationPath );
$_bSucceed = $_oZip->compress();
Package: AdminPageFramework\Utility
Since: 3.5.4
Located at utility/zip/AdminPageFramework_Zip.php

Methods summary

public
# __construct( string $sSource, string $sDestination, array|boolean $abOptions = false, array $aCallbacks = array() )

Sets up properties.

Parameters

$sSource
string
$sSource
$sDestination
string
$sDestination
$abOptions
array|boolean
$abOptions
$aCallbacks
callable[]
$aCallbacks
public boolean
# compress( )

Performs zip file compression.

Returns

boolean
True on success; false otherwise.

Since

3.5.4
public boolean
# _replyToCompressDirectory( ZipArchive $oZip, mixed $sSourceDirPath, array $aCallbacks = array(), mixed $bIncludeDir = false, array $aAdditionalSourceDirs = array() )

Returns

boolean
True on success, false otherwise.

Since

3.5.4
3.6.0 Changed the name from _compressDirectory. Changed the scope to public to allow overriding the method in an extended class.
public boolean
# _replyToCompressFile( ZipArchive $oZip, mixed $sSourceFilePath, mixed $aCallbacks = null )

Compresses a file.

Returns

boolean
True on success, false otherwise.

Since

3.5.4
3.6.0 Changed the name from _compressFile. Changed the scope from private to allow overriding in an extended class.

Magic methods summary

Properties summary

public mixed $sSource
#

Stores a source directory/file path.

public mixed $sDestination
#

Stores a destination path of the target zip file.

e.g. '/my_dir/myscript.zip'

public array $aCallbacks
#

Stores a callable that gets applied to parsing file string contents.

public array $aOptions
#

Stores settings.

Since

3.6.0

Related

If you find undocumented functionality, please report it here.

Admin Page Framework