Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Class: unpacker

Source Location: /system/classes/unpacker.class.php

Class Overview


Geeklog plugin unpacker - Archive Libs Wrapper This class wraps calls to pecl Zip, pear Zip, pear Tar, using the best package available to unpack or list information about the archive.


Author(s):

  • Justin Carlson, justin DOT carlson AT gmail DOT com

Variables

Methods



Class Details

[line 41]
Geeklog plugin unpacker - Archive Libs Wrapper This class wraps calls to pecl Zip, pear Zip, pear Tar, using the best package available to unpack or list information about the archive.



Tags:

author:  Justin Carlson, justin DOT carlson AT gmail DOT com


[ Top ]


Class Variables

$archive =  null

[line 63]


Type:   mixed


[ Top ]

$comp =  null

[line 69]


Type:   mixed


[ Top ]

$contents =  null

[line 62]


Type:   mixed


[ Top ]

$d_sep =  null

[line 67]


Type:   mixed


[ Top ]

$error =  null

[line 65]


Type:   mixed


[ Top ]

$errorno =  null

[line 64]


Type:   mixed


[ Top ]

$ext =  null

[line 61]


Type:   mixed


[ Top ]

$file =  null

[line 59]


Type:   mixed


[ Top ]

$filesize =  null

[line 60]


Type:   mixed


[ Top ]

$mime_def = array('application/zip'               => 'zip',
                          'application/x-zip'             => 'zip',
                          'application/x-zip-compressed'  => 'zip',
                          'multipart/x-zip'               => 'zip',
                          'application/gzip'              => 'tar',
                          'application/tar'               => 'tar',
                          'application/x-tar'             => 'tar',
                          'application/x-gtar'            => 'tar',
                          'application/x-gzip'            => 'tar',
                          'application/x-gzip-compressed' => 'tar',
                          'application/octet-stream'      => 'tar',
                          'application/x-compress'        => 'tar',
                          'application/x-compressed'      => 'tar')

[line 45]


Type:   mixed


[ Top ]

$type =  null

[line 68]


Type:   mixed


[ Top ]

$u_size =  null

[line 66]


Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 78]

boolean __construct( string $file, [string $mime_type = null])

Constructor



Tags:

return:  result of loading archive passed
access:  public


Parameters:

string   $file   full path to archive
string   $mime_type   mime type ( optional, application/zip, /tar, etc )

[ Top ]

method getdir [line 415]

mixed getdir( )

return the first directory name in the archive



Tags:

return:  string directory name, or boolean false


[ Top ]

method getlist [line 228]

array getlist( )

return contents of archive (wrapper)



Tags:

return:  array(array('filename','size','etc')) archive contents


[ Top ]

method getunpackedsize [line 432]

mixed getunpackedsize( )

return the total unpacked size of the archive



Tags:

return:  (size in bytes or false on error)


[ Top ]

method list_tar [line 294]

array list_tar( )

return contents of tar archive



Tags:

return:  array(array('filename','size','etc')) archive contents


[ Top ]

method list_zip [line 251]

array list_zip( )

return contents of zip archive



Tags:

return:  array(array('filename','size','etc')) archive contents


[ Top ]

method load_file [line 169]

boolean load_file( )

Decides which loader to call, or returns false if one isn't found.



Tags:

return:  result of loading archive passed


[ Top ]

method load_tar [line 213]

boolean load_tar( )

load a tar archive



Tags:

return:  result of loading archive passed


[ Top ]

method load_zip [line 184]

boolean load_zip( )

load a zip archive



Tags:

return:  result of loading archive passed


[ Top ]

method open [line 148]

boolean open( string $file, [string $optional_type = false])

Open - Constructor Wrapper This clears the vars and loads another file.

( May never be used )




Tags:

return:  result of loading archive passed


Parameters:

string   $file   full path to archive
string   $optional_type   mime type ( application/zip, /tar, etc )

[ Top ]

method setError [line 462]

boolean, setError( string $errorno, string $error)

sets an error number and string to report if asked acts as a wrapper for return false, to set an error at the same time



Tags:

return:  always false


Parameters:

string   $errorno   error number ( anything goes )
string   $error   error text ( anything goes )

[ Top ]

method unpack [line 311]

boolean unpack( string $target_path, [array $item_array = null])

unpack the archive in the target path (wrapper)



Tags:

return:  result


Parameters:

string   $target_path   destination
array   $item_array   array of specific path/file(s)

[ Top ]

method unpack_tar [line 396]

boolean unpack_tar( string $target_path, [array $item_array = null])

unpack a tar archive in the target path



Tags:

return:  result


Parameters:

string   $target_path   destination
array   $item_array   array of specific path/file(s)

[ Top ]

method unpack_zip [line 338]

boolean unpack_zip( string $target_path, [array $item_array = null])

unpack a zip archive in the target path



Tags:

return:  result


Parameters:

string   $target_path   destination
array   $item_array   array of specific path/file(s)

[ Top ]


Documentation generated on Sun, 02 Oct 2016 07:56:32 +0000 by phpDocumentor 1.4.3