diff options
Diffstat (limited to 'test/scanners/php/test.expected.raydebug')
-rw-r--r-- | test/scanners/php/test.expected.raydebug | 498 |
1 files changed, 498 insertions, 0 deletions
diff --git a/test/scanners/php/test.expected.raydebug b/test/scanners/php/test.expected.raydebug new file mode 100644 index 0000000..30c860c --- /dev/null +++ b/test/scanners/php/test.expected.raydebug @@ -0,0 +1,498 @@ +operator(<)operator(?)ident(php) +comment(/*)comment(*) +comment( * Zip class file) +comment( *) +comment( * @package fnord.bb) +comment( * @subpackage archive) +comment( )comment(*/) + +comment(// Unlock?) +reserved(if)operator(()operator(!)ident(defined)operator(()delimiter(')string(UNLOCK)delimiter(')operator(\)) operator(|)operator(|) operator(!)constant(UNLOCK)operator(\)) + reserved(die)operator(()operator(\))operator(;) + +comment(// Load the parent archive class) +pre_type(require_once)operator(()constant(ROOT_PATH)operator(.)delimiter(')string(/classes/archive.class.php)delimiter(')operator(\))operator(;) + +comment(/*)comment(*) +comment( * Zip class) +comment( *) +comment( * @author Manni <manni@fnord.name>) +comment( * @copyright Copyright (c\) 2006, Manni) +comment( * @version 1.0) +comment( * @link http://www.pkware.com/business_and_developers/developer/popups/appnote.txt) +comment( * @link http://mannithedark.is-a-geek.net/) +comment( * @since 1.0) +comment( * @package fnord.bb) +comment( * @subpackage archive) +comment( )comment(*/) +pre_type(class) constant(Zip) pre_type(extends) constant(Archive) operator({) + comment(/*)comment(*) +comment( * Outputs the zip file) +comment( *) +comment( * This function creates the zip file with the dirs and files given.) +comment( * If the optional parameter $file is given, the zip file is will be) +comment( * saved at that location. Otherwise the function returns the zip file's content.) +comment( *) +comment( * @access public) +comment( *) +comment( * @link http://www.pkware.com/business_and_developers/developer/popups/appnote.txt) +comment( * @param string $filename The path where the zip file will be saved) +comment( *) +comment( * @return bool|string Returns either true if the fil is sucessfully created or the content of the zip file) +comment( )comment(*/) + pre_type(function) ident(out)operator(()local_variable($filename) operator(=) pre_type(false)operator(\)) operator({) + comment(// Empty output) + local_variable($file_data) operator(=) pre_type(array)operator(()operator(\))operator(;) comment(// Data of the file part) + local_variable($cd_data) operator(=) pre_type(array)operator(()operator(\))operator(;) comment(// Data of the central directory) + + comment(// Sort dirs and files by path length) + ident(uksort)operator(()local_variable($this)operator(->)ident(dirs)operator(,) delimiter(')string(sort_by_length)delimiter(')operator(\))operator(;) + ident(uksort)operator(()local_variable($this)operator(->)ident(files)operator(,) delimiter(')string(sort_by_length)delimiter(')operator(\))operator(;) + + comment(// Handle dirs) + reserved(foreach)operator(()local_variable($this)operator(->)ident(dirs) reserved(as) local_variable($dir)operator(\)) operator({) + local_variable($dir) operator(.)operator(=) delimiter(')string(/)delimiter(')operator(;) + comment(// File part) + + comment(// Reset dir data) + local_variable($dir_data) operator(=) delimiter(')delimiter(')operator(;) + + comment(// Local file header) + local_variable($dir_data) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x03)string(\\)string(x04)delimiter(")operator(;) comment(// Local file header signature) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(10)operator(\))operator(;) comment(// Version needed to extract) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// General purpose bit flag) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Compression method) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file time) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file date) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// crc-32) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Compressed size) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Uncompressed size) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(strlen)operator(()local_variable($dir)operator(\))operator(\))operator(;) comment(// File name length) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Extra field length) + + local_variable($dir_data) operator(.)operator(=) local_variable($dir)operator(;) comment(// File name) + local_variable($dir_data) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Extra field (is empty\)) + + comment(// File data) + local_variable($dir_data) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Dirs have no file data) + + comment(// Data descriptor) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// crc-32) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Compressed size) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Uncompressed size) + + comment(// Save current offset) + local_variable($offset) operator(=) ident(strlen)operator(()ident(implode)operator(()delimiter(')delimiter(')operator(,) local_variable($file_data)operator(\))operator(\))operator(;) + + comment(// Append dir data to the file part) + local_variable($file_data)operator([)operator(]) operator(=) local_variable($dir_data)operator(;) + + comment(// Central directory) + + comment(// Reset dir data) + local_variable($dir_data) operator(=) delimiter(')delimiter(')operator(;) + + comment(// File header) + local_variable($dir_data) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x01)string(\\)string(x02)delimiter(")operator(;) comment(// Local file header signature) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Version made by) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(10)operator(\))operator(;) comment(// Version needed to extract) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// General purpose bit flag) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Compression method) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file time) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file date) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// crc-32) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Compressed size) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Uncompressed size) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(strlen)operator(()local_variable($dir)operator(\))operator(\))operator(;) comment(// File name length) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Extra field length) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// File comment length) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Disk number start) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Internal file attributes) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(16)operator(\))operator(;) comment(// External file attributes) + local_variable($dir_data) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) local_variable($offset)operator(\))operator(;) comment(// Relative offset of local header) + + local_variable($dir_data) operator(.)operator(=) local_variable($dir)operator(;) comment(// File name) + local_variable($dir_data) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Extra field (is empty\)) + local_variable($dir_data) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// File comment (is empty\)) + + comment(/*) +comment( // Data descriptor) +comment( $dir_data .= pack("V", 0\); // crc-32) +comment( $dir_data .= pack("V", 0\); // Compressed size) +comment( $dir_data .= pack("V", 0\); // Uncompressed size) +comment( )comment(*/) + + comment(// Append dir data to the central directory data) + local_variable($cd_data)operator([)operator(]) operator(=) local_variable($dir_data)operator(;) + operator(}) + + comment(// Handle files) + reserved(foreach)operator(()local_variable($this)operator(->)ident(files) reserved(as) local_variable($name) operator(=>) local_variable($file)operator(\)) operator({) + comment(// Get values) + local_variable($content) operator(=) local_variable($file)operator([)integer(0)operator(])operator(;) + + comment(// File part) + + comment(// Reset file data) + local_variable($fd) operator(=) delimiter(')delimiter(')operator(;) + + comment(// Detect possible compressions) + comment(// Use deflate) + reserved(if)operator(()ident(function_exists)operator(()delimiter(')string(gzdeflate)delimiter(')operator(\))operator(\)) operator({) + local_variable($method) operator(=) integer(8)operator(;) + + comment(// Compress file content) + local_variable($compressed_data) operator(=) ident(gzdeflate)operator(()local_variable($content)operator(\))operator(;) + + comment(// Use bzip2) + operator(}) reserved(elseif)operator(()ident(function_exists)operator(()delimiter(')string(bzcompress)delimiter(')operator(\))operator(\)) operator({) + local_variable($method) operator(=) integer(12)operator(;) + + comment(// Compress file content) + local_variable($compressed_data) operator(=) ident(bzcompress)operator(()local_variable($content)operator(\))operator(;) + + comment(// No compression) + operator(}) reserved(else) operator({) + local_variable($method) operator(=) integer(0)operator(;) + + comment(// Do not compress the content :P) + local_variable($compressed_data) operator(=) local_variable($content)operator(;) + operator(}) + + comment(// Local file header) + local_variable($fd) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x03)string(\\)string(x04)delimiter(")operator(;) comment(// Local file header signature) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(20)operator(\))operator(;) comment(// Version needed to extract) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// General purpose bit flag) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) local_variable($method)operator(\))operator(;) comment(// Compression method) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file time) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file date) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(crc32)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// crc-32) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($compressed_data)operator(\))operator(\))operator(;) comment(// Compressed size) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// Uncompressed size) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(strlen)operator(()local_variable($name)operator(\))operator(\))operator(;) comment(// File name length) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Extra field length) + + local_variable($fd) operator(.)operator(=) local_variable($name)operator(;) comment(// File name) + local_variable($fd) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Extra field (is empty\)) + + comment(// File data) + local_variable($fd) operator(.)operator(=) local_variable($compressed_data)operator(;) + + comment(// Data descriptor) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(crc32)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// crc-32) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($compressed_data)operator(\))operator(\))operator(;) comment(// Compressed size) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// Uncompressed size) + + comment(// Save current offset) + local_variable($offset) operator(=) ident(strlen)operator(()ident(implode)operator(()delimiter(')delimiter(')operator(,) local_variable($file_data)operator(\))operator(\))operator(;) + + comment(// Append file data to the file part) + local_variable($file_data)operator([)operator(]) operator(=) local_variable($fd)operator(;) + + comment(// Central directory) + + comment(// Reset file data) + local_variable($fd) operator(=) delimiter(')delimiter(')operator(;) + + comment(// File header) + local_variable($fd) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x01)string(\\)string(x02)delimiter(")operator(;) comment(// Local file header signature) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Version made by) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(20)operator(\))operator(;) comment(// Version needed to extract) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// General purpose bit flag) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) local_variable($method)operator(\))operator(;) comment(// Compression method) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file time) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Last mod file date) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(crc32)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// crc-32) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($compressed_data)operator(\))operator(\))operator(;) comment(// Compressed size) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($content)operator(\))operator(\))operator(;) comment(// Uncompressed size) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(strlen)operator(()local_variable($name)operator(\))operator(\))operator(;) comment(// File name length) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Extra field length) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// File comment length) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Disk number start) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Internal file attributes) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) integer(32)operator(\))operator(;) comment(// External file attributes) + local_variable($fd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) local_variable($offset)operator(\))operator(;) comment(// Relative offset of local header) + + local_variable($fd) operator(.)operator(=) local_variable($name)operator(;) comment(// File name) + local_variable($fd) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Extra field (is empty\)) + local_variable($fd) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// File comment (is empty\)) + + comment(/*) +comment( // Data descriptor) +comment( $fd .= pack("V", crc32($content\)\); // crc-32) +comment( $fd .= pack("V", strlen($compressed_data\)\); // Compressed size) +comment( $fd .= pack("V", strlen($content\)\); // Uncompressed size) +comment( )comment(*/) + + comment(// Append file data to the central directory data) + local_variable($cd_data)operator([)operator(]) operator(=) local_variable($fd)operator(;) + operator(}) + + comment(// Digital signature) + local_variable($digital_signature) operator(=) delimiter(')delimiter(')operator(;) + local_variable($digital_signature) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x05)string(\\)string(x05)delimiter(")operator(;) comment(// Header signature) + local_variable($digital_signature) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Size of data) + local_variable($digital_signature) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// Signature data (is empty\)) + + local_variable($tmp_file_data) operator(=) ident(implode)operator(()delimiter(')delimiter(')operator(,) local_variable($file_data)operator(\))operator(;) comment(// File data) + local_variable($tmp_cd_data) operator(=) ident(implode)operator(()delimiter(')delimiter(')operator(,) local_variable($cd_data)operator(\))operator(.) comment(// Central directory) + local_variable($digital_signature)operator(;) comment(// Digital signature) + + comment(// End of central directory) + local_variable($eof_cd) operator(=) delimiter(')delimiter(')operator(;) + local_variable($eof_cd) operator(.)operator(=) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x05)string(\\)string(x06)delimiter(")operator(;) comment(// End of central dir signature) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Number of this disk) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// Number of the disk with the start of the central directory) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(count)operator(()local_variable($cd_data)operator(\))operator(\))operator(;) comment(// Total number of entries in the central directory on this disk) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) ident(count)operator(()local_variable($cd_data)operator(\))operator(\))operator(;) comment(// Total number of entries in the central directory) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($tmp_cd_data)operator(\))operator(\))operator(;) comment(// Size of the central directory) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(V)delimiter(")operator(,) ident(strlen)operator(()local_variable($tmp_file_data)operator(\))operator(\))operator(;) comment(// Offset of start of central directory with respect to the starting disk number) + local_variable($eof_cd) operator(.)operator(=) ident(pack)operator(()delimiter(")string(v)delimiter(")operator(,) integer(0)operator(\))operator(;) comment(// .ZIP file comment length) + local_variable($eof_cd) operator(.)operator(=) delimiter(')delimiter(')operator(;) comment(// .ZIP file comment (is empty\)) + + comment(// Content of the zip file) + local_variable($data) operator(=) local_variable($tmp_file_data)operator(.) + comment(// $extra_data_record.) + local_variable($tmp_cd_data)operator(.) + local_variable($eof_cd)operator(;) + + comment(// Return content?) + reserved(if)operator(()operator(!)local_variable($filename)operator(\)) + reserved(return) local_variable($data)operator(;) + + comment(// Write to file) + reserved(return) ident(file_put_contents)operator(()local_variable($filename)operator(,) local_variable($data)operator(\))operator(;) + operator(}) + + comment(/*)comment(*) +comment( * Load a zip file) +comment( *) +comment( * This function loads the files and dirs from a zip file from the harddrive.) +comment( *) +comment( * @access public) +comment( *) +comment( * @param string $file The path to the zip file) +comment( * @param bool $reset Reset the files and dirs before adding the zip file's content?) +comment( *) +comment( * @return bool Returns true if the file was loaded sucessfully) +comment( )comment(*/) + pre_type(function) ident(load_file)operator(()local_variable($file)operator(,) local_variable($reset) operator(=) pre_type(true)operator(\)) operator({) + comment(// Check whether the file exists) + reserved(if)operator(()operator(!)ident(file_exists)operator(()local_variable($file)operator(\))operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Load the files content) + local_variable($content) operator(=) operator(@)ident(file_get_contents)operator(()local_variable($file)operator(\))operator(;) + + comment(// Return false if the file cannot be opened) + reserved(if)operator(()operator(!)local_variable($content)operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Read the zip) + reserved(return) local_variable($this)operator(->)ident(load_string)operator(()local_variable($content)operator(,) local_variable($reset)operator(\))operator(;) + operator(}) + + comment(/*)comment(*) +comment( * Load a zip string) +comment( *) +comment( * This function loads the files and dirs from a string) +comment( *) +comment( * @access public) +comment( *) +comment( * @param string $string The string the zip is generated from) +comment( * @param bool $reset Reset the files and dirs before adding the zip file's content?) +comment( *) +comment( * @return bool Returns true if the string was loaded sucessfully) +comment( )comment(*/) + pre_type(function) ident(load_string)operator(()local_variable($string)operator(,) local_variable($reset) operator(=) pre_type(true)operator(\)) operator({) + comment(// Reset the zip?) + reserved(if)operator(()local_variable($reset)operator(\)) operator({) + local_variable($this)operator(->)ident(dirs) operator(=) pre_type(array)operator(()operator(\))operator(;) + local_variable($this)operator(->)ident(files) operator(=) pre_type(array)operator(()operator(\))operator(;) + operator(}) + + comment(// Get the starting position of the end of central directory record) + local_variable($start) operator(=) ident(strpos)operator(()local_variable($string)operator(,) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x05)string(\\)string(x06)delimiter(")operator(\))operator(;) + + comment(// Error) + reserved(if)operator(()local_variable($start) operator(===) pre_type(false)operator(\)) + reserved(die)operator(()delimiter(')string(Could not find the end of central directory record)delimiter(')operator(\))operator(;) + + comment(// Get the ecdr) + local_variable($eof_cd) operator(=) ident(substr)operator(()local_variable($string)operator(,) local_variable($start)operator(+)integer(4)operator(,) integer(18)operator(\))operator(;) + + comment(// Unpack the ecdr infos) + local_variable($eof_cd) operator(=) ident(unpack)operator(()delimiter(')string(vdisc1/)delimiter(')operator(.) + delimiter(')string(vdisc2/)delimiter(')operator(.) + delimiter(')string(ventries1/)delimiter(')operator(.) + delimiter(')string(ventries2/)delimiter(')operator(.) + delimiter(')string(Vsize/)delimiter(')operator(.) + delimiter(')string(Voffset/)delimiter(')operator(.) + delimiter(')string(vcomment_lenght)delimiter(')operator(,) local_variable($eof_cd)operator(\))operator(;) + + comment(// Do not allow multi disc zips) + reserved(if)operator(()local_variable($eof_cd)operator([)delimiter(')string(disc1)delimiter(')operator(]) operator(!=) integer(0)operator(\)) + reserved(die)operator(()delimiter(')string(multi disk stuff is not yet implemented :/)delimiter(')operator(\))operator(;) + + comment(// Save the interesting values) + local_variable($cd_entries) operator(=) local_variable($eof_cd)operator([)delimiter(')string(entries1)delimiter(')operator(])operator(;) + local_variable($cd_size) operator(=) local_variable($eof_cd)operator([)delimiter(')string(size)delimiter(')operator(])operator(;) + local_variable($cd_offset) operator(=) local_variable($eof_cd)operator([)delimiter(')string(offset)delimiter(')operator(])operator(;) + + comment(// Get the central directory record) + local_variable($cdr) operator(=) ident(substr)operator(()local_variable($string)operator(,) local_variable($cd_offset)operator(,) local_variable($cd_size)operator(\))operator(;) + + comment(// Reset the position and the list of the entries) + local_variable($pos) operator(=) integer(0)operator(;) + local_variable($entries) operator(=) pre_type(array)operator(()operator(\))operator(;) + + comment(// Handle cdr) + reserved(while)operator(()local_variable($pos) operator(<) ident(strlen)operator(()local_variable($cdr)operator(\))operator(\)) operator({) + comment(// Check header signature) + comment(// Digital signature) + reserved(if)operator(()ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos)operator(,) integer(4)operator(\)) operator(==) delimiter(")string(\\)string(x50)string(\\)string(x4b)string(\\)string(x05)string(\\)string(x05)delimiter(")operator(\)) operator({) + comment(// Get digital signature size) + local_variable($tmp_info) operator(=) ident(unpack)operator(()delimiter(')string(vsize)delimiter(')operator(,) ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos) operator(+) integer(4)operator(,) integer(2)operator(\))operator(\))operator(;) + + comment(// Read out the digital signature) + local_variable($digital_sig) operator(=) ident(substr)operator(()local_variable($header)operator(,) local_variable($pos) operator(+) integer(6)operator(,) local_variable($tmp_info)operator([)delimiter(')string(size)delimiter(')operator(])operator(\))operator(;) + + reserved(break)operator(;) + operator(}) + + comment(// Get file header) + local_variable($header) operator(=) ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos)operator(,) integer(46)operator(\))operator(;) + + comment(// Unpack the header information) + local_variable($header_info) operator(=) operator(@)ident(unpack)operator(()delimiter(')string(Vheader/)delimiter(')operator(.) + delimiter(')string(vversion_made_by/)delimiter(')operator(.) + delimiter(')string(vversion_needed/)delimiter(')operator(.) + delimiter(')string(vgeneral_purpose/)delimiter(')operator(.) + delimiter(')string(vcompression_method/)delimiter(')operator(.) + delimiter(')string(vlast_mod_time/)delimiter(')operator(.) + delimiter(')string(vlast_mod_date/)delimiter(')operator(.) + delimiter(')string(Vcrc32/)delimiter(')operator(.) + delimiter(')string(Vcompressed_size/)delimiter(')operator(.) + delimiter(')string(Vuncompressed_size/)delimiter(')operator(.) + delimiter(')string(vname_length/)delimiter(')operator(.) + delimiter(')string(vextra_length/)delimiter(')operator(.) + delimiter(')string(vcomment_length/)delimiter(')operator(.) + delimiter(')string(vdisk_number/)delimiter(')operator(.) + delimiter(')string(vinternal_attributes/)delimiter(')operator(.) + delimiter(')string(Vexternal_attributes/)delimiter(')operator(.) + delimiter(')string(Voffset)delimiter(')operator(,) + local_variable($header)operator(\))operator(;) + + comment(// Valid header?) + reserved(if)operator(()local_variable($header_info)operator([)delimiter(')string(header)delimiter(')operator(]) operator(!=) integer(33639248)operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// New position) + local_variable($pos) operator(+)operator(=) integer(46)operator(;) + + comment(// Read out the file name) + local_variable($header_info)operator([)delimiter(')string(name)delimiter(')operator(]) operator(=) ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos)operator(,) local_variable($header_info)operator([)delimiter(')string(name_length)delimiter(')operator(])operator(\))operator(;) + + comment(// New position) + local_variable($pos) operator(+)operator(=) local_variable($header_info)operator([)delimiter(')string(name_length)delimiter(')operator(])operator(;) + + comment(// Read out the extra stuff) + local_variable($header_info)operator([)delimiter(')string(extra)delimiter(')operator(]) operator(=) ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos)operator(,) local_variable($header_info)operator([)delimiter(')string(extra_length)delimiter(')operator(])operator(\))operator(;) + + comment(// New position) + local_variable($pos) operator(+)operator(=) local_variable($header_info)operator([)delimiter(')string(extra_length)delimiter(')operator(])operator(;) + + comment(// Read out the comment) + local_variable($header_info)operator([)delimiter(')string(comment)delimiter(')operator(]) operator(=) ident(substr)operator(()local_variable($cdr)operator(,) local_variable($pos)operator(,) local_variable($header_info)operator([)delimiter(')string(comment_length)delimiter(')operator(])operator(\))operator(;) + + comment(// New position) + local_variable($pos) operator(+)operator(=) local_variable($header_info)operator([)delimiter(')string(comment_length)delimiter(')operator(])operator(;) + + comment(// Append this file/dir to the entry list) + local_variable($entries)operator([)operator(]) operator(=) local_variable($header_info)operator(;) + operator(}) + + comment(// Check whether all entries where read sucessfully) + reserved(if)operator(()ident(count)operator(()local_variable($entries)operator(\)) operator(!=) local_variable($cd_entries)operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Handle files/dirs) + reserved(foreach)operator(()local_variable($entries) reserved(as) local_variable($entry)operator(\)) operator({) + comment(// Is a dir?) + reserved(if)operator(()local_variable($entry)operator([)delimiter(')string(external_attributes)delimiter(')operator(]) operator(&) integer(16)operator(\)) operator({) + local_variable($this)operator(->)ident(add_dir)operator(()local_variable($entry)operator([)delimiter(')string(name)delimiter(')operator(])operator(\))operator(;) + reserved(continue)operator(;) + operator(}) + + comment(// Get local file header) + local_variable($header) operator(=) ident(substr)operator(()local_variable($string)operator(,) local_variable($entry)operator([)delimiter(')string(offset)delimiter(')operator(])operator(,) integer(30)operator(\))operator(;) + + comment(// Unpack the header information) + local_variable($header_info) operator(=) operator(@)ident(unpack)operator(()delimiter(')string(Vheader/)delimiter(')operator(.) + delimiter(')string(vversion_needed/)delimiter(')operator(.) + delimiter(')string(vgeneral_purpose/)delimiter(')operator(.) + delimiter(')string(vcompression_method/)delimiter(')operator(.) + delimiter(')string(vlast_mod_time/)delimiter(')operator(.) + delimiter(')string(vlast_mod_date/)delimiter(')operator(.) + delimiter(')string(Vcrc32/)delimiter(')operator(.) + delimiter(')string(Vcompressed_size/)delimiter(')operator(.) + delimiter(')string(Vuncompressed_size/)delimiter(')operator(.) + delimiter(')string(vname_length/)delimiter(')operator(.) + delimiter(')string(vextra_length)delimiter(')operator(,) + local_variable($header)operator(\))operator(;) + + comment(// Valid header?) + reserved(if)operator(()local_variable($header_info)operator([)delimiter(')string(header)delimiter(')operator(]) operator(!=) integer(67324752)operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Get content start position) + local_variable($start) operator(=) local_variable($entry)operator([)delimiter(')string(offset)delimiter(')operator(]) operator(+) integer(30) operator(+) local_variable($header_info)operator([)delimiter(')string(name_length)delimiter(')operator(]) operator(+) local_variable($header_info)operator([)delimiter(')string(extra_length)delimiter(')operator(])operator(;) + + comment(// Get the compressed data) + local_variable($data) operator(=) ident(substr)operator(()local_variable($string)operator(,) local_variable($start)operator(,) local_variable($header_info)operator([)delimiter(')string(compressed_size)delimiter(')operator(])operator(\))operator(;) + + comment(// Detect compression type) + reserved(switch)operator(()local_variable($header_info)operator([)delimiter(')string(compression_method)delimiter(')operator(])operator(\)) operator({) + comment(// No compression) + reserved(case) integer(0)operator(:) + comment(// Ne decompression needed) + local_variable($content) operator(=) local_variable($data)operator(;) + reserved(break)operator(;) + + comment(// Gzip) + reserved(case) integer(8)operator(:) + reserved(if)operator(()operator(!)ident(function_exists)operator(()delimiter(')string(gzinflate)delimiter(')operator(\))operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Uncompress data) + local_variable($content) operator(=) ident(gzinflate)operator(()local_variable($data)operator(\))operator(;) + reserved(break)operator(;) + + comment(// Bzip2) + reserved(case) integer(12)operator(:) + reserved(if)operator(()operator(!)ident(function_exists)operator(()delimiter(')string(bzdecompress)delimiter(')operator(\))operator(\)) + reserved(return) pre_type(false)operator(;) + + comment(// Decompress data) + local_variable($content) operator(=) ident(bzdecompress)operator(()local_variable($data)operator(\))operator(;) + reserved(break)operator(;) + + comment(// Compression not supported -> error) + reserved(default)operator(:) + reserved(return) pre_type(false)operator(;) + operator(}) + + comment(// Try to add file) + reserved(if)operator(()operator(!)local_variable($this)operator(->)ident(add_file)operator(()local_variable($entry)operator([)delimiter(')string(name)delimiter(')operator(])operator(,) local_variable($content)operator(\))operator(\)) + reserved(return) pre_type(false)operator(;) + operator(}) + + reserved(return) pre_type(true)operator(;) + operator(}) +operator(}) + +pre_type(function) operator(&)ident(byref)operator(()operator(\)) operator({) + local_variable($x) operator(=) pre_type(array)operator(()operator(\))operator(;) + reserved(return) local_variable($x)operator(;) +operator(}) +delimiter(?>) |