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


Author(s):

  • Justin Carlson, justin DOT carlson AT gmail DOT com

Variables

Methods



Class Details

[line 43]
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 64]


Type:   mixed


[ Top ]

$comp =  null

[line 70]


Type:   mixed


[ Top ]

$contents =  null

[line 63]


Type:   mixed


[ Top ]

$d_sep =  null

[line 68]


Type:   mixed


[ Top ]

$error =  null

[line 66]


Type:   mixed


[ Top ]

$errorno =  null

[line 65]


Type:   mixed


[ Top ]

$ext =  null

[line 62]


Type:   mixed


[ Top ]

$file =  null

[line 60]


Type:   mixed


[ Top ]

$filesize =  null

[line 61]


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/octet-stream'     => 'tar',
                     'application/x-compress'       => 'tar',
                     'application/x-compressed'     => 'tar')

[line 47]


Type:   mixed


[ Top ]

$type =  null

[line 69]


Type:   mixed


[ Top ]

$u_size =  null

[line 67]


Type:   mixed


[ Top ]



Class Methods


constructor unpacker [line 80]

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

Constructor



Tags:

return:  result of loading archive passed


Parameters:

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

[ Top ]

method getdir [line 418]

mixed getdir( )

return the first directory name in the archive



Tags:

return:  string directory name, or boolean false


[ Top ]

method getlist [line 231]

array getlist( )

return contents of archive (wrapper)



Tags:

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


[ Top ]

method getunpackedsize [line 435]

mixed getunpackedsize( )

return the total unpacked size of the archive



Tags:

return:  (size in bytes or false on error)


[ Top ]

method list_tar [line 297]

array list_tar( )

return contents of tar archive



Tags:

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


[ Top ]

method list_zip [line 254]

array list_zip( )

return contents of zip archive



Tags:

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


[ Top ]

method load_file [line 171]

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 215]

boolean load_tar( )

load a tar archive



Tags:

return:  result of loading archive passed


[ Top ]

method load_zip [line 186]

boolean load_zip( )

load a zip archive



Tags:

return:  result of loading archive passed


[ Top ]

method open [line 150]

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 465]

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 314]

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 400]

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 341]

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 Sat, 11 Feb 2012 02:09:27 -0500 by phpDocumentor 1.4.3