#!/usr/bin/php -dphar.readonly=1 2, 'c' => 'text/plain', 'cc' => 'text/plain', 'cpp' => 'text/plain', 'c++' => 'text/plain', 'dtd' => 'text/plain', 'h' => 'text/plain', 'log' => 'text/plain', 'rng' => 'text/plain', 'txt' => 'text/plain', 'xsd' => 'text/plain', 'php' => 1, 'inc' => 1, 'avi' => 'video/avi', 'bmp' => 'image/bmp', 'css' => 'text/css', 'gif' => 'image/gif', 'htm' => 'text/html', 'html' => 'text/html', 'htmls' => 'text/html', 'ico' => 'image/x-ico', 'jpe' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'js' => 'application/x-javascript', 'midi' => 'audio/midi', 'mid' => 'audio/midi', 'mod' => 'audio/mod', 'mov' => 'movie/quicktime', 'mp3' => 'audio/mp3', 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'pdf' => 'application/pdf', 'png' => 'image/png', 'swf' => 'application/shockwave-flash', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wav' => 'audio/wav', 'xbm' => 'image/xbm', 'xml' => 'text/xml', ); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); $basename = basename(__FILE__); if (!strpos($_SERVER['REQUEST_URI'], $basename)) { chdir(Extract_Phar::$temp); include $web; return; } $pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename)); if (!$pt || $pt == '/') { $pt = $web; header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt); exit; } $a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt); if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) { header('HTTP/1.0 404 Not Found'); echo "\n \n File Not Found<title>\n </head>\n <body>\n <h1>404 - File ", $pt, " Not Found</h1>\n </body>\n</html>"; exit; } $b = pathinfo($a); if (!isset($b['extension'])) { header('Content-Type: text/plain'); header('Content-Length: ' . filesize($a)); readfile($a); exit; } if (isset($mimes[$b['extension']])) { if ($mimes[$b['extension']] === 1) { include $a; exit; } if ($mimes[$b['extension']] === 2) { highlight_file($a); exit; } header('Content-Type: ' .$mimes[$b['extension']]); header('Content-Length: ' . filesize($a)); readfile($a); exit; } } class Extract_Phar { static $temp; static $origdir; const GZ = 0x1000; const BZ2 = 0x2000; const MASK = 0x3000; const START = 'pharext_installer.php'; const LEN = 6697; static function go($return = false) { $fp = fopen(__FILE__, 'rb'); fseek($fp, self::LEN); $L = unpack('V', $a = (binary)fread($fp, 4)); $m = (binary)''; do { $read = 8192; if ($L[1] - strlen($m) < 8192) { $read = $L[1] - strlen($m); } $last = (binary)fread($fp, $read); $m .= $last; } while (strlen($last) && strlen($m) < $L[1]); if (strlen($m) < $L[1]) { die('ERROR: manifest length read was "' . strlen($m) .'" should be "' . $L[1] . '"'); } $info = self::_unpack($m); $f = $info['c']; if ($f & self::GZ) { if (!function_exists('gzinflate')) { die('Error: zlib extension is not enabled -' . ' gzinflate() function needed for zlib-compressed .phars'); } } if ($f & self::BZ2) { if (!function_exists('bzdecompress')) { die('Error: bzip2 extension is not enabled -' . ' bzdecompress() function needed for bz2-compressed .phars'); } } $temp = self::tmpdir(); if (!$temp || !is_writable($temp)) { $sessionpath = session_save_path(); if (strpos ($sessionpath, ";") !== false) $sessionpath = substr ($sessionpath, strpos ($sessionpath, ";")+1); if (!file_exists($sessionpath) || !is_dir($sessionpath)) { die('Could not locate temporary directory to extract phar'); } $temp = $sessionpath; } $temp .= '/pharextract/'.basename(__FILE__, '.phar'); self::$temp = $temp; self::$origdir = getcwd(); @mkdir($temp, 0777, true); $temp = realpath($temp); if (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) { self::_removeTmpFiles($temp, getcwd()); @mkdir($temp, 0777, true); @file_put_contents($temp . '/' . md5_file(__FILE__), ''); foreach ($info['m'] as $path => $file) { $a = !file_exists(dirname($temp . '/' . $path)); @mkdir(dirname($temp . '/' . $path), 0777, true); clearstatcache(); if ($path[strlen($path) - 1] == '/') { @mkdir($temp . '/' . $path, 0777); } else { file_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp)); @chmod($temp . '/' . $path, 0666); } } } chdir($temp); if (!$return) { include self::START; } } static function tmpdir() { if (strpos(PHP_OS, 'WIN') !== false) { if ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) { return $var; } if (is_dir('/temp') || mkdir('/temp')) { return realpath('/temp'); } return false; } if ($var = getenv('TMPDIR')) { return $var; } return realpath('/tmp'); } static function _unpack($m) { $info = unpack('V', substr($m, 0, 4)); $l = unpack('V', substr($m, 10, 4)); $m = substr($m, 14 + $l[1]); $s = unpack('V', substr($m, 0, 4)); $o = 0; $start = 4 + $s[1]; $ret['c'] = 0; for ($i = 0; $i < $info[1]; $i++) { $len = unpack('V', substr($m, $start, 4)); $start += 4; $savepath = substr($m, $start, $len[1]); $start += $len[1]; $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24))); $ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3] & 0xffffffff); $ret['m'][$savepath][7] = $o; $o += $ret['m'][$savepath][2]; $start += 24 + $ret['m'][$savepath][5]; $ret['c'] |= $ret['m'][$savepath][4] & self::MASK; } return $ret; } static function extractFile($path, $entry, $fp) { $data = ''; $c = $entry[2]; while ($c) { if ($c < 8192) { $data .= @fread($fp, $c); $c = 0; } else { $c -= 8192; $data .= @fread($fp, 8192); } } if ($entry[4] & self::GZ) { $data = gzinflate($data); } elseif ($entry[4] & self::BZ2) { $data = bzdecompress($data); } if (strlen($data) != $entry[0]) { die("Invalid internal .phar file (size error " . strlen($data) . " != " . $stat[7] . ")"); } if ($entry[3] != sprintf("%u", crc32((binary)$data) & 0xffffffff)) { die("Invalid internal .phar file (checksum error)"); } return $data; } static function _removeTmpFiles($temp, $origdir) { chdir($temp); foreach (glob('*') as $f) { if (file_exists($f)) { is_dir($f) ? @rmdir($f) : @unlink($f); if (file_exists($f) && is_dir($f)) { self::_removeTmpFiles($f, getcwd()); } } } @rmdir($temp); clearstatcache(); chdir($origdir); } } Extract_Phar::go(); __HALT_COMPILER(); ?> ��3�����������Q��a:8:{s:7:"version";s:5:"4.0.0";s:6:"header";s:49:"pharext v4.0.0 (c) Michael Wallner <mike@php.net>";s:4:"date";s:10:"2015-08-07";s:4:"name";s:6:"propro";s:7:"release";s:5:"phpng";s:7:"license";s:1345:"Copyright (c) 2013, Michael Wallner <mike@php.net>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ";s:4:"stub";s:21:"pharext_installer.php";s:4:"type";s:9:"extension";}���pharext/Cli/Args/Help.php��\ U��!'���������pharext/Cli/Args.php��\ U�� 7���������pharext/Cli/Command.php+ ��\ U+ ��trq���������pharext/Command.php��\ U��td\���������pharext/Exception.phpc��\ Uc��U{���������pharext/ExecCmd.php��\ U��lʶ���������pharext/Installer.php��\ U��XҰ���������pharext/License.php��\ U��E���������pharext/Metadata.php��\ U��a���������pharext/Openssl/PrivateKey.php��\ U��&P���������pharext/Packager.php!��\ U!�����������pharext/SourceDir/Basic.phpz��\ Uz��+���������pharext/SourceDir/Git.phpZ��\ UZ��\���������pharext/SourceDir/Pecl.php��\ U��ж���������pharext/SourceDir.php��\ U��3#���������pharext/Task/Activate.php ��\ U ��I���������pharext/Task/Askpass.phpU��\ UU��*������ ���pharext/Task/BundleGenerator.php}��\ U}�� `Y���������pharext/Task/Cleanup.php��\ U��IB���������pharext/Task/Configure.phpT��\ UT��}���������pharext/Task/Extract.php��\ U��ն���������pharext/Task/GitClone.phpm��\ Um��y@���������pharext/Task/Make.php��\ U��6 ���������pharext/Task/PaxFixup.php��\ U��y���������pharext/Task/PeclFixup.php��\ U��et���������pharext/Task/PharBuild.php��\ U��D垶���������pharext/Task/PharCompress.phpr��\ Ur�� ���������pharext/Task/PharRename.php��\ U��[˶���������pharext/Task/PharSign.php��\ U��ۺi���������pharext/Task/Phpize.php��\ U�� 2Ѷ���������pharext/Task/StreamFetch.php��\ U��s\���������pharext/Task.phpw���\ Uw��� IǶ���������pharext/Tempdir.php��\ U��,���������pharext/Tempfile.php��\ U������������pharext/Tempname.php`��\ U`��<Np���������pharext_installer.php���\ U���pDZ���������pharext_packager.php���\ U���1������ ���.gitignore���\ U���wg���������.libs/php_propro.o��\ U��ZԪ ������ ���config.m4 ��\ U ��`)������ ���config.w32���\ U���5���������CREDITS���\ U���uBζ���������Doxyfilea*��\ Ua*��d���������LICENSEA��\ UA��J������ ���package.xml��\ U��Z*zG������ ���php_propro.c,8��\ U,8��lZ������ ���php_propro.h��\ U��۶������ ���README.md��\ U��>ȆK���������tests/001.phpt9��\ U9��2սA���������tests/002.phpt8��\ U8��L���������tests/003.phpt��\ U��U8������<?php namespace pharext\Cli\Args; use pharext\Cli\Args; class Help { private $args; function __construct($prog, Args $args) { $this->prog = $prog; $this->args = $args; } function __toString() { $usage = "Usage:\n\n \$ "; $usage .= $this->prog; list($flags, $required, $optional) = $this->listSpec(); if ($flags) { $usage .= $this->dumpFlags($flags); } if ($required) { $usage .= $this->dumpRequired($required); } if ($optional) { $usage .= $this->dumpOptional($optional); } $help = $this->dumpHelp(); return $usage . "\n\n" . $help . "\n"; } function listSpec() { $flags = []; $required = []; $optional = []; foreach ($this->args->getSpec() as $spec) { if ($spec[3] & Args::REQARG) { if ($spec[3] & Args::REQUIRED) { $required[] = $spec; } else { $optional[] = $spec; } } else { $flags[] = $spec; } } return [$flags, $required, $optional] + compact("flags", "required", "optional"); } function dumpFlags(array $flags) { return sprintf(" [-%s]", implode("", array_column($flags, 0))); } function dumpRequired(array $required) { $dump = ""; foreach ($required as $req) { $dump .= sprintf(" -%s <%s>", $req[0], $req[1]); } return $dump; } function dumpOptional(array $optional) { return sprintf(" [-%s <arg>]", implode("|-", array_column($optional, 0))); } function calcMaxLen() { $spc = $this->args->getSpec(); $max = max(array_map("strlen", array_column($spc, 1))); $max += $max % 8 + 2; return $max; } function dumpHelp() { $max = $this->calcMaxLen(); $dump = ""; foreach ($this->args->getSpec() as $spec) { $dump .= " "; if (isset($spec[0])) { $dump .= sprintf("-%s|", $spec[0]); } $dump .= sprintf("--%s ", $spec[1]); if ($spec[3] & Args::REQARG) { $dump .= "<arg> "; } elseif ($spec[3] & Args::OPTARG) { $dump .= "[<arg>]"; } else { $dump .= " "; } $dump .= str_repeat(" ", $max-strlen($spec[1])+3*!isset($spec[0])); $dump .= $spec[2]; if ($spec[3] & Args::REQUIRED) { $dump .= " (REQUIRED)"; } if (isset($spec[4])) { $dump .= sprintf(" [%s]", $spec[4]); } $dump .= "\n"; } return $dump; } } <?php namespace pharext\Cli; /** * Command line arguments */ class Args implements \ArrayAccess { /** * Optional option */ const OPTIONAL = 0x000; /** * Required Option */ const REQUIRED = 0x001; /** * Only one value, even when used multiple times */ const SINGLE = 0x000; /** * Aggregate an array, when used multiple times */ const MULTI = 0x010; /** * Option takes no argument */ const NOARG = 0x000; /** * Option requires an argument */ const REQARG = 0x100; /** * Option takes an optional argument */ const OPTARG = 0x200; /** * Option halts processing */ const HALT = 0x10000000; /** * Original option spec * @var array */ private $orig = []; /** * Compiled spec * @var array */ private $spec = []; /** * Parsed args * @var array */ private $args = []; /** * Compile the original spec * @param array|Traversable $spec */ public function __construct($spec = null) { if (is_array($spec) || $spec instanceof Traversable) { $this->compile($spec); } } /** * Compile the original spec * @param array|Traversable $spec * @return pharext\CliArgs self */ public function compile($spec) { foreach ($spec as $arg) { if (isset($arg[0])) { $this->spec["-".$arg[0]] = $arg; } $this->spec["--".$arg[1]] = $arg; $this->orig[] = $arg; } return $this; } /** * Get original spec * @return array */ public function getSpec() { return $this->orig; } /** * Get compiled spec * @return array */ public function getCompiledSpec() { return $this->spec; } /** * Parse command line arguments according to the compiled spec. * * The Generator yields any parsing errors. * Parsing will stop when all arguments are processed or the first option * flagged CliArgs::HALT was encountered. * * @param int $argc * @param array $argv * @return Generator */ public function parse($argc, array $argv) { for ($i = 0; $i < $argc; ++$i) { $o = $argv[$i]; if ($o{0} === '-' && strlen($o) > 2 && $o{1} !== '-') { // multiple short opts, .e.g -vps $argc += strlen($o) - 2; array_splice($argv, $i, 1, array_map(function($s) { return "-$s"; }, str_split(substr($o, 1)))); $o = $argv[$i]; } elseif ($o{0} === '-' && strlen($o) > 2 && $o{1} === '-' && 0 < ($eq = strpos($o, "="))) { $argc++; array_splice($argv, $i, 1, [ substr($o, 0, $eq++), substr($o, $eq) ]); $o = $argv[$i]; } if (!isset($this->spec[$o])) { yield sprintf("Unknown option %s", $o); } elseif (!$this->optAcceptsArg($o)) { $this[$o] = true; } elseif ($i+1 < $argc && !isset($this->spec[$argv[$i+1]])) { $this[$o] = $argv[++$i]; } elseif ($this->optRequiresArg($o)) { yield sprintf("Option --%s requires an argument", $this->optLongName($o)); } else { // OPTARG $this[$o] = $this->optDefaultArg($o); } if ($this->optHalts($o)) { return; } } } /** * Validate that all required options were given. * * The Generator yields any validation errors. * * @return Generator */ public function validate() { $required = array_filter($this->orig, function($spec) { return $spec[3] & self::REQUIRED; }); foreach ($required as $req) { if (!strlen($this[$req[0]])) { yield sprintf("Option --%s is required", $req[1]); } } } public function toArray() { $args = []; foreach ($this->spec as $spec) { $opt = $this->opt($spec[1]); $args[$opt] = $this[$opt]; } return $args; } /** * Retreive the default argument of an option * @param string $o * @return mixed */ private function optDefaultArg($o) { $o = $this->opt($o); if (isset($this->spec[$o][4])) { return $this->spec[$o][4]; } return null; } /** * Retrieve the help message of an option * @param string $o * @return string */ private function optHelp($o) { $o = $this->opt($o); if (isset($this->spec[$o][2])) { return $this->spec[$o][2]; } return ""; } /** * Retrieve option's flags * @param string $o * @return int */ private function optFlags($o) { $o = $this->opt($o); if (isset($this->spec[$o])) { return $this->spec[$o][3]; } return null; } /** * Check whether an option is flagged for halting argument processing * @param string $o * @return boolean */ private function optHalts($o) { return $this->optFlags($o) & self::HALT; } /** * Check whether an option needs an argument * @param string $o * @return boolean */ private function optRequiresArg($o) { return $this->optFlags($o) & self::REQARG; } /** * Check wether an option accepts any argument * @param string $o * @return boolean */ private function optAcceptsArg($o) { return $this->optFlags($o) & 0xf00; } /** * Check whether an option can be used more than once * @param string $o * @return boolean */ private function optIsMulti($o) { return $this->optFlags($o) & self::MULTI; } /** * Retreive the long name of an option * @param string $o * @return string */ private function optLongName($o) { $o = $this->opt($o); return $this->spec[$o][1]; } /** * Retreive the short name of an option * @param string $o * @return string */ private function optShortName($o) { $o = $this->opt($o); return $this->spec[$o][0]; } /** * Retreive the canonical name (--long-name) of an option * @param string $o * @return string */ private function opt($o) { if ($o{0} !== '-') { if (strlen($o) > 1) { $o = "-$o"; } $o = "-$o"; } return $o; } /**@+ * Implements ArrayAccess and virtual properties */ function offsetExists($o) { $o = $this->opt($o); return isset($this->args[$o]); } function __isset($o) { return $this->offsetExists($o); } function offsetGet($o) { $o = $this->opt($o); if (isset($this->args[$o])) { return $this->args[$o]; } return $this->optDefaultArg($o); } function __get($o) { return $this->offsetGet($o); } function offsetSet($o, $v) { $osn = $this->optShortName($o); $oln = $this->optLongName($o); if ($this->optIsMulti($o)) { if (isset($osn)) { $this->args["-$osn"][] = $v; } $this->args["--$oln"][] = $v; } else { if (isset($osn)) { $this->args["-$osn"] = $v; } $this->args["--$oln"] = $v; } } function __set($o, $v) { $this->offsetSet($o, $v); } function offsetUnset($o) { unset($this->args["-".$this->optShortName($o)]); unset($this->args["--".$this->optLongName($o)]); } function __unset($o) { $this->offsetUnset($o); } /**@-*/ } <?php namespace pharext\Cli; use pharext\Cli\Args as CliArgs; use Phar; if (!function_exists("array_column")) { function array_column(array $array, $col, $idx = null) { $result = []; foreach ($array as $el) { if (isset($idx)) { $result[$el[$idx]] = $el[$col]; } else { $result[] = $el[$col]; } } return $result; } } trait Command { /** * Command line arguments * @var pharext\CliArgs */ private $args; /** * @inheritdoc * @see \pharext\Command::getArgs() */ public function getArgs() { return $this->args; } /** * Retrieve metadata of the currently running phar * @param string $key * @return mixed */ public function metadata($key = null) { $running = new Phar(Phar::running(false)); if ($key === "signature") { $sig = $running->getSignature(); return sprintf("%s signature of %s\n%s", $sig["hash_type"], $this->metadata("name"), chunk_split($sig["hash"], 64, "\n")); } $metadata = $running->getMetadata(); if (isset($key)) { return $metadata[$key]; } return $metadata; } /** * Output pharext vX.Y.Z header */ public function header() { if (!headers_sent()) { /* only display header, if we didn't generate any output yet */ printf("%s\n\n", $this->metadata("header")); } } /** * @inheritdoc * @see \pharext\Command::debug() */ public function debug($fmt) { if ($this->args->verbose) { vprintf($fmt, array_slice(func_get_args(), 1)); } } /** * @inheritdoc * @see \pharext\Command::info() */ public function info($fmt) { if (!$this->args->quiet) { vprintf($fmt, array_slice(func_get_args(), 1)); } } /** * @inheritdoc * @see \pharext\Command::warn() */ public function warn($fmt) { if (!$this->args->quiet) { if (!isset($fmt)) { $fmt = "%s\n"; $arg = error_get_last()["message"]; } else { $arg = array_slice(func_get_args(), 1); } vfprintf(STDERR, "Warning: $fmt", $arg); } } /** * @inheritdoc * @see \pharext\Command::error() */ public function error($fmt) { if (!isset($fmt)) { $fmt = "%s\n"; $arg = error_get_last()["message"]; } else { $arg = array_slice(func_get_args(), 1); } vfprintf(STDERR, "ERROR: $fmt", $arg); } /** * Output command line help message * @param string $prog */ public function help($prog) { print new Args\Help($prog, $this->args); } /** * Verbosity * @return boolean */ public function verbosity() { if ($this->args->verbose) { return true; } elseif ($this->args->quiet) { return false; } else { return null; } } } <?php namespace pharext; /** * Command interface */ interface Command { /** * Argument error */ const EARGS = 1; /** * Build error */ const EBUILD = 2; /** * Signature error */ const ESIGN = 3; /** * Extract/unpack error */ const EEXTRACT = 4; /** * Install error */ const EINSTALL = 5; /** * Retrieve command line arguments * @return pharext\CliArgs */ public function getArgs(); /** * Print debug message * @param string $fmt * @param string ...$args */ public function debug($fmt); /** * Print info * @param string $fmt * @param string ...$args */ public function info($fmt); /** * Print warning * @param string $fmt * @param string ...$args */ public function warn($fmt); /** * Print error * @param string $fmt * @param string ...$args */ public function error($fmt); /** * Execute the command * @param int $argc command line argument count * @param array $argv command line argument list */ public function run($argc, array $argv); } <?php namespace pharext; class Exception extends \Exception { public function __construct($message = null, $code = 0, $previous = null) { if (!isset($message)) { $last_error = error_get_last(); $message = $last_error["message"]; if (!$code) { $code = $last_error["type"]; } } parent::__construct($message, $code, $previous); } } <?php namespace pharext; /** * Execute system command */ class ExecCmd { /** * Sudo command, if the cmd needs escalated privileges * @var string */ private $sudo; /** * Executable of the cmd * @var string */ private $command; /** * Passthrough cmd output * @var bool */ private $verbose; /** * Output of cmd run * @var string */ private $output; /** * Return code of cmd run * @var int */ private $status; /** * @param string $command * @param bool verbose */ public function __construct($command, $verbose = false) { $this->command = $command; $this->verbose = $verbose; } /** * (Re-)set sudo command * @param string $sudo */ public function setSu($sudo = false) { $this->sudo = $sudo; } /** * Execute a program with escalated privileges handling interactive password prompt * @param string $command * @param bool $verbose * @return int exit status */ private function suExec($command, $verbose = null) { if (!($proc = proc_open($command, [STDIN,["pipe","w"],["pipe","w"]], $pipes))) { $this->status = -1; throw new Exception("Failed to run {$command}"); } $stdout = $pipes[1]; $passwd = 0; $checks = 10; while (!feof($stdout)) { $R = [$stdout]; $W = []; $E = []; if (!stream_select($R, $W, $E, null)) { continue; } $data = fread($stdout, 0x1000); /* only check a few times */ if ($passwd < $checks) { $passwd++; if (stristr($data, "password")) { $passwd = $checks + 1; printf("\n%s", $data); continue; } } elseif ($passwd > $checks) { /* new line after pw entry */ printf("\n"); $passwd = $checks; } if ($verbose === null) { print $this->progress($data, 0); } else { if ($verbose) { printf("%s", $data); } $this->output .= $data; } } if ($verbose === null) { $this->progress("", PHP_OUTPUT_HANDLER_FINAL); } return $this->status = proc_close($proc); } /** * Output handler that displays some progress while soaking output * @param string $string * @param int $flags * @return string */ private function progress($string, $flags) { static $counter = 0; static $symbols = ["\\","|","/","-"]; $this->output .= $string; if (false !== strpos($string, "\n")) { ++$counter; } return $flags & PHP_OUTPUT_HANDLER_FINAL ? " \r" : sprintf(" %s\r", $symbols[$counter % 4]); } /** * Run the command * @param array $args * @return \pharext\ExecCmd self * @throws \pharext\Exception */ public function run(array $args = null) { $exec = escapeshellcmd($this->command); if ($args) { $exec .= " ". implode(" ", array_map("escapeshellarg", (array) $args)); } if ($this->sudo) { $this->suExec(sprintf($this->sudo." 2>&1", $exec), $this->verbose); } elseif ($this->verbose) { ob_start(function($s) { $this->output .= $s; return $s; }, 1); passthru($exec, $this->status); ob_end_flush(); } elseif ($this->verbose !== false /* !quiet */) { ob_start([$this, "progress"], 1); passthru($exec . " 2>&1", $this->status); ob_end_flush(); } else { exec($exec ." 2>&1", $output, $this->status); $this->output = implode("\n", $output); } if ($this->status) { throw new Exception("Command {$exec} failed ({$this->status})"); } return $this; } /** * Retrieve exit code of cmd run * @return int */ public function getStatus() { return $this->status; } /** * Retrieve output of cmd run * @return string */ public function getOutput() { return $this->output; } } <?php namespace pharext; use pharext\Cli\Args as CliArgs; use pharext\Cli\Command as CliCommand; use Phar; use SplObjectStorage; /** * The extension install command executed by the extension phar */ class Installer implements Command { use CliCommand; /** * Cleanups * @var array */ private $cleanup = []; /** * Create the command */ public function __construct() { $this->args = new CliArgs([ ["h", "help", "Display help", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], ["v", "verbose", "More output", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["q", "quiet", "Less output", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["p", "prefix", "PHP installation prefix if phpize is not in \$PATH, e.g. /opt/php7", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], ["n", "common-name", "PHP common program name, e.g. php5 or zts-php", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, "php"], ["c", "configure", "Additional extension configure flags, e.g. -c --with-flag", CliArgs::OPTIONAL|CliArgs::MULTI|CliArgs::REQARG], ["s", "sudo", "Installation might need increased privileges", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::OPTARG, "sudo -S %s"], ["i", "ini", "Activate in this php.ini instead of loaded default php.ini", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], [null, "signature", "Show package signature", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "license", "Show package license", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "name", "Show package name", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "date", "Show package release date", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "release", "Show package release version", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "version", "Show pharext version", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], ]); } /** * Perform cleaniup */ function __destruct() { foreach ($this->cleanup as $cleanup) { $cleanup->run(); } } private function extract(Phar $phar) { $temp = (new Task\Extract($phar))->run($this->verbosity()); $this->cleanup[] = new Task\Cleanup($temp); return $temp; } private function hooks(SplObjectStorage $phars) { $hook = []; foreach ($phars as $phar) { if (isset($phar["pharext_package.php"])) { $sdir = include $phar["pharext_package.php"]; if ($sdir instanceof SourceDir) { $this->args->compile($sdir->getArgs()); $hook[] = $sdir; } } } return $hook; } private function load() { $list = new SplObjectStorage(); $phar = new Phar(Phar::running(false)); $temp = $this->extract($phar); foreach ($phar as $entry) { $dep_file = $entry->getBaseName(); if (fnmatch("*.ext.phar*", $dep_file)) { $dep_phar = new Phar("$temp/$dep_file"); $list[$dep_phar] = $this->extract($dep_phar); } } /* the actual ext.phar at last */ $list[$phar] = $temp; return $list; } /** * @inheritdoc * @see \pharext\Command::run() */ public function run($argc, array $argv) { try { /* load the phar(s) */ $list = $this->load(); /* installer hooks */ $hook = $this->hooks($list); } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EEXTRACT); } /* standard arg stuff */ $errs = []; $prog = array_shift($argv); foreach ($this->args->parse(--$argc, $argv) as $error) { $errs[] = $error; } if ($this->args["help"]) { $this->header(); $this->help($prog); exit; } try { foreach (["signature", "name", "date", "license", "release", "version"] as $opt) { if ($this->args[$opt]) { printf("%s\n", $this->metadata($opt)); exit; } } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EARGS); } foreach ($this->args->validate() as $error) { $errs[] = $error; } if ($errs) { if (!$this->args["quiet"]) { $this->header(); } foreach ($errs as $err) { $this->error("%s\n", $err); } if (!$this->args["quiet"]) { $this->help($prog); } exit(self::EARGS); } try { /* post process hooks */ foreach ($hook as $sdir) { $sdir->setArgs($this->args); } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EARGS); } /* install packages */ try { foreach ($list as $phar) { $this->info("Installing %s ...\n", basename($phar->getPath())); $this->install($list[$phar]); $this->activate($list[$phar]); $this->info("Successfully installed %s!\n", basename($phar->getPath())); } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EINSTALL); } } /** * Phpize + trinity */ private function install($temp) { // phpize $phpize = new Task\Phpize($temp, $this->args->prefix, $this->args->{"common-name"}); $phpize->run($this->verbosity()); // configure $configure = new Task\Configure($temp, $this->args->configure, $this->args->prefix, $this->args{"common-name"}); $configure->run($this->verbosity()); // make $make = new Task\Make($temp); $make->run($this->verbosity()); // install $sudo = isset($this->args->sudo) ? $this->args->sudo : null; $install = new Task\Make($temp, ["install"], $sudo); $install->run($this->verbosity()); } private function activate($temp) { if ($this->args->ini) { $files = [$this->args->ini]; } else { $files = array_filter(array_map("trim", explode(",", php_ini_scanned_files()))); $files[] = php_ini_loaded_file(); } $sudo = isset($this->args->sudo) ? $this->args->sudo : null; $type = $this->metadata("type") ?: "extension"; $activate = new Task\Activate($temp, $files, $type, $this->args->prefix, $this->args{"common-name"}, $sudo); if (!$activate->run($this->verbosity())) { $this->info("Extension already activated ...\n"); } } } <?php namespace pharext; trait License { function findLicense($dir, $file = null) { if (isset($file)) { return realpath("$dir/$file"); } $names = []; foreach (["{,UN}LICEN{S,C}{E,ING}", "COPY{,ING,RIGHT}"] as $name) { $names[] = $this->mergeLicensePattern($name, strtolower($name)); } $exts = []; foreach (["t{,e}xt", "rst", "asc{,i,ii}", "m{,ark}d{,own}", "htm{,l}"] as $ext) { $exts[] = $this->mergeLicensePattern(strtoupper($ext), $ext); } $pattern = "{". implode(",", $names) ."}{,.{". implode(",", $exts) ."}}"; if (($glob = glob("$dir/$pattern", GLOB_BRACE))) { return current($glob); } } private function mergeLicensePattern($upper, $lower) { $pattern = ""; $length = strlen($upper); for ($i = 0; $i < $length; ++$i) { if ($lower{$i} === $upper{$i}) { $pattern .= $upper{$i}; } else { $pattern .= "[" . $upper{$i} . $lower{$i} . "]"; } } return $pattern; } public function readLicense($file) { $text = file_get_contents($file); switch (strtolower(pathinfo($file, PATHINFO_EXTENSION))) { case "htm": case "html": $text = strip_tags($text); break; } return $text; } } <?php namespace pharext; class Metadata { static function version() { return "4.0.0"; } static function header() { return sprintf("pharext v%s (c) Michael Wallner <mike@php.net>", self::version()); } static function date() { return gmdate("Y-m-d"); } static function all() { return [ "version" => self::version(), "header" => self::header(), "date" => self::date(), ]; } } <?php namespace pharext\Openssl; use pharext\Exception; class PrivateKey { /** * Private key * @var string */ private $key; /** * Public key * @var string */ private $pub; /** * Read a private key * @param string $file * @param string $password * @throws \pharext\Exception */ function __construct($file, $password) { /* there appears to be a bug with refcount handling of this * resource; when the resource is stored as property, it cannot be * "coerced to a private key" on openssl_sign() later in another method */ $key = openssl_pkey_get_private("file://$file", $password); if (!is_resource($key)) { throw new Exception("Could not load private key"); } openssl_pkey_export($key, $this->key); $this->pub = openssl_pkey_get_details($key)["key"]; } /** * Sign the PHAR * @param \Phar $package */ function sign(\Phar $package) { $package->setSignatureAlgorithm(\Phar::OPENSSL, $this->key); } /** * Export the public key to a file * @param string $file * @throws \pharext\Exception */ function exportPublicKey($file) { if (!file_put_contents("$file.tmp", $this->pub) || !rename("$file.tmp", $file)) { throw new Exception; } } } <?php namespace pharext; use Phar; use pharext\Cli\Args as CliArgs; use pharext\Cli\Command as CliCommand; use pharext\Exception; /** * The extension packaging command executed by bin/pharext */ class Packager implements Command { use CliCommand; /** * Extension source directory * @var pharext\SourceDir */ private $source; /** * Cleanups * @var array */ private $cleanup = []; /** * Create the command */ public function __construct() { $this->args = new CliArgs([ ["h", "help", "Display this help", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], ["v", "verbose", "More output", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["q", "quiet", "Less output", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["n", "name", "Extension name", CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], ["r", "release", "Extension release version", CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], ["s", "source", "Extension source directory", CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], ["g", "git", "Use `git ls-tree` to determine file list", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["b", "branch", "Checkout this tag/branch", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], ["p", "pecl", "Use PECL package.xml to determine file list, name and release", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["d", "dest", "Destination directory", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, "."], ["z", "gzip", "Create additional PHAR compressed with gzip", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["Z", "bzip", "Create additional PHAR compressed with bzip", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], ["S", "sign", "Sign the PHAR with a private key", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], ["E", "zend", "Mark as Zend Extension", CliArgs::OPTIONAL|CliARgs::SINGLE|CliArgs::NOARG], [null, "signature", "Show pharext signature", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "license", "Show pharext license", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], [null, "version", "Show pharext version", CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], ]); } /** * Perform cleaniup */ function __destruct() { foreach ($this->cleanup as $cleanup) { $cleanup->run(); } } /** * @inheritdoc * @see \pharext\Command::run() */ public function run($argc, array $argv) { $errs = []; $prog = array_shift($argv); foreach ($this->args->parse(--$argc, $argv) as $error) { $errs[] = $error; } if ($this->args["help"]) { $this->header(); $this->help($prog); exit; } try { foreach (["signature", "license", "version"] as $opt) { if ($this->args[$opt]) { printf("%s\n", $this->metadata($opt)); exit; } } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EARGS); } try { /* source needs to be evaluated before CliArgs validation, * so e.g. name and version can be overriden and CliArgs * does not complain about missing arguments */ $this->loadSource(); } catch (\Exception $e) { $errs[] = $e->getMessage(); } foreach ($this->args->validate() as $error) { $errs[] = $error; } if ($errs) { if (!$this->args["quiet"]) { $this->header(); } foreach ($errs as $err) { $this->error("%s\n", $err); } printf("\n"); if (!$this->args["quiet"]) { $this->help($prog); } exit(self::EARGS); } $this->createPackage(); } /** * Download remote source * @param string $source * @return string local source */ private function download($source) { if ($this->args->git) { $task = new Task\GitClone($source, $this->args->branch); } else { /* print newline only once */ $done = false; $task = new Task\StreamFetch($source, function($bytes_pct) use(&$done) { if (!$done) { $this->info(" %3d%% [%s>%s] \r", floor($bytes_pct*100), str_repeat("=", round(50*$bytes_pct)), str_repeat(" ", round(50*(1-$bytes_pct))) ); if ($bytes_pct == 1) { $done = true; $this->info("\n"); } } }); } $local = $task->run($this->verbosity()); $this->cleanup[] = new Task\Cleanup($local); return $local; } /** * Extract local archive * @param stirng $source * @return string extracted directory */ private function extract($source) { try { $task = new Task\Extract($source); $dest = $task->run($this->verbosity()); } catch (\Exception $e) { if (false === strpos($e->getMessage(), "checksum mismatch")) { throw $e; } $dest = (new Task\PaxFixup($source))->run($this->verbosity()); } $this->cleanup[] = new Task\Cleanup($dest); return $dest; } /** * Localize a possibly remote source * @param string $source * @return string local source directory */ private function localize($source) { if (!stream_is_local($source) || ($this->args->git && isset($this->args->branch))) { $source = $this->download($source); $this->cleanup[] = new Task\Cleanup($source); } $source = realpath($source); if (!is_dir($source)) { $source = $this->extract($source); $this->cleanup[] = new Task\Cleanup($source); if (!$this->args->git) { $source = (new Task\PeclFixup($source))->run($this->verbosity()); } } return $source; } /** * Load the source dir * @throws \pharext\Exception */ private function loadSource(){ if ($this->args["source"]) { $source = $this->localize($this->args["source"]); if ($this->args["pecl"]) { $this->source = new SourceDir\Pecl($source); } elseif ($this->args["git"]) { $this->source = new SourceDir\Git($source); } elseif (is_file("$source/pharext_package.php")) { $this->source = include "$source/pharext_package.php"; } else { $this->source = new SourceDir\Basic($source); } if (!$this->source instanceof SourceDir) { throw new Exception("Unknown source dir $source"); } foreach ($this->source->getPackageInfo() as $key => $val) { $this->args->$key = $val; } } } /** * Creates the extension phar */ private function createPackage() { try { $meta = array_merge(Metadata::all(), [ "name" => $this->args->name, "release" => $this->args->release, "license" => $this->source->getLicense(), "stub" => "pharext_installer.php", "type" => $this->args->zend ? "zend_extension" : "extension", ]); $file = (new Task\PharBuild($this->source, $meta))->run($this->verbosity()); } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EBUILD); } try { if ($this->args->sign) { $this->info("Using private key to sign phar ...\n"); $pass = (new Task\Askpass)->run($this->verbosity()); $sign = new Task\PharSign($file, $this->args->sign, $pass); $pkey = $sign->run($this->verbosity()); } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::ESIGN); } if ($this->args->gzip) { try { $gzip = (new Task\PharCompress($file, Phar::GZ))->run(); $move = new Task\PharRename($gzip, $this->args->dest, $this->args->name ."-". $this->args->release); $name = $move->run($this->verbosity()); $this->info("Created gzipped phar %s\n", $name); if ($this->args->sign) { $sign = new Task\PharSign($name, $this->args->sign, $pass); $sign->run($this->verbosity())->exportPublicKey($name.".pubkey"); } } catch (\Exception $e) { $this->warn("%s\n", $e->getMessage()); } } if ($this->args->bzip) { try { $bzip = (new Task\PharCompress($file, Phar::BZ2))->run(); $move = new Task\PharRename($bzip, $this->args->dest, $this->args->name ."-". $this->args->release); $name = $move->run($this->verbosity()); $this->info("Created bzipped phar %s\n", $name); if ($this->args->sign) { $sign = new Task\PharSign($name, $this->args->sign, $pass); $sign->run($this->verbosity())->exportPublicKey($name.".pubkey"); } } catch (\Exception $e) { $this->warn("%s\n", $e->getMessage()); } } try { $move = new Task\PharRename($file, $this->args->dest, $this->args->name ."-". $this->args->release); $name = $move->run($this->verbosity()); $this->info("Created executable phar %s\n", $name); if (isset($pkey)) { $pkey->exportPublicKey($name.".pubkey"); } } catch (\Exception $e) { $this->error("%s\n", $e->getMessage()); exit(self::EBUILD); } } } <?php namespace pharext\SourceDir; use pharext\Cli\Args; use pharext\License; use pharext\SourceDir; use FilesystemIterator; use IteratorAggregate; use RecursiveCallbackFilterIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; class Basic implements IteratorAggregate, SourceDir { use License; private $path; public function __construct($path) { $this->path = $path; } public function getBaseDir() { return $this->path; } public function getPackageInfo() { return []; } public function getLicense() { if (($file = $this->findLicense($this->getBaseDir()))) { return $this->readLicense($file); } return "UNKNOWN"; } public function getArgs() { return []; } public function setArgs(Args $args) { } public function filter($current, $key, $iterator) { $sub = $current->getSubPath(); if ($sub === ".git" || $sub === ".hg" || $sub === ".svn") { return false; } return true; } public function getIterator() { $rdi = new RecursiveDirectoryIterator($this->path, FilesystemIterator::CURRENT_AS_SELF | // needed for 5.5 FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::SKIP_DOTS); $rci = new RecursiveCallbackFilterIterator($rdi, [$this, "filter"]); $rii = new RecursiveIteratorIterator($rci); foreach ($rii as $path => $child) { if (!$child->isDir()) { yield realpath($path); } } } } <?php namespace pharext\SourceDir; use pharext\Cli\Args; use pharext\License; use pharext\SourceDir; /** * Extension source directory which is a git repo */ class Git implements \IteratorAggregate, SourceDir { use License; /** * Base directory * @var string */ private $path; /** * @inheritdoc * @see \pharext\SourceDir::__construct() */ public function __construct($path) { $this->path = $path; } /** * @inheritdoc * @see \pharext\SourceDir::getBaseDir() */ public function getBaseDir() { return $this->path; } /** * @inheritdoc * @return array */ public function getPackageInfo() { return []; } /** * @inheritdoc * @return string */ public function getLicense() { if (($file = $this->findLicense($this->getBaseDir()))) { return $this->readLicense($file); } return "UNKNOWN"; } /** * @inheritdoc * @return array */ public function getArgs() { return []; } /** * @inheritdoc */ public function setArgs(Args $args) { } /** * Generate a list of files by `git ls-files` * @return Generator */ private function generateFiles() { $pwd = getcwd(); chdir($this->path); if (($pipe = popen("git ls-tree -r --name-only HEAD", "r"))) { $path = realpath($this->path); while (!feof($pipe)) { if (strlen($file = trim(fgets($pipe)))) { /* there may be symlinks, so no realpath here */ yield "$path/$file"; } } pclose($pipe); } chdir($pwd); } /** * Implements IteratorAggregate * @see IteratorAggregate::getIterator() */ public function getIterator() { return $this->generateFiles(); } } <?php namespace pharext\SourceDir; use pharext\Cli\Args; use pharext\Exception; use pharext\SourceDir; use pharext\License; /** * A PECL extension source directory containing a v2 package.xml */ class Pecl implements \IteratorAggregate, SourceDir { use License; /** * The package.xml * @var SimpleXmlElement */ private $sxe; /** * The base directory * @var string */ private $path; /** * The package.xml * @var string */ private $file; /** * @inheritdoc * @see \pharext\SourceDir::__construct() */ public function __construct($path) { if (is_file("$path/package2.xml")) { $sxe = simplexml_load_file($this->file = "$path/package2.xml"); } elseif (is_file("$path/package.xml")) { $sxe = simplexml_load_file($this->file = "$path/package.xml"); } else { throw new Exception("Missing package.xml in $path"); } $sxe->registerXPathNamespace("pecl", $sxe->getDocNamespaces()[""]); $this->sxe = $sxe; $this->path = realpath($path); } /** * @inheritdoc * @see \pharext\SourceDir::getBaseDir() */ public function getBaseDir() { return $this->path; } /** * Retrieve gathered package info * @return Generator */ public function getPackageInfo() { if (($name = $this->sxe->xpath("/pecl:package/pecl:name"))) { yield "name" => (string) $name[0]; } if (($release = $this->sxe->xpath("/pecl:package/pecl:version/pecl:release"))) { yield "release" => (string) $release[0]; } if ($this->sxe->xpath("/pecl:package/pecl:zendextsrcrelease")) { yield "zend" => true; } } /** * @inheritdoc * @return string */ public function getLicense() { if (($license = $this->sxe->xpath("/pecl:package/pecl:license"))) { if (($file = $this->findLicense($this->getBaseDir(), $license[0]["filesource"]))) { return $this->readLicense($file); } } if (($file = $this->findLicense($this->getBaseDir()))) { return $this->readLicense($file); } if ($license) { return $license[0] ." ". $license[0]["uri"]; } return "UNKNOWN"; } /** * @inheritdoc * @see \pharext\SourceDir::getArgs() */ public function getArgs() { $configure = $this->sxe->xpath("/pecl:package/pecl:extsrcrelease/pecl:configureoption"); foreach ($configure as $cfg) { yield [null, $cfg["name"], ucfirst($cfg["prompt"]), Args::OPTARG, strlen($cfg["default"]) ? $cfg["default"] : null]; } $configure = $this->sxe->xpath("/pecl:package/pecl:zendextsrcrelease/pecl:configureoption"); foreach ($configure as $cfg) { yield [null, $cfg["name"], ucfirst($cfg["prompt"]), Args::OPTARG, strlen($cfg["default"]) ? $cfg["default"] : null]; } } /** * @inheritdoc * @see \pharext\SourceDir::setArgs() */ public function setArgs(Args $args) { $configure = $this->sxe->xpath("/pecl:package/pecl:extsrcrelease/pecl:configureoption"); foreach ($configure as $cfg) { if (isset($args[$cfg["name"]])) { $args->configure = "--{$cfg["name"]}={$args[$cfg["name"]]}"; } } $configure = $this->sxe->xpath("/pecl:package/pecl:zendextsrcrelease/pecl:configureoption"); foreach ($configure as $cfg) { if (isset($args[$cfg["name"]])) { $args->configure = "--{$cfg["name"]}={$args[$cfg["name"]]}"; } } } /** * Compute the path of a file by parent dir nodes * @param \SimpleXMLElement $ele * @return string */ private function dirOf($ele) { $path = ""; while (($ele = current($ele->xpath(".."))) && $ele->getName() == "dir") { $path = trim($ele["name"], "/") ."/". $path ; } return trim($path, "/"); } /** * Generate a list of files from the package.xml * @return Generator */ private function generateFiles() { /* hook */ $temp = tmpfile(); fprintf($temp, "<?php\nreturn new %s(__DIR__);\n", get_class($this)); rewind($temp); yield "pharext_package.php" => $temp; /* deps */ $dependencies = $this->sxe->xpath("/pecl:package/pecl:dependencies/pecl:required/pecl:package"); foreach ($dependencies as $key => $dep) { if (($glob = glob("{$this->path}/{$dep->name}-*.ext.phar*"))) { usort($glob, function($a, $b) { return version_compare( substr($a, strpos(".ext.phar", $a)), substr($b, strpos(".ext.phar", $b)) ); }); yield end($glob); } } /* files */ yield realpath($this->file); foreach ($this->sxe->xpath("//pecl:file") as $file) { yield realpath($this->path ."/". $this->dirOf($file) ."/". $file["name"]); } } /** * Implements IteratorAggregate * @see IteratorAggregate::getIterator() */ public function getIterator() { return $this->generateFiles(); } } <?php namespace pharext; /** * Source directory interface, which should yield file names to package on traversal */ interface SourceDir extends \Traversable { /** * Retrieve the base directory * @return string */ public function getBaseDir(); /** * Retrieve gathered package info * @return array|Traversable */ public function getPackageInfo(); /** * Retrieve the full text license * @return string */ public function getLicense(); /** * Provide installer command line args * @return array|Traversable */ public function getArgs(); /** * Process installer command line args * @param \pharext\Cli\Args $args */ public function setArgs(Cli\Args $args); } <?php namespace pharext\Task; use pharext\Exception; use pharext\ExecCmd; use pharext\Task; use pharext\Tempfile; /** * PHP INI activation */ class Activate implements Task { /** * @var string */ private $cwd; /** * @var array */ private $inis; /** * @var string */ private $type; /** * @var string */ private $php_config; /** * @var string */ private $sudo; /** * @param string $cwd working directory * @param array $inis custom INI or list of loaded/scanned INI files * @param string $type extension or zend_extension * @param string $prefix install prefix, e.g. /usr/local * @param string $common_name PHP programs common name, e.g. php5 * @param string $sudo sudo command * @throws \pharext\Exception */ public function __construct($cwd, array $inis, $type = "extension", $prefix = null, $common_name = "php", $sudo = null) { $this->cwd = $cwd; $this->type = $type; $this->sudo = $sudo; if (!$this->inis = $inis) { throw new Exception("No PHP INIs given"); } $cmd = $common_name . "-config"; if (isset($prefix)) { $cmd = $prefix . "/bin/" . $cmd; } $this->php_config = $cmd; } /** * @param bool $verbose * @return boolean false, if extension was already activated */ public function run($verbose = false) { if ($verbose !== false) { printf("Running INI activation ...\n"); } $extension = basename(current(glob("{$this->cwd}/modules/*.so"))); if ($this->type === "zend_extension") { $pattern = preg_quote((new ExecCmd($this->php_config))->run(["--extension-dir"])->getOutput() . "/$extension", "/"); } else { $pattern = preg_quote($extension, "/"); } foreach ($this->inis as $file) { if ($verbose) { printf("Checking %s ...\n", $file); } if (!file_exists($file)) { throw new Exception(sprintf("INI file '%s' does not exist", $file)); } $temp = new Tempfile("phpini"); foreach (file($file) as $line) { if (preg_match("/^\s*{$this->type}\s*=\s*[\"']?{$pattern}[\"']?\s*(;.*)?\$/", $line)) { return false; } fwrite($temp->getStream(), $line); } } /* not found; append to last processed file, which is the main by default */ if ($verbose) { printf("Activating in %s ...\n", $file); } fprintf($temp->getStream(), $this->type . "=%s\n", $extension); $temp->closeStream(); $path = $temp->getPathname(); $stat = stat($file); // owner transfer $ugid = sprintf("%d:%d", $stat["uid"], $stat["gid"]); $cmd = new ExecCmd("chown", $verbose); if (isset($this->sudo)) { $cmd->setSu($this->sudo); } $cmd->run([$ugid, $path]); // permission transfer $perm = decoct($stat["mode"] & 0777); $cmd = new ExecCmd("chmod", $verbose); if (isset($this->sudo)) { $cmd->setSu($this->sudo); } $cmd->run([$perm, $path]); // rename $cmd = new ExecCmd("mv", $verbose); if (isset($this->sudo)) { $cmd->setSu($this->sudo); } $cmd->run([$path, $file]); if ($verbose) { printf("Replaced %s ...\n", $file); } return true; } } <?php namespace pharext\Task; use pharext\Task; /** * Ask password on console */ class Askpass implements Task { /** * @var string */ private $prompt; /** * @param string $prompt */ public function __construct($prompt = "Password:") { $this->prompt = $prompt; } /** * @param bool $verbose * @return string */ public function run($verbose = false) { system("stty -echo"); printf("%s ", $this->prompt); $pass = fgets(STDIN, 1024); printf("\n"); system("stty echo"); if (substr($pass, -1) == "\n") { $pass = substr($pass, 0, -1); } return $pass; } } <?php namespace pharext\Task; use pharext\Task; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; /** * List all library files of pharext to bundle with a phar */ class BundleGenerator implements Task { /** * @param bool $verbose * @return Generator */ public function run($verbose = false) { if ($verbose) { printf("Packaging pharext ... \n"); } $rdi = new RecursiveDirectoryIterator(dirname(dirname(__DIR__))); $rii = new RecursiveIteratorIterator($rdi); for ($rii->rewind(); $rii->valid(); $rii->next()) { if (!$rii->isDot()) { yield $rii->getSubPathname() => $rii->key(); } } } } <?php namespace pharext\Task; use pharext\Task; use FilesystemIterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; /** * Recursively cleanup FS entries */ class Cleanup implements Task { /** * @var string */ private $rm; public function __construct($rm) { $this->rm = $rm; } /** * @param bool $verbose */ public function run($verbose = false) { if ($verbose) { printf("Cleaning up %s ...\n", $this->rm); } if ($this->rm instanceof Tempfile) { unset($this->rm); } elseif (is_dir($this->rm)) { $rdi = new RecursiveDirectoryIterator($this->rm, FilesystemIterator::CURRENT_AS_SELF | // needed for 5.5 FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::SKIP_DOTS); $rii = new RecursiveIteratorIterator($rdi, RecursiveIteratorIterator::CHILD_FIRST); foreach ($rii as $path => $child) { if ($child->isDir()) { @rmdir($path); } else { @unlink($path); } } @rmdir($this->rm); } elseif (file_exists($this->rm)) { @unlink($this->rm); } } } <?php namespace pharext\Task; use pharext\Exception; use pharext\ExecCmd; use pharext\Task; /** * Runs extension's configure */ class Configure implements Task { /** * @var array */ private $args; /** * @var string */ private $cwd; /** * @param string $cwd working directory * @param array $args configure args * @param string $prefix install prefix, e.g. /usr/local * @param string $common_name PHP programs common name, e.g. php5 */ public function __construct($cwd, array $args = null, $prefix = null, $common_name = "php") { $this->cwd = $cwd; $cmd = $common_name . "-config"; if (isset($prefix)) { $cmd = $prefix . "/bin/" . $cmd; } $this->args = ["--with-php-config=$cmd"]; if ($args) { $this->args = array_merge($this->args, $args); } } public function run($verbose = false) { if ($verbose !== false) { printf("Running ./configure ...\n"); } $pwd = getcwd(); if (!chdir($this->cwd)) { throw new Exception; } try { $cmd = new ExecCmd("./configure", $verbose); $cmd->run($this->args); } finally { chdir($pwd); } } } <?php namespace pharext\Task; use pharext\Task; use pharext\Tempdir; use Phar; use PharData; /** * Extract a package archive */ class Extract implements Task { /** * @var Phar(Data) */ private $source; /** * @param mixed $source archive location */ public function __construct($source) { if ($source instanceof Phar || $source instanceof PharData) { $this->source = $source; } else { $this->source = new PharData($source); } } /** * @param bool $verbose * @return \pharext\Tempdir */ public function run($verbose = false) { if ($verbose) { printf("Extracting %s ...\n", basename($this->source->getPath())); } $dest = new Tempdir("extract"); $this->source->extractTo($dest); return $dest; } } <?php namespace pharext\Task; use pharext\ExecCmd; use pharext\Task; use pharext\Tempdir; /** * Clone a git repo */ class GitClone implements Task { /** * @var string */ private $source; /** * @var string */ private $branch; /** * @param string $source git repo location */ public function __construct($source, $branch = null) { $this->source = $source; $this->branch = $branch; } /** * @param bool $verbose * @return \pharext\Tempdir */ public function run($verbose = false) { if ($verbose !== false) { printf("Fetching %s ...\n", $this->source); } $local = new Tempdir("gitclone"); $cmd = new ExecCmd("git", $verbose); if (strlen($this->branch)) { $cmd->run(["clone", "--depth", 1, "--branch", $this->branch, $this->source, $local]); } else { $cmd->run(["clone", $this->source, $local]); } return $local; } } <?php namespace pharext\Task; use pharext\ExecCmd; use pharext\Exception; use pharext\Task; /** * Run make in the source dir */ class Make implements Task { /** * @var string */ private $cwd; /** * @var array */ private $args; /** * @var string */ private $sudo; /** * * @param string $cwd working directory * @param array $args make's arguments * @param string $sudo sudo command */ public function __construct($cwd, array $args = null, $sudo = null) { $this->cwd = $cwd; $this->sudo = $sudo; $this->args = $args; } /** * * @param bool $verbose * @throws \pharext\Exception */ public function run($verbose = false) { if ($verbose !== false) { printf("Running make"); if ($this->args) { foreach ($this->args as $arg) { printf(" %s", $arg); } } printf(" ...\n"); } $pwd = getcwd(); if (!chdir($this->cwd)) { throw new Exception; } try { $cmd = new ExecCmd("make", $verbose); if (isset($this->sudo)) { $cmd->setSu($this->sudo); } $args = $this->args; if (!$verbose) { $args = array_merge((array) $args, ["-s"]); } $cmd->run($args); } finally { chdir($pwd); } } } <?php namespace pharext\Task; use pharext\Exception; use pharext\Task; use pharext\Tempfile; class PaxFixup implements Task { private $source; public function __construct($source) { $this->source = $source; } private function openArchive($source) { $hdr = file_get_contents($source, false, null, 0, 3); if ($hdr === "\x1f\x8b\x08") { $fd = fopen("compress.zlib://$source", "r"); } elseif ($hdr === "BZh") { $fd = fopen("compress.bzip2://$source", "r"); } else { $fd = fopen($source, "r"); } if (!is_resource($fd)) { throw new Exception; } return $fd; } public function run($verbose = false) { if ($verbose !== false) { printf("Fixing up a tarball with global pax header ...\n"); } $temp = new Tempfile("paxfix"); stream_copy_to_stream($this->openArchive($this->source), $temp->getStream(), -1, 1024); $temp->closeStream(); return (new Extract((string) $temp))->run($verbose); } }<?php namespace pharext\Task; use pharext\Exception; use pharext\Task; /** * Fixup package.xml files in an extracted PECL dir */ class PeclFixup implements Task { /** * @var string */ private $source; /** * @param string $source source directory */ public function __construct($source) { $this->source = $source; } /** * @param bool $verbose * @return string sanitized source location * @throws \pahrext\Exception */ public function run($verbose = false) { if ($verbose !== false) { printf("Sanitizing PECL dir ...\n"); } $dirs = glob("{$this->source}/*", GLOB_ONLYDIR); $files = array_diff(glob("{$this->source}/*"), $dirs); $check = array_reduce($files, function($r, $v) { return $v && fnmatch("package*.xml", basename($v)); }, true); if (count($dirs) !== 1 || !$check) { throw new Exception("Does not look like an extracted PECL dir: {$this->source}"); } $dest = current($dirs); foreach ($files as $file) { if ($verbose) { printf("Moving %s into %s ...\n", basename($file), basename($dest)); } if (!rename($file, "$dest/" . basename($file))) { throw new Exception; } } return $dest; } } <?php namespace pharext\Task; use pharext\Exception; use pharext\SourceDir; use pharext\Task; use pharext\Tempname; use Phar; /** * Build phar */ class PharBuild implements Task { /** * @var \pharext\SourceDir */ private $source; /** * @var array */ private $meta; /** * @var bool */ private $readonly; /** * @param SourceDir $source extension source directory * @param array $meta phar meta data * @param bool $readonly whether the stub has -dphar.readonly=1 set */ public function __construct(SourceDir $source = null, array $meta = null, $readonly = true) { $this->source = $source; $this->meta = $meta; $this->readonly = $readonly; } /** * @param bool $verbose * @return \pharext\Tempname * @throws \pharext\Exception */ public function run($verbose = false) { /* Phar::compress() and ::convert*() use strtok("."), ugh! * so, be sure to not use any other dots in the filename * except for .phar */ $temp = new Tempname("", "-pharext.phar"); $phar = new Phar($temp); $phar->startBuffering(); if ($this->meta) { $phar->setMetadata($this->meta); if (isset($this->meta["stub"])) { $phar->setDefaultStub($this->meta["stub"]); $phar->setStub("#!/usr/bin/php -dphar.readonly=" . intval($this->readonly) ."\n". $phar->getStub()); } } $phar->buildFromIterator((new Task\BundleGenerator)->run()); if ($this->source) { if ($verbose) { $bdir = $this->source->getBaseDir(); $blen = strlen($bdir); foreach ($this->source as $index => $file) { if (is_resource($file)) { printf("Packaging %s ...\n", $index); $phar[$index] = $file; } else { printf("Packaging %s ...\n", $index = trim(substr($file, $blen), "/")); $phar->addFile($file, $index); } } } else { $phar->buildFromIterator($this->source, $this->source->getBaseDir()); } } $phar->stopBuffering(); if (!chmod($temp, fileperms($temp) | 0111)) { throw new Exception; } return $temp; } }<?php namespace pharext\Task; use pharext\Task; use Phar; /** * Clone a compressed copy of a phar */ class PharCompress implements Task { /** * @var string */ private $file; /** * @var Phar */ private $package; /** * @var int */ private $encoding; /** * @var string */ private $extension; /** * @param string $file path to the original phar * @param int $encoding Phar::GZ or Phar::BZ2 */ public function __construct($file, $encoding) { $this->file = $file; $this->package = new Phar($file); $this->encoding = $encoding; switch ($encoding) { case Phar::GZ: $this->extension = ".gz"; break; case Phar::BZ2: $this->extension = ".bz2"; break; } } /** * @param bool $verbose * @return string */ public function run($verbose = false) { if ($verbose) { printf("Compressing %s ...\n", basename($this->package->getPath())); } $phar = $this->package->compress($this->encoding); $meta = $phar->getMetadata(); if (isset($meta["stub"])) { /* drop shebang */ $phar->setDefaultStub($meta["stub"]); } return $this->file . $this->extension; } } <?php namespace pharext\Task; use pharext\Exception; use pharext\Task; /** * Rename the phar archive */ class PharRename implements Task { /** * @var string */ private $phar; /** * @var string */ private $dest; /** * @var string */ private $name; /** * @param string $phar path to phar * @param string $dest destination dir * @param string $name package name */ public function __construct($phar, $dest, $name) { $this->phar = $phar; $this->dest = $dest; $this->name = $name; } /** * @param bool $verbose * @return string path to renamed phar * @throws \pharext\Exception */ public function run($verbose = false) { $extension = substr(strstr($this->phar, "-pharext.phar"), 8); $name = sprintf("%s/%s.ext%s", $this->dest, $this->name, $extension); if ($verbose) { printf("Renaming %s to %s ...\n", basename($this->phar), basename($name)); } if (!rename($this->phar, $name)) { throw new Exception; } return $name; } } <?php namespace pharext\Task; use pharext\Openssl; use pharext\Task; use Phar; /** * Sign the phar with a private key */ class PharSign implements Task { /** * @var Phar */ private $phar; /** * @var \pharext\Openssl\PrivateKey */ private $pkey; /** * * @param mixed $phar phar instance or path to phar * @param string $pkey path to private key * @param string $pass password for the private key */ public function __construct($phar, $pkey, $pass) { if ($phar instanceof Phar || $phar instanceof PharData) { $this->phar = $phar; } else { $this->phar = new Phar($phar); } $this->pkey = new Openssl\PrivateKey($pkey, $pass); } /** * @param bool $verbose * @return \pharext\Openssl\PrivateKey */ public function run($verbose = false) { if ($verbose) { printf("Signing %s ...\n", basename($this->phar->getPath())); } $this->pkey->sign($this->phar); return $this->pkey; } } <?php namespace pharext\Task; use pharext\Exception; use pharext\ExecCmd; use pharext\Task; /** * Run phpize in the extension source directory */ class Phpize implements Task { /** * @var string */ private $phpize; /** * * @var string */ private $cwd; /** * @param string $cwd working directory * @param string $prefix install prefix, e.g. /usr/local * @param string $common_name PHP program common name, e.g. php5 */ public function __construct($cwd, $prefix = null, $common_name = "php") { $this->cwd = $cwd; $cmd = $common_name . "ize"; if (isset($prefix)) { $cmd = $prefix . "/bin/" . $cmd; } $this->phpize = $cmd; } /** * @param bool $verbose * @throws \pharext\Exception */ public function run($verbose = false) { if ($verbose !== false) { printf("Running %s ...\n", $this->phpize); } $pwd = getcwd(); if (!chdir($this->cwd)) { throw new Exception; } try { $cmd = new ExecCmd($this->phpize, $verbose); $cmd->run(); } finally { chdir($pwd); } } } <?php namespace pharext\Task; use pharext\Exception; use pharext\Task; use pharext\Tempfile; /** * Fetch a remote archive */ class StreamFetch implements Task { /** * @var string */ private $source; /** * @var callable */ private $progress; /** * @param string $source remote file location * @param callable $progress progress callback */ public function __construct($source, callable $progress) { $this->source = $source; $this->progress = $progress; } private function createStreamContext() { $progress = $this->progress; /* avoid bytes_max bug of older PHP versions */ $maxbytes = 0; return stream_context_create([],["notification" => function($notification, $severity, $message, $code, $bytes_cur, $bytes_max) use($progress, &$maxbytes) { if ($bytes_max > $maxbytes) { $maxbytes = $bytes_max; } switch ($notification) { case STREAM_NOTIFY_CONNECT: $progress(0); break; case STREAM_NOTIFY_PROGRESS: $progress($maxbytes > 0 ? $bytes_cur/$maxbytes : .5); break; case STREAM_NOTIFY_COMPLETED: /* this is sometimes not generated, why? */ $progress(1); break; } }]); } /** * @param bool $verbose * @return \pharext\Task\Tempfile * @throws \pharext\Exception */ public function run($verbose = false) { if ($verbose !== false) { printf("Fetching %s ...\n", $this->source); } $context = $this->createStreamContext(); if (!$remote = fopen($this->source, "r", false, $context)) { throw new Exception; } $local = new Tempfile("remote"); if (!stream_copy_to_stream($remote, $local->getStream())) { throw new Exception; } $local->closeStream(); /* STREAM_NOTIFY_COMPLETED is not generated, see above */ call_user_func($this->progress, 1); return $local; } } <?php namespace pharext; /** * Simple task interface */ interface Task { public function run($verbose = false); } <?php namespace pharext; /** * Create a temporary directory */ class Tempdir extends \SplFileInfo { /** * @param string $prefix prefix to uniqid() * @throws \pharext\Exception */ public function __construct($prefix) { $temp = new Tempname($prefix); if (!is_dir($temp) && !mkdir($temp, 0700, true)) { throw new Exception("Could not create tempdir: ".error_get_last()["message"]); } parent::__construct($temp); } } <?php namespace pharext; /** * Create a new temporary file */ class Tempfile extends \SplFileInfo { /** * @var resource */ private $handle; /** * @param string $prefix uniqid() prefix * @param string $suffix e.g. file extension * @throws \pharext\Exception */ public function __construct($prefix, $suffix = ".tmp") { $tries = 0; $omask = umask(077); do { $path = new Tempname($prefix, $suffix); $this->handle = fopen($path, "x"); } while (!is_resource($this->handle) && $tries++ < 10); umask($omask); if (!is_resource($this->handle)) { throw new Exception("Could not create temporary file"); } parent::__construct($path); } /** * Unlink the file */ public function __destruct() { if (is_file($this->getPathname())) { @unlink($this->getPathname()); } } /** * Close the stream */ public function closeStream() { fclose($this->handle); } /** * Retrieve the stream resource * @return resource */ public function getStream() { return $this->handle; } } <?php namespace pharext; use pharext\Exception; /** * A temporary file/directory name */ class Tempname { /** * @var string */ private $name; /** * @param string $prefix uniqid() prefix * @param string $suffix e.g. file extension */ public function __construct($prefix, $suffix = null) { $temp = sys_get_temp_dir() . "/pharext-" . posix_getlogin(); if (!is_dir($temp) && !mkdir($temp, 0700, true)) { throw new Exception; } $this->name = $temp ."/". uniqid($prefix) . $suffix; } /** * @return string */ public function __toString() { return (string) $this->name; } } <?php /** * The installer sub-stub for extension phars */ spl_autoload_register(function($c) { return include strtr($c, "\\_", "//") . ".php"; }); $installer = new pharext\Installer(); $installer->run($argc, $argv); <?php /** * The packager sub-stub for bin/pharext */ spl_autoload_register(function($c) { return include strtr($c, "\\_", "//") . ".php"; }); $packager = new pharext\Packager(); $packager->run($argc, $argv); # / *~ /*.tgz /.deps /*.lo /*.la /config.[^wm]* /configure* /lib* /ac*.m4 /ltmain.sh /install-sh /Make* /mk* /missing /.libs /build /include /modules /autom4te* /.dep.inc run-tests.php �����������`��� ������������������������������������������������������������������__text����������__TEXT������������������v"������������������������������__debug_info����__DWARF���������v"������1������(��������������������������__debug_abbrev��__DWARF��������� T������P������Z�����������������������������__debug_line����__DWARF���������YV������P������\��������������������������__debug_str�����__DWARF���������]������������)d�����������������������������__debug_loc�����__DWARF���������yu��������������{�����������������������������__debug_ranges��__DWARF���������yu��������������{�����������������������������__cstring�������__TEXT����������yu������g������{�����������������������������__bss�����������__DATA�����������������������������������������������������__const���������__TEXT����������w������ �������`~�����������������������������__data����������__DATA�����������x�������������~�����Ȫ���������������������__const���������__DATA����������x�������������0��������������������������__apple_names���__DWARF���������Py������H������������0��R������������������__apple_objc����__DWARF���������}������$������������������������������������__apple_namespac__DWARF���������}������$�������<�����������������������������__apple_types���__DWARF���������}������4������`��������������������������__compact_unwind__LD������������������`�������������#������������������__eh_frame������__TEXT����������x������������������������� ��h������������$������� �������������r�����$�� ���P�������;���;������B���0���������������������������������������������������UHH@������L����#���E1EE1H}HuHHL‰M����HEHEHEH}����HEHEH�HEHE؋HMHEHMHUHEPE%���=�������HEЋ�������H}����H}HGHEH@]fD��UHHH}H}����ȁ ������HEH�H���HEHEH]fff.�����UHH}H}G%���=�������HE���HE]fff.�����UHHH}H}H?����S���H5����.���HEH8����HEH�Hx����H5����0���1E1HEH�H����HEH�����H]f.�����UHHH}H}G%���=����k���HE����L���HEH����������HEH�������H5������1E1H}������������H]ff.�����UHH����]�UHH H}HuH}���� ���H����HE���H�������1AE1HuF -���HcHHP�������HEHEH���HuH����HEH���HuH����H����HUHuHHUHB0HEH ]f�����UHH1H}H}����H���H]ff.�����UHHH}�������H5����H������������H5����H�������������H]UHAWAVAUATSHx��H�������ʹ���E1A��EL}ԉuLDHL҉H����HH����H5����HHHHH5����HHDž����HDž����HDž����HE����HE����HDž`����HDžp����HDžx����HDž����HDž�����HDž����HDž����HDž����HDž����HDž����HDž����HDž����HDž ����HE����HE����HDž����E����HE����E����HE����HE����HE����HDžh����HDž(����HE����Hu����H5����H����H����H��H����H���H����1H5����H=����L����L����H����L5����L=����L%����1AI���DL-����A���HLHHƉLLLLLxLpHh���� ����HH���HHP���HH5H���HhH=���LpL0���LxL8���LLh���HHp���Hx��[A\A]A^A_]fD��UHH0H}HuUH}u����HHEHEH���HuHUH����HMHUD �HMHEHH0]fffff.�����UHH1H}H}HUHRHcH)HH}HMH9���� ���H}����HEH���H����ȁ����.���H5�������HEH���H����HE@��������H}����H]ffffff.�����UHHpH}HuH}����HEHEH8������HEH���H����ȁ�������E����HuH}����HuH}H?HE����<����H5����7��HEH8����HEHMH HMHEHEH�HEHEPUHEHMHUHEȉPE%���=�������HE���������������HEH8����HEH����ȉʃMUb�������EEE�������HEH�HxHuHEH�H@H���HMH HIHILEH����X���H}��������HEH ������� ���H}����E����HEH8HEH�HpHU����HEHEH���H����ȁ�������HEH���HMH1H����Hp]f.�����UHH ��H}HuH}����HEHEH8����c��HEH���H����ȁ�������E����HuH}����HuH}H?H����<����H5�������HEH8����HEHMH HMHEHEH�HEHEPUHEHMHUHEPE%���=�������HE���������������HEH8����HEH����ȉʃ������9����������E1LMHEHEHEH�HxHuHEH�H@H���HMH HIHIH����HEH}����DA ���444$DIcH����^�������HEHEHEHxHxH�HpHxHlHpHMHlHEP�����������HEH`HEH�H���HXHXH�HPHXHLHPH`HLH`PL%���=�������HP�������H5������H}����������HEH8HEH�Hp����HEH}����u������HEH@HEH8H8����ȁ ���444$HcH����m�������H@H0H8H(H(H�H H(HH H0HH0P�����������H@HH8H�H���HHH�H�HHH�HHHP%���=�������H��������H5���� ��H8��������������������HEH ��]ffffff.�����UHH@H}HuUH}Hu����H}HE����Ё�������H}����;M�������Eȉ HMЉE���H���HMHcHH}�������H}�������H}����{���H}����m���H}����_���H}����Q���H}����ȁ������H5���� ��H}�������H=����H5���� ��H ����������������E�������EEH@]5CQm{_UHH���H}HuUHMH}�������H}����H0���1H0����H0HEE����HuH}����1;MH(��H}������H}����ȁ������H}����ȁ���b��H}Hu����HEH}����>������HEHEHEHEH}����ȁ ���444$HcH����j�������HEHEHEHEHEH�HEHEHMHEHMHUHEPE%���=�������HE��������������HEHEHEH�H���HEHEH�HxHEHtHxHMHtHEPt%���=�������Hx�������������������������H}����ȁ�������H}����H}����$*���H}1H����r������HuH} ����H}�������HEHx(����HEH}Hu����H}H5����|��Hh����1҉Hh����H`H`H���HXHEHPHPH�HHHPHDHHHXHDHXPD%���=�������HH�����������HEH8H`H���H8HH8@ ������H}���� ���H}����HEH���]@�UHH���H}HuHUE����HuH}����H}HE����ȁ����7���H}����ȁ������H}����E ���H}�������H}1H����������E����HEHEHEH ����������HEH �������[��H}����=���B��HEH ����������HEH �������@���HEH ������� ���H}����EH5������H}�������H}����ȁ ������H}����EHEHEHEH�H���HEHEH�HEHEHMHEHMHUHEȉPE%���=����@���E%���=�������H5������H}�������HE�����������������������������������HEH ������� ���H}����E����H}����0���H}����HEH}HuHU����H}HE���� ���H������H}Hu����HxHuH}����H}H5����������HĐ���]fffff.�����UHHPH}HuUE����E����HuH}����H}HE����ȁ���� ���E�������H}����H}HE����ȁ���m���H}Hu����HEH}���� ���E����=���}����$���H}����ȁ���4$ȉM���E�����������H}����EHP]fD��UHH@H}HuE����HuH}����H}HE����ȁ������HEHEH}����ȁ���2���H}����ȁ������H5������H}��������H}HEH0����1ɉE;M ���HuH}����HEH;E���H5������H}��������H@]D��UHH}H}G]fffff.�����UHH0HUH}HuHuH���H}HH}HHu����=�������H}Hu����E���H}Hu����EEH0]UHH0H}HuHUHUHUHU=9��� ���E�������HE0���d���HE-��� ���E����^���HEH���HEHE9������HE0��� ���E���������������H}HuHU����EEH0]ffff.�����UHHH}H}����ȁ������HEH8����HE ���H}����HEHEH]UHH0HUH}HuHuH���H}HH}HHu����=�������H}Hu����HE���H}Hu����HEHEH0]ffff.�����UHHH}H}G %���=����HcH�������H=����H5����/��H ������������HEH����H]f�����UHHH}H}O �������E9���HMQ �������E���HEH �������ˆUE4$HcH�������H=����H5����%��H ������������HEH��H]ffffff.�����UHHH}H}G %���=����HcH�������H=����H5����4��H ������������HEH�H]f�����UHH0HEH}HuHUHUH���HuHvHH����=����'���H ����A1��H}HuHU����HE"���H ����A3��H}HuHU����HEHEH0]fff.�����UHHH}����HEH����ȃM ����������H=����H5�������H ��������1HUHHuH6HvHc6H)HHH]�UHH H}HuH}����HEHEH8����@���HEH���H����ȁ�������HEH���HuH����HE����HEH ]�����UHH0H}HuH}����ȁ����F���H}HuHU����19&���H}����ȁ��� ���E�����������E�EH0]@�UHH������1ɉLEH}HuHE����HL����H5����HUHMLELMAy,L ���������19��H}����HEH����ȃM ������� ���H}����HEHx �������HEH ���HE ���1HM����HEH����HEH}Hu����HuHH}����p�������HEH���HEHEHEHEH�HEHEHMHEHMHUHEPE%���=�������HE���������������H}����HĀ���]�UHH H}u}����<���1H���HMH���H���H���HH����HEF���H5����y���1E1HH���H}H���H���H���H����HEHE1ɺ���HEHE����}����E���HEHH}����HEH}HGHEH ]UHH H}H}����HEH}���� ���HEH ]H5����H����H8��������E����f.�����UHH}H}HG����]Ï1����������� �C�������[�����������v"������{���E���< �x������P������F���I�����J#������K#�����L#�����M# �����N#����O#��d��P# ��n��Q#(:����R#0N����S#8c����T#@x����U#H����V#P��d��W#X����X#`����\#h�� ��^#p�� ��_#x����`#����a#m����b#����c#~����d#��d��e#����������������P /���� 0#� ���� 1#'���� 2#/���� 3#7���� 4# ?���� 5#(E���� 6#0P���� 7#8Z���� 8#@e���� :#Du���� ;#H~���� <#L�������V&�� 3����#���q��#����#����#���6��UF��W��P��#�i����# k����#� m��[��#�}��[��#��f��#���P��#�����`����r��.����|����#��������������\�� �� ������ ��������������������������� C ���������#���� v��d��w#���d��x#��d��y#m����z#�i����s��x���� #��d�� $#����� %#W���� &#<��P�� '#}��P�� (#��������������Q��X ����� #����� #���� #���� # ���� # V���� #0B���� #8�� �� #@���� #H-���� #P��������� 8�� ��3�� #���9�� #V��9�� # Z��9�� #a��P�� #p��P�� #w��[�� #~��[�� #��[�� #��[�� #�8��D���� V%�� I/��P�� J#�8��P�� K#�<��P�� L#�@��P�� M#�K��P�� Q#��������S��y?����z#�����# {k����#� |m��[��}#���[��}#��[��}#e��[��}#���P��#����3��# ��P��#���P��#���P��#�p��P��#�<��P��#���P��#���P��#�������w��d����e#�����f#�����g#�����h#�����i#��� ��j#�����k#�-����l#�P��0��m#�����n#�)����o#��� ��p#�����q#���r��v#� r��P��s#���P��s#������"���� ������������W#��83����#�i����# k�� ��#� }��[��#�/��[��#;��[��#K��[��#�}��P��#��S��P��# ^�� ��#x��P��#��P��#��P��# ��P��#$����#(�� ��#0� �� ��e��l�� ����#���q��#t����#� ����a ����� ��+ ����X��8 3����#���P��#�� ��# ��8��#����# ����#(� �� ����O ��m����#�����#��t ��#W����#&��P��#/����# H����#$e����#(~����#0����#8��y ��#@��y ��#x��y ��#�� ��#�� ��#�� ��#�� ��#�� ��# �� ��# �� ��# �� ��# �� ��#& �� ��#1 �� ��#= �� ��#L �� ��#] ����# ��f��# ��w��# ����# ����# ����## ����#\ ��P��#k ��P��#v ��H��# ��H��# ��M��# ����#o �� ��# t �� ��#� ����#���P��#��P��# ����#�y ��Q ��#�  ��n��#�����#��� ������ ���� m��[�� #��� �� #�0 m��[�� #� ��\�� #��P�� #���� #,�� �� #2�� �� #<��P�� # E��P�� #$W��h�� #(����� #�n���� #�� [�� ���m��y��`�� =n�� 6���� 7#�}���� 8#��[�� 9#��[�� :#���� ;#���� <#�����-���� 7�� Mm��[�� O#� ��\�� P#��P�� Q#���� R#,�� �� S#2���� T#<��P�� U# E��P�� V#$W��h�� W#(W���� Z#0��P�� \#8��P�� ^#<���� _#@���� a#H��P�� b#L���� c#P���� e#X-���� f#\<���� g#`��G�� h#h���� k#p���� m#x��P�� n#��P�� o#���� p#'��P�� q#5���� s#B���� t#K���� v#V���� w#e���� y#��� ����PP����������K�� a�� x���� #�~���� #���� #���� # �L��W���� �� ��P�� #���P�� #��P�� #��P�� # �y ���� �� ������� ��@ m��[�� #� ��\�� #��P�� #���� #,�� �� #2���� #<��P�� # E��P�� #$W��i�� #(���� #0���� #8�n��z���� 3�� ,��d�� -#�}��d�� .#��[�� /#��[�� 0#���� 1#���� 2#�P�����l ��H ��8@ ��Y��A#�k �� ��B#{ �� ��C# �� ��D# �� ��E#  �� ��F#( �� ��G#0�^��i�� ��7 ��8 ����!#� ��2��$## ��C��'#4 ��T��-#D ����0# Q ����3#(X ����6#0���������� �� ��X9 �� ��:#� ����;#8 ��Y��<#H ��q��=#P�7�������H�������Y�������k�� �� ���|���� ����������� �� ����� �� ���������������������������� ��a �������� ��(����2���-����7��B��/ ��bE �� ��R��W��b�� ��~ ��r ����s#� ����x# ��P��}#����� ��h ��d ����e#��� ��f#}����g#�������- ��pC ��j ����k#�Z ��3��o# l�� ��m#�}����n#�����=��B��M�� ��N ��| ����~#� ����# ����# �� ��#1 ��)��# [ ��Y��#( ����#0 ����#8 ����#@����#H/����#PE��6��#Xm��a��#`����#h����#p����#x����#A����#g��0��#��L��#��r��#����#����#2����#^����#����#��E��#��p��#��� ��d�� ����� ��c�� ��e�� �����4��? ��&9���������������d��j ��2i������������� ��)��������������� ��5����������� ��9�����������������B���������$��3��=)�������A��R��JF�������������l��|��Pq�������������M�����������$����S�����V���������(��_�� ��������� ���������M��^������ �������;��w��`@�� �� ���W����i\����h���m�� ��}����k�������������p����t�������������A��X�������������j��v������H������� ��%����x*������@�������P����zU����[���������{����l����������� �� �������� ��Y��3����#�����#m����# )����#�����1��Z@��3����#�����#�5��@��T��[a��"3����##�P��h��$#�m��x��o��\x������#�����#p��P��#����#�f����f���� h�� ������z�����������������E�������������� ��5 ��������B��6 ������:��e�� x������ q�� ���v��x��Z�� )n���� x������ �� ���n������8 w������ q�� ����0������ ?��������!���������������V��!0��"xI��!��"pS��!��#h��#0��$J��������������#`��%��#X��%��#P��%��#L��%P����%�������������V����"x-�����% ������T������V����"x�����&`������������V��+"x��+31���'������u������V�� (x�� ���)������������V+��8 ��!������G������VN��0��"x�� ��"p��0��#h��0���!P������u������Vo�� ��"x�� ���*������������V��0(x��0���+������������V����(Tm����(P~����,{�� ��$2������������,{������% ������������V����"x��d��"p����"l����#`�����-������1������V��"x�� ��#p��0���'@������f ������V��'(x��'��(p?��'��,h��)0��,`-��*��$]������` ������$n������` ������$n������D ������$������D ������,P��1��$������? ������$������? ������$������: ������,H��8��,@��8��,��8��,��8P����������%p ������������V����"x����"p����#h����#`-����#P����#H��0��$ ������������$ ������������$ ������z ������$ ������z ������#����$ ������u ������$ ������u ������$ ������p ������#����#����#����#��P�������$ ������������$ ������W ������,����, ����$ ������R ������$M ������ ������$M ������ ������$M ������ ������$R ������ ������,����,~����,~����,~��P������$ ������R ������$ ������= ������,~����,~����,~����,~��P������$w ������������$ ������������$ ������������,~�� ��,~ �� ��$ ������������$ ������@������$ ������;������$ ������;������$ ������;������,~�� ��,~�� ��,~�� ��,~�� P������$@������������$E������������,~�� ��,~�� ��,~�� ��,}�� P������������+ ������l������V��(1��(p����(h����(dm�����+������l������V ��V��(x��V��(p ��V��(lm��V��(`��V��,P��X��,HS��Y��$������C������$H������������$H������������$\������������,@��c��$m������������${������������$������������,��g��, ��g��$������������$������*������$������%������$������%������$������%������,��g��,��g��,��g��,��gP������$*������������$/������������,��g��,��g��,~��g��,~��gP�����������$������C������,~��k0��,~��l0��$������������,~����,~����,~����,~��P���$������C������,~��������'p������b������V ��(x����(p ����(h?����,X����$ ������������,P)����$������������$I������������$I������������$]������������$]������������$������������$������������$������������,H����,@����,����,��P�����������$������7������$������������,-�������+p������j������V����(x����(p ����(l0����,X����,T<����$������a������$������a������,H-����$������X������$������X������,@C���������'p������[������V��(x����(p ����,`����$������U������$������U������,X����,TJ��(1�����+`������r������V��@[��(xM��@���+������������V��D��(pP��D��(ht��D��,`S��Fq���%������������V"����"pt��d��"hW����"`S��81��#X^��d���+������ ������V;����(xb�����+ ������������VL��\��(pP��\=1��(ht��\��,`S��^q���+������������V_��.P��(xM��.���+ ������������Vm��$P��(xM��$���+������W������V}��3P��(xM��3���+`������������V��,��(pP��,��(ht��,��(`e��,��,XS��.q���%�������}������V��0��"x�����%������������V����"x��ٓ��"p��ٓ��#h��0���%�������|������V����"pI��ʓ��"h?��ʓ��#Xk��̘���'������ !������V��(xu����(p����,P��G1��,HI����,@����,S����$������ ������$������ ������,��0��,-�����$x ������ ������$ ������ ������$ ������ ������,�� ��,�� ��,�� ��,�� P��������%!�������"������V��w��"x��w��"t��w��#h��y���%�"������V"������V����"x����#p^�����-`"������v"������V��Z"x��Z���0��0��!��26��,I����.#�S����0#�0��0��Z��]v��PU��0��W#�����Y#�� ��[#�����30��q��B1��y ��S1����I E��1��F#��� ��G#����H#�����C�%��4�I? : ; ���I: ; �� : ; �� �I: ; 8 ��$�> ���I��&�I��  : ; ��  : ; �� I�� !�I/ �� $� > ��I' ���I�����' �� : ;�� �I: ;8 ��&��� : ; �� : ; �� : ;�� : ;���I: ;���< ���I' ��4�I: ;  ��4�I: ; �� : ; ��(� ��  : ;��!.@ : ; ' I? ��"� : ; I��#4� : ; I��$ ��%.@ : ; ' I��&.@ : ; ' ? ��'.@ : ;' ��(� : ;I��).�@ : ; ' I? ��*.@ : ;' ? ��+.@ : ;' I��,4� : ;I��-.@ : ; ' ���L����� ������/Users/Mike/Sources/php-src.git/Zend�/usr/include/_types�/usr/include/i386�/usr/include/sys/_types�/Users/Mike/Sources/php-src.git/ext/propro�ext/propro��zend_modules.h���_uint32_t.h���zend_types.h���_uint16_t.h���_uint64_t.h���zend_long.h���_types.h���_size_t.h���zend_ini.h���zend_globals.h���zend_API.h���zend_compile.h���_int64_t.h���zend.h���zend_iterators.h���zend_object_handlers.h���zend_ast.h���php_propro.c���zend_string.h���zend_hash.h���zend_operators.h���zend_alloc.h���php_propro.h����� ��������! 3h*J.Y�r u[�X u�  � uGYY�~ K�� &#Y�2 � uuY�bf @"H#/0�| /h� -!Y��J $$J.YY Z 5;[XY[� 2'$J.YY Z AC3X4XXX@X[[XX3X=XXXFXYYZ\� /JX+T$$XYu�2= !0%"u=X0X%J.XXX4XYYYuY  N/@XYX5�( kuYZgX4<4tt.J.XXXXYXZwY�f 0xuuY=u YYZ�) ut$YK[�~ �x ? .L� =! //& =�[ %tEJ��f ? .Z�f R�t" �  R�{" w 6'L�X  ؒ�' \�c  =YZK�  Z B=X+J.YYY�| $t�5 v�  �Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)�ext/propro/php_propro.c�/Users/Mike/Sources/php-src.git�propro_module_entry�zend_module_entry�_zend_module_entry�size�unsigned short�zend_api�unsigned int�zend_debug�unsigned char�zts�ini_entry�_zend_ini_entry�name�zend_string�_zend_string�gc�zend_refcounted�_zend_refcounted�refcount�uint32_t�u�v�type�zend_uchar�flags�gc_info�uint16_t�type_info�h�zend_ulong�uint64_t�long long unsigned int�len�size_t�__darwin_size_t�long unsigned int�val�char�sizetype�on_modify�int�zend_ini_entry�mh_arg1�mh_arg2�mh_arg3�value�orig_value�displayer�modifiable�orig_modifiable�modified�module_number�deps�_zend_module_dep�rel�version�functions�_zend_function_entry�fname�handler�zend_execute_data�_zend_execute_data�opline�zend_op�_zend_op�op1�znode_op�_znode_op�constant�var�num�opline_num�jmp_offset�op2�result�extended_value�lineno�opcode�op1_type�op2_type�result_type�call�return_value�zval�_zval_struct�zend_value�_zend_value�lval�zend_long�int64_t�long long int�dval�double�counted�str�arr�zend_array�_zend_array�nApplyCount�nIteratorsCount�reserve�nTableMask�arData�Bucket�_Bucket�key�nNumUsed�nNumOfElements�nTableSize�nInternalPointer�nNextFreeElement�pDestructor�dtor_func_t�obj�zend_object�_zend_object�handle�ce�zend_class_entry�_zend_class_entry�parent�ce_flags�default_properties_count�default_static_members_count�default_properties_table�default_static_members_table�static_members_table�function_table�HashTable�properties_info�constants_table�constructor�_zend_function�common�arg_flags�fn_flags�function_name�scope�prototype�num_args�required_num_args�arg_info�zend_arg_info�_zend_arg_info�class_name�type_hint�pass_by_reference�allow_null�zend_bool�is_variadic�op_array�zend_op_array�_zend_op_array�zend_function�this_var�last�opcodes�last_var�T�vars�last_brk_cont�last_try_catch�brk_cont_array�zend_brk_cont_element�_zend_brk_cont_element�start�cont�brk�try_catch_array�zend_try_catch_element�_zend_try_catch_element�try_op�catch_op�finally_op�finally_end�static_variables�filename�line_start�line_end�doc_comment�early_binding�last_literal�literals�cache_size�run_time_cache�reserved�internal_function�zend_internal_function�_zend_internal_function�zend_internal_arg_info�_zend_internal_arg_info�module�destructor�clone�__get�__set�__unset�__isset�__call�__callstatic�__tostring�__debugInfo�serialize_func�unserialize_func�iterator_funcs�zend_class_iterator_funcs�_zend_class_iterator_funcs�funcs�zend_object_iterator_funcs�_zend_object_iterator_funcs�dtor�zend_object_iterator�_zend_object_iterator�std�data�index�valid�get_current_data�get_current_key�move_forward�rewind�invalidate_current�zf_new_iterator�zf_valid�zf_current�zf_key�zf_next�zf_rewind�create_object�get_iterator�interface_gets_implemented�get_static_method�serialize�zend_serialize_data�_zend_serialize_data�unserialize�zend_unserialize_data�_zend_unserialize_data�num_interfaces�num_traits�interfaces�traits�trait_aliases�zend_trait_alias�_zend_trait_alias�trait_method�zend_trait_method_reference�_zend_trait_method_reference�method_name�alias�modifiers�trait_precedences�zend_trait_precedence�_zend_trait_precedence�exclude_from_classes�info�user�internal�builtin_functions�handlers�zend_object_handlers�_zend_object_handlers�offset�free_obj�zend_object_free_obj_t�dtor_obj�zend_object_dtor_obj_t�clone_obj�zend_object_clone_obj_t�read_property�zend_object_read_property_t�write_property�zend_object_write_property_t�read_dimension�zend_object_read_dimension_t�write_dimension�zend_object_write_dimension_t�get_property_ptr_ptr�zend_object_get_property_ptr_ptr_t�get�zend_object_get_t�set�zend_object_set_t�has_property�zend_object_has_property_t�unset_property�zend_object_unset_property_t�has_dimension�zend_object_has_dimension_t�unset_dimension�zend_object_unset_dimension_t�get_properties�zend_object_get_properties_t�get_method�zend_object_get_method_t�call_method�zend_object_call_method_t�get_constructor�zend_object_get_constructor_t�get_class_name�zend_object_get_class_name_t�compare_objects�zend_object_compare_t�cast_object�zend_object_cast_t�count_elements�zend_object_count_elements_t�get_debug_info�zend_object_get_debug_info_t�get_closure�zend_object_get_closure_t�get_gc�zend_object_get_gc_t�do_operation�zend_object_do_operation_t�compare�zend_object_compare_zvals_t�properties�properties_table�res�zend_resource�_zend_resource�ptr�ref�zend_reference�_zend_reference�ast�zend_ast_ref�_zend_ast_ref�zend_ast�_zend_ast�kind�zend_ast_kind�attr�zend_ast_attr�child�zv�func�ww�w1�w2�u1�type_flags�const_flags�u2�var_flags�next�cache_slot�fe_pos�fe_iter_idx�This�called_scope�prev_execute_data�symbol_table�module_startup_func�module_shutdown_func�request_startup_func�request_shutdown_func�info_func�globals_size�globals_ptr�globals_ctor�globals_dtor�post_deactivate_func�module_started�build_id�php_property_proxy_class_entry�php_property_proxy_object_handlers�php_property_proxy_method_entry�zend_function_entry�ai_propro_construct�propro_functions�SUCCESS�FAILURE�EH_NORMAL�EH_SUPPRESS�EH_THROW�php_property_proxy_init�get_referenced_zval�zend_string_copy�php_property_proxy_free�zend_string_release�php_property_proxy_get_class_entry�php_property_proxy_object_new_ex�php_property_proxy_object_new�zm_info_propro�zm_startup_propro�zend_string_init�destroy_obj�set_proxied_value�get_proxied_value�cast_proxied_value�zval_get_type�zend_symtable_del�_zend_handle_numeric_str�_zval_get_string�zend_symtable_find�zval_addref_p�zval_refcount_p�zval_delref_p�zend_symtable_update�get_propro�get_parent_proxied_value�got_value�zim_propro___construct�zend_string_alloc�__zend_malloc�zend_string_forget_hash_val�php_property_proxy_t�php_property_proxy�container�member�php_property_proxy_object_t�php_property_proxy_object�proxy�zo�ZEND_RESULT_CODE�_z1�_z2�_gc�_t�s�o�zend_module�cl_name�persistent�ret�object�parent_value�hash_value�prop_tmp�__z�__zv�proxied_value�proxy_obj�_zv�zs�check_empty�exists�zentry�rv�pz�ht�idx�length�tmp�op�pData�identical�execute_data�zeh�zend_error_handling�handling�zend_error_handling_t�exception�user_handler�/Users/Mike/Sources/php-src.git/ext/propro/php_propro.c�Property proxy support�enabled�Extension version�2.0.0dev�propro�API20141001,NTS,debug�php\PropertyProxy�/Users/Mike/Sources/php-src.git/Zend/zend_hash.h�zval_delref_p�/Users/Mike/Sources/php-src.git/Zend/zend_types.h�(((*(pz)).u1.v.type_flags & (1<<2)) != 0)�zval_refcount_p�(((*(pz)).u1.v.type_flags & (1<<2)) != 0) || (((*(pz)).u1.v.type_flags & (1<<1)) != 0) || (((*(pz)).u1.v.type_flags & (1<<5)) != 0)�zval_addref_p�cast_proxied_value�0�get_propro�__construct�object�member�parent�zS|O!�/Users/Mike/Sources/php-src.git/Zend/zend_string.h�Out of memory ������������������������������������S3���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HSAH������)��� ������������������������������� ������������������������!���"���#���&���U3|T tt"x|+ AE)LTzX0&vyε]D)*_ TGw'vf6LvUxzNPwʍf$޽׈TDW[xֆ,n-1BkPLl��������������(��8��H��X��h��x����������������������(��8��H��X��h��x����������������������(��8�� �����)������;�����,������_�����*-������n����������������%�����������:������N�����U������}�����-�����������.�����������i ������:�����O������+�����6���������������������� �����������P+������{������.����������������������� ,�����������.�����������*������m�����Y-�����������0�����������"����������������������-�����������.����������� �����������������"�����W,�����������%����������������������0����������������������@.������o����������� �����9&������L�����,�����������+�����������L0���������������������� ������HSAH���������� ������������HSAH���������� ������������HSAH���>���|������������������ �������������� ��� ��� ������������������������������!���%���(���+���/���3���5���7���:���;���=���@���A���C���F���I���J���K���N���O���P���R���U���V���X���Z���[���_���c���f���k���m���p���r���s���u���x���y���{���;ȯ-Rީ v#qؼ/`+nK@}͓<]ϱGpx:pş̘cnpܰB**%п4E͒ٓ' K["E!{1ObIlbqi$[$?|=g J 6Y5r5h6R= Xəbl$S4A}b<5t [=]SR0 ,U|5g3?c |$-ﹱ@s 78H~Tu1iK^ VNz_b4*n&8qcP ЉtaI ~Y~hwMAoKaޢ|-啊!'sc5݀y[<+_/u.1cK 0D Ġ3Eo*^)%h!JV1LK�����&��9��L��_��r���������������� ����0��C��V��i��|������������������'��:��M��`��s���������������� ����1��D��W��j��}�������������� �� ��( ��; ��N ��a ��t �� �� �� �� �� �� �� �� �� ��2 ��E ��X ��k ��~ �� �� �� �� �� �� �� �� ��) ��< ��O ��b ��u �� �� �� �� �� �� �� �� �� ��3 ��F ��Y ��l �� �� �� �� �� �� �� �� �� ��* ��= ��P ��c ��v �� �� �� �� �� �� �� ����!��6�����0�������� �����M��������������������������W�������������#���������������$������F�������������C ������������������L�������� �����B������������� �������� �������������������������� ���������������������$������w�����0������������� ��������#��������������������������`�����m�������� ������������� ������������������L��������@�������������? �����)��������x�����x��������r�����[�������� �������������������������������r���������������������������������� �����i��������������P��������� ����� ����������������������������$������l ������������� �����W��������������E����������������������������������� �������������- ��������������������������%�����D���������������������&�������������������������� ����� ��������������������� �������������6�������������j �����Y�������������y ����������������������������������Z�����v�������������G1��������������������� ��������������������������Z�����0��������a��������������������$������`�����P�������������f���������������$�����������(1�������������|���������������$������ ��������������������$������1�������������T�����5��������l����� �������������q��������v�����0�������� �������������(���������������������������������������R�����6�������� �������������j���������������������$�����������+ ���������������������a�����@��������K�������������e����� ������������� �������������n�������������p���������������������/ �����7���������������������������������� �����b���������������������������������������1��������!�����0�������������E�������� �����^�������������z��������o�����m���������������������M������������������x��������A�������������|�����a�������������9��������n�����y������������� ������������������������������������������$������3������������������������������������������������������������������ ������������������������������������������������������D���������������������� ������4����������������������`������v�������������������������������������������������������� ��������������������������������������������������P������%����������������������������P����������������������������J��X���������������� ������b��������������������������������������������������@������&���������������������p ��������������������������� ������L������������������������������������������������p���������������������������p����������������������������p����������������������������`����������������������������������p��������������������������������������������������������P���������������������� ������s����������������������������w���������������������� ����������������������������������w����������������������`�����������������������������������}����������������������������x�����������������������������|�������������������������������������������������!�����������������������������"������V����������������������`"�����������������������������������zR�x ��$������ho��������AC �������$���D���pD��������AC �������$���l���8p4��������AC �������$������Ppv��������AC �������$������p��������AC �������$������ q ��������AC �������$��� ��q��������AC �������$���4��q%��������AC �������$���\��qP��������AC �������,�����qJ�������AC P����$�����tb��������AC �������$�����8u��������AC �������$�����u&�������AC �������$���,��w�������AC �������$���T��P|L�������AC �������$���|��}�������AC �������$�����P�������AC �������$�����(��������AC �������$��������������AC �������$�����ȅ��������AC �������$���D��p��������AC �������$���l����������AC �������$�����P��������AC �������$�����s��������AC �������$�����@w��������AC �������$��� ����������AC �������$���4��0w��������AC �������$���\����������AC �������$������}��������AC �������$�����Xx��������AC �������$�����|��������AC �������$������������AC �������$���$��p��������AC �������$���L��8V��������AC �������$���t��p��������AC �������R"��W��-E"��X��-;"��D��=4"��2��"��[��-!��1��-!��I��-k!����[!��0��-�!��p��-m ��=��-\ ����- ��Q��-����-����-��l��-������/����o��-H����-5��Z��-����-����-����-����-Q��B��-L�� ��@�����9��-������- ����-��M��-��,����K��-��,����%��-5��B��-0��(��$��'����+����B��-��*����'����)����B��-��(����'����&����e��-k��g��-S��%��-��O��-����-����-��J��-��d��-��f��-��%��-L��P��->�����)����-��$��-��F��-���������-����-����-����-]����-(����-����-����-��!��-����-����-U��P��-K�����@����-,��L��-���������-����-��!��-����-o��N��-a�������#��-����-��N��-�������#��-N��"��-��E��-�������Q��-����-����-����-����-[����-v��?��-f��P��-U�����J��=��-9��h��-����- ��E��-���������-��Q��-����-����-e����-I����-1����-����-��!��-B��B��-=�� ��1�����*������F��-���������-��V��-��Q��-��R��-��S��-��T��-��U��-a����-I����-<����-��P��-����� ����-o ����-N ��P��-@ ����� ����- ��m��- ����- ����- ��P��- ����� ����- ����- ����- ����-/ ����- ����- ����- ��Q��- ��q��-X ����-L ����-��P��-���������-����-|����-U����-'��j��-��P��-���������-��;��-`��C��-;����-��������������������������������������\��-*�������� ������������������������������c��-��������������>����n��-o����N��i��=G����-.��]��-�� ����_��-��a��-�� ���� ����`��-�� ��������b��-e��?��-&������^��- ��k��-��G��-�������������a��H��-L����@��Y��-��H��-���������-��P��-����������-�����-W�����-B���G��-������0����0����U0����M0���� 0����0����/����/����/����/����/����/����b/����Z/����Q/����I/����.����.����.����.����I.����A.����.����.����-����-����-����-����b-����Z-����3-����+-����,����,����,����,����`,����X,����,���� ,����+����+����+����+����+����+����Y+����Q+����4+����,+����#+����+����+����*����*����*����*����*����d*����\*����S*����K*����)����)����)����)����)����)����)����)����)����)����)����)����)����)����)����|)����d)����\)���� )����)����(����(����(����(����e(����](���� (����(����'����'����'����'����'����'����'����{'����r'����j'����a'����Y'����0'����('����'����'����'����'����&����&����&����&����&����&����&����&����B&����:&����%����%����%����%����%����%����4%����,%����#%����%����%���� %����%����$����$����$����$����$����$����$����$����$����H$����@$����7$����/$����#����#����#����#����#����#����#����#����#����#����m#����e#����\#����T#���� #����#����"����"����"����"����"����"����"����"����"����"����"����"����#"����"����!����!����!����!����!����!����!����!����y!����q!����h!����`!����W!����O!�����!���� ���� ���� ����r ����j ����O ����G ���� ������������������������^����V����?����7�������� ����������������������������E����=�������������� ���� ��]�� ��G�� ��2�� ��=��� ��&����������*�������5��X��� ��P���A��0��� ��(���4�� ���3����� �����:��p���9��X���8�����7�����.������6���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ���� ��T�� ��|�� ��T|�� ��x�� ��Tx�� ��t�� ��Tt�� ��p�� ��Tp�� ��l�� ��Tl�� ��h�� ��Th�� ��d�� ��Td�� ��`�� ��T`�� ��\�� ��T\�� ��X�� ��TX�� ��T�� ��TT�� ��P�� ��TP�� ��L�� ��TL�� ��H�� ��TH�� ��D�� ��TD�� ��@�� ��T@�� ��<�� ��T<�� ��8�� ��T8�� ��4�� ��T4�� ��0�� ��T0�� ��,�� ��T,�� ��(�� ��T(�� ��$�� ��T$�� �� �� ��T �� ���� ��T�� ���� ��T�� ���� ��T�� ������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T����|����T|����x����Tx����t����Tt����p����Tp����l����Tl����h����Th����d����Td����`����T`����\����T\����X����TX����T����TT����P����TP����L����TL����H����TH����D����TD����@����T@����<����T<����8����T8����4����T4����0����T0����,����T,����(����T(����$����T$���� ����T ��������T��������T��������T��������T���� ����T ��������T��������T���������T���������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T��������T����|����T|����x����Tx����t����Tt����p����Tp����l����Tl����h����Th����d����Td����`����T`����\����T\����X����TX����T����TT����P����TP����L����TL����H����TH����D����TD����@����T@����<����T<����8����T8����4����T4����0����T0����,����T,����(����T(����$����T$���� ����T ��������T��������T��������T��������T����@���� �������������������������`����@���� �������������������������`����@���� �������������������������`����@���� �����������������������������`�����@����� �����������U����yu������\�����������q���� ����������`��������������������w�������� ���������� ������������u����������u����������u������ ����u����������������'����v������/���� ������A�� ��x������b����p������s����p����������p�������������������� ����������p ����������@��������������������!����������������� ����������#�����������.����������=����`������S���� ������g����Ww����������jw�������������������� ����������������������������������������Iw����������Yv����������v����������v������2����v������;����Kv������T����v������\����lw������r��������������w�����������"����������`"����������w����������u�������� ��w����������u����������ww�������� ��x����������w����������w����������w������$�����`������[�����������������������������P�����������������@�� ���x�������������������������������������������&�����������������������������������������������������M���������������������������&�����������������������������������������������������������������C�������������=�������������� �������������f�������������S�������������B�������������1�������������z�������������:�������������1�������������U�����������������������������������������������������k���������������������������Q��������������������������7�����������������������������������������������������p��������������������������Z��������������������������s�����������������������������������������������������������������������������������������������������������������������_php_property_proxy_init�__ecalloc�_php_property_proxy_free�__zval_ptr_dtor�__efree�_free�_php_property_proxy_get_class_entry�_php_property_proxy_object_new_ex�_zend_object_std_init�_object_properties_init�_php_property_proxy_object_new�_zm_info_propro�_php_info_print_table_start�_php_info_print_table_header�_php_info_print_table_row�_php_info_print_table_end�_memset�_zend_new_interned_string�_zend_register_internal_class�_zend_get_std_object_handlers�_memcpy�___memcpy_chk�_zend_object_std_dtor�_zend_update_property�_convert_to_array�_zend_read_property�_convert_to_null�_convert_to_long�_convert_to_double�_convert_to_boolean�_convert_to_object�__convert_to_string�___assert_rtn�__array_init�_zend_long_to_str�__zval_copy_ctor_func�__zend_hash_next_index_insert�_zend_hash_index_del�_zend_hash_del�__zend_handle_numeric_str_ex�__zval_get_string_func�_zend_hash_index_find�_zend_hash_find�__zend_hash_index_update�__zend_hash_update�_is_identical_function�_zend_replace_error_handling�_zend_parse_parameters�_zend_restore_error_handling�__emalloc�_malloc�___stderrp�_fprintf�_exit�_propro_module_entry�L_.str�_get_referenced_zval�_zend_string_copy�_zval_get_type�_zend_string_release�L_.str18�_php_property_proxy_class_entry�_php_property_proxy_object_handlers�L_.str1�L_.str2�L_.str3�L_.str4�_zm_startup_propro�L_.str7�_zend_string_init�_php_property_proxy_method_entry�_unset_dimension�_has_dimension�_write_dimension�_read_dimension�_cast_proxied_value�_get_proxied_value�_set_proxied_value�_destroy_obj�_zend_string_alloc�_get_propro�_get_parent_proxied_value�_got_value�_zval_addref_p�_zend_symtable_update�_zend_symtable_find�L___func__.cast_proxied_value�L_.str12�__zval_get_string�_zval_refcount_p�_zval_delref_p�_zend_symtable_del�__zend_handle_numeric_str�L___func__.zval_addref_p�L_.str9�L_.str10�L___func__.zval_refcount_p�L_.str11�L___func__.zval_delref_p�L_.str8�L___func__.get_propro�_zim_propro___construct�L_.str17�___zend_malloc�_zend_string_forget_hash_val�L_.str19�L_.str5�_propro_functions�L_.str6�L_.str13�_ai_propro_construct�L_.str14�L_.str15�L_.str16��PHP_ARG_ENABLE(propro, whether to enable property proxy support, [ --enable-propro Enable property proxy support]) if test "$PHP_PROPRO" != "no"; then PHP_INSTALL_HEADERS(ext/propro, php_propro.h) PHP_NEW_EXTENSION(propro, php_propro.c, $ext_shared) fi ARG_ENABLE("propro", "for propro support", "no"); if (PHP_PROPRO == "yes") { EXTENSION("propro", "php_propro.c"); AC_DEFINE("HAVE_PROPRO", 1); PHP_INSTALL_HEADERS("ext/propro", "php_propro.h"); } propro# Doxyfile 1.8.5 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Property proxy API" PROJECT_NUMBER = PROJECT_BRIEF = "A facility to manage extension object properties tied to C-struct members" PROJECT_LOGO = OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 ALIASES = TCL_SUBST = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES INLINE_GROUPED_CLASSES = NO INLINE_SIMPLE_STRUCTS = YES TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_PACKAGE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_MEMBERS_CTORS_1ST = NO SORT_GROUP_NAMES = NO SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_FILES = YES SHOW_NAMESPACES = YES FILE_VERSION_FILTER = LAYOUT_FILE = CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- INPUT = php_propro.h INPUT_ENCODING = UTF-8 FILE_PATTERNS = RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = YES SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO HTML_DYNAMIC_SECTIONS = NO HTML_INDEX_NUM_ENTRIES = 100 GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project DOCSET_PUBLISHER_ID = org.doxygen.Publisher DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO GENERATE_QHP = NO QCH_FILE = QHP_NAMESPACE = org.doxygen.Project QHP_VIRTUAL_FOLDER = doc QHP_CUST_FILTER_NAME = QHP_CUST_FILTER_ATTRS = QHP_SECT_FILTER_ATTRS = QHG_LOCATION = GENERATE_ECLIPSEHELP = NO ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO GENERATE_TREEVIEW = YES ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES USE_MATHJAX = NO MATHJAX_FORMAT = HTML-CSS MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest MATHJAX_EXTENSIONS = MATHJAX_CODEFILE = SEARCHENGINE = YES SERVER_BASED_SEARCH = NO EXTERNAL_SEARCH = NO SEARCHENGINE_URL = SEARCHDATA_FILE = searchdata.xml EXTERNAL_SEARCH_ID = EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4 EXTRA_PACKAGES = LATEX_HEADER = LATEX_FOOTER = LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN TSRMLS_C= TSRMLS_D= TSRMLS_CC= TSRMLS_DC= PHP_PROPRO_API= EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration options related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = YES DOT_NUM_THREADS = 0 DOT_FONTNAME = Helvetica DOT_FONTSIZE = 10 DOT_FONTPATH = CLASS_GRAPH = NO COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO UML_LIMIT_NUM_FIELDS = 10 TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = YES CALLER_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png INTERACTIVE_SVG = NO DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES Copyright (c) 2013, Michael Wallner <mike@php.net>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <?xml version="1.0" encoding="UTF-8"?> <package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>propro</name> <channel>pecl.php.net</channel> <summary>Property proxy</summary> <description>A reusable split-off of pecl_http's property proxy API.</description> <lead> <name>Michael Wallner</name> <user>mike</user> <email>mike@php.net</email> <active>yes</active> </lead> <date>2013-12-05</date> <version> <release>1.0.1</release> <api>1.0.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> <license>BSD, revised</license> <notes><![CDATA[ * Internals documentation at http://php.github.io/php/pecl-php-propro ]]></notes> <contents> <dir name="/"> <file role="doc" name="CREDITS" /> <file role="doc" name="LICENSE" /> <file role="doc" name="Doxyfile" /> <file role="src" name="config.m4" /> <file role="src" name="config.w32" /> <file role="src" name="php_propro.h" /> <file role="src" name="php_propro.c" /> <dir name="tests"> <file role="test" name="001.phpt" /> <file role="test" name="002.phpt" /> </dir> </dir> </contents> <dependencies> <required> <php> <min>5.3</min> </php> <pearinstaller> <min>1.4.0</min> </pearinstaller> </required> </dependencies> <providesextension>propro</providesextension> <extsrcrelease> <configureoption default="yes" name="enable-propro" prompt="whether to enable property proxy support" /> </extsrcrelease> </package> /* +--------------------------------------------------------------------+ | PECL :: propro | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2013 Michael Wallner <mike@php.net> | +--------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <php.h> #include <ext/standard/info.h> #include "php_propro.h" #define DEBUG_PROPRO 0 static inline zval *get_referenced_zval(zval *ref) { while (Z_ISREF_P(ref)) { ref = Z_REFVAL_P(ref); } return ref; } php_property_proxy_t *php_property_proxy_init(zval *container, zend_string *member) { php_property_proxy_t *proxy = ecalloc(1, sizeof(*proxy)); ZVAL_COPY(&proxy->container, get_referenced_zval(container)); proxy->member = zend_string_copy(member); return proxy; } void php_property_proxy_free(php_property_proxy_t **proxy) { if (*proxy) { zval_ptr_dtor(&(*proxy)->container); zend_string_release((*proxy)->member); efree(*proxy); *proxy = NULL; } } static zend_class_entry *php_property_proxy_class_entry; static zend_object_handlers php_property_proxy_object_handlers; zend_class_entry *php_property_proxy_get_class_entry(void) { return php_property_proxy_class_entry; } static inline php_property_proxy_object_t *get_propro(zval *object); static zval *get_parent_proxied_value(zval *object, zval *return_value); static zval *get_proxied_value(zval *object, zval *return_value); static zval *read_dimension(zval *object, zval *offset, int type, zval *return_value); static ZEND_RESULT_CODE cast_proxied_value(zval *object, zval *return_value, int type); static void write_dimension(zval *object, zval *offset, zval *value); static void set_proxied_value(zval *object, zval *value); #if DEBUG_PROPRO /* we do not really care about TS when debugging */ static int level = 1; static const char space[] = " "; static const char *inoutstr[] = {"< return","="," > enter"}; static void _walk(php_property_proxy_object_t *obj) { if (obj) { if (!Z_ISUNDEF(obj->parent)) { _walk(get_propro(&obj->parent)); } if (obj->proxy) { fprintf(stderr, ".%s", obj->proxy->member->val); } } } static void debug_propro(int inout, const char *f, php_property_proxy_object_t *obj, zval *offset, zval *value TSRMLS_DC) { fprintf(stderr, "#PP %p %s %s %s ", obj, &space[sizeof(space)-level], inoutstr[inout+1], f); level += inout; _walk(obj); if (*f++=='d' && *f++=='i' && *f++=='m' ) { char *offset_str = "[]"; zval *o = offset; if (o) { convert_to_string_ex(o); offset_str = Z_STRVAL_P(o); } fprintf(stderr, ".%s", offset_str); if (o && o != offset) { zval_ptr_dtor(o); } } if (value && !Z_ISUNDEF_P(value)) { const char *t[] = { "UNDEF", "NULL", "FALSE", "TRUE", "int", "float", "string", "Array", "Object", "resource", "reference", "constant", "constant AST", "_BOOL", "callable", "indirect", "---", "pointer" }; fprintf(stderr, " = (%s) ", t[Z_TYPE_P(value)&0xf]); if (!Z_ISUNDEF_P(value) && Z_TYPE_P(value) != IS_INDIRECT) { zend_print_flat_zval_r(value TSRMLS_CC); } } fprintf(stderr, "\n"); } #else #define debug_propro(l, f, obj, off, val) #endif php_property_proxy_object_t *php_property_proxy_object_new_ex( zend_class_entry *ce, php_property_proxy_t *proxy) { php_property_proxy_object_t *o; if (!ce) { ce = php_property_proxy_class_entry; } o = ecalloc(1, sizeof(*o) + sizeof(zval) * (ce->default_properties_count - 1)); zend_object_std_init(&o->zo, ce); object_properties_init(&o->zo, ce); o->proxy = proxy; o->zo.handlers = &php_property_proxy_object_handlers; debug_propro(0, "init", o, NULL, NULL); return o; } zend_object *php_property_proxy_object_new(zend_class_entry *ce) { return &php_property_proxy_object_new_ex(ce, NULL)->zo; } static void destroy_obj(zend_object *object) { php_property_proxy_object_t *o = PHP_PROPRO_PTR(object); debug_propro(0, "dtor", o, NULL, NULL); if (o->proxy) { php_property_proxy_free(&o->proxy); } if (!Z_ISUNDEF(o->parent)) { zval_ptr_dtor(&o->parent); ZVAL_UNDEF(&o->parent); } zend_object_std_dtor(object); } static inline php_property_proxy_object_t *get_propro(zval *object) { object = get_referenced_zval(object); switch (Z_TYPE_P(object)) { case IS_OBJECT: break; EMPTY_SWITCH_DEFAULT_CASE(); } return PHP_PROPRO_PTR(Z_OBJ_P(object)); } static inline zend_bool got_value(zval *container, zval *value) { zval identical; if (!Z_ISUNDEF_P(value)) { if (SUCCESS == is_identical_function(&identical, value, container)) { if (Z_TYPE(identical) != IS_TRUE) { return 1; } } } return 0; } static zval *get_parent_proxied_value(zval *object, zval *return_value) { php_property_proxy_object_t *obj; obj = get_propro(object); debug_propro(1, "parent_get", obj, NULL, NULL); if (obj->proxy) { if (!Z_ISUNDEF(obj->parent)) { get_proxied_value(&obj->parent, return_value); } } debug_propro(-1, "parent_get", obj, NULL, return_value); return return_value; } static zval *get_proxied_value(zval *object, zval *return_value) { zval *hash_value, *ref, prop_tmp; php_property_proxy_object_t *obj; obj = get_propro(object); debug_propro(1, "get", obj, NULL, NULL); if (obj->proxy) { if (!Z_ISUNDEF(obj->parent)) { zval parent_value; ZVAL_UNDEF(&parent_value); get_parent_proxied_value(object, &parent_value); if (got_value(&obj->proxy->container, &parent_value)) { zval_ptr_dtor(&obj->proxy->container); ZVAL_COPY(&obj->proxy->container, &parent_value); } } ref = get_referenced_zval(&obj->proxy->container); switch (Z_TYPE_P(ref)) { case IS_OBJECT: RETVAL_ZVAL(zend_read_property(Z_OBJCE_P(ref), ref, obj->proxy->member->val, obj->proxy->member->len, 0, &prop_tmp), 0, 0); break; case IS_ARRAY: hash_value = zend_symtable_find(Z_ARRVAL_P(ref), obj->proxy->member); if (hash_value) { RETVAL_ZVAL(hash_value, 0, 0); } break; } } debug_propro(-1, "get", obj, NULL, return_value); return return_value; } static ZEND_RESULT_CODE cast_proxied_value(zval *object, zval *return_value, int type) { get_proxied_value(object, return_value); debug_propro(0, "cast", get_propro(object), NULL, return_value); if (!Z_ISUNDEF_P(return_value)) { convert_to_explicit_type_ex(return_value, type); return SUCCESS; } return FAILURE; } static void set_proxied_value(zval *object, zval *value) { php_property_proxy_object_t *obj; zval *ref; obj = get_propro(object); debug_propro(1, "set", obj, NULL, value TSRMLS_CC); if (obj->proxy) { if (!Z_ISUNDEF(obj->parent)) { zval parent_value; ZVAL_UNDEF(&parent_value); get_parent_proxied_value(object, &parent_value); if (got_value(&obj->proxy->container, &parent_value)) { zval_ptr_dtor(&obj->proxy->container); ZVAL_COPY(&obj->proxy->container, &parent_value); } } ref = get_referenced_zval(&obj->proxy->container); switch (Z_TYPE_P(ref)) { case IS_OBJECT: zend_update_property(Z_OBJCE_P(ref), ref, obj->proxy->member->val, obj->proxy->member->len, value); break; default: convert_to_array(ref); /* no break */ case IS_ARRAY: Z_TRY_ADDREF_P(value); zend_symtable_update(Z_ARRVAL_P(ref), obj->proxy->member, value); break; } if (!Z_ISUNDEF(obj->parent)) { set_proxied_value(&obj->parent, &obj->proxy->container); } } debug_propro(-1, "set", obj, NULL, NULL); } static zval *read_dimension(zval *object, zval *offset, int type, zval *return_value) { zval proxied_value; zend_string *member = offset ? zval_get_string(offset) : NULL; debug_propro(1, type == BP_VAR_R ? "dim_read" : "dim_read_ref", get_propro(object), offset, NULL); ZVAL_UNDEF(&proxied_value); get_proxied_value(object, &proxied_value); if (BP_VAR_R == type && member && !Z_ISUNDEF(proxied_value)) { if (Z_TYPE(proxied_value) == IS_ARRAY) { zval *hash_value = zend_symtable_find(Z_ARRVAL(proxied_value), member); if (hash_value) { RETVAL_ZVAL(hash_value, 1, 0); } } } else { php_property_proxy_t *proxy; php_property_proxy_object_t *proxy_obj; if (!Z_ISUNDEF(proxied_value)) { convert_to_array(&proxied_value); Z_ADDREF(proxied_value); } else { array_init(&proxied_value); set_proxied_value(object, &proxied_value); } if (!member) { member = zend_long_to_str(zend_hash_next_free_element( Z_ARRVAL(proxied_value))); } proxy = php_property_proxy_init(&proxied_value, member); zval_ptr_dtor(&proxied_value); proxy_obj = php_property_proxy_object_new_ex(NULL, proxy); ZVAL_COPY(&proxy_obj->parent, object); RETVAL_OBJ(&proxy_obj->zo); } if (member) { zend_string_release(member); } debug_propro(-1, type == BP_VAR_R ? "dim_read" : "dim_read_ref", get_propro(object), offset, return_value); return return_value; } static int has_dimension(zval *object, zval *offset, int check_empty) { zval proxied_value; int exists = 0; debug_propro(1, "dim_exists", get_propro(object), offset, NULL); ZVAL_UNDEF(&proxied_value); get_proxied_value(object, &proxied_value); if (Z_ISUNDEF(proxied_value)) { exists = 0; } else { zend_string *zs = zval_get_string(offset); if (Z_TYPE(proxied_value) == IS_ARRAY) { zval *zentry = zend_symtable_find(Z_ARRVAL(proxied_value), zs); if (!zentry) { exists = 0; } else { if (check_empty) { exists = !Z_ISNULL_P(zentry); } else { exists = 1; } } } zend_string_release(zs); } debug_propro(-1, "dim_exists", get_propro(object), offset, NULL); return exists; } static void write_dimension(zval *object, zval *offset, zval *value) { zval proxied_value; debug_propro(1, "dim_write", get_propro(object), offset, value); ZVAL_UNDEF(&proxied_value); get_proxied_value(object, &proxied_value); if (!Z_ISUNDEF(proxied_value)) { if (Z_TYPE(proxied_value) == IS_ARRAY) { Z_ADDREF(proxied_value); } else { convert_to_array(&proxied_value); } } else { array_init(&proxied_value); } SEPARATE_ZVAL(value); Z_TRY_ADDREF_P(value); if (offset) { zend_string *zs = zval_get_string(offset); zend_symtable_update(Z_ARRVAL(proxied_value), zs, value); zend_string_release(zs); } else { zend_hash_next_index_insert(Z_ARRVAL(proxied_value), value); } set_proxied_value(object, &proxied_value); debug_propro(-1, "dim_write", get_propro(object), offset, &proxied_value); zval_ptr_dtor(&proxied_value); } static void unset_dimension(zval *object, zval *offset) { zval proxied_value; debug_propro(1, "dim_unset", get_propro(object), offset, NULL); ZVAL_UNDEF(&proxied_value); get_proxied_value(object, &proxied_value); if (Z_TYPE(proxied_value) == IS_ARRAY) { zval *o = offset; ZEND_RESULT_CODE rv; convert_to_string_ex(o); rv = zend_symtable_del(Z_ARRVAL(proxied_value), Z_STR_P(o)); if (SUCCESS == rv) { set_proxied_value(object, &proxied_value); } if (o != offset) { zval_ptr_dtor(o); } } debug_propro(-1, "dim_unset", get_propro(object), offset, &proxied_value); } ZEND_BEGIN_ARG_INFO_EX(ai_propro_construct, 0, 0, 2) ZEND_ARG_INFO(1, object) ZEND_ARG_INFO(0, member) ZEND_ARG_OBJ_INFO(0, parent, php\\PropertyProxy, 1) ZEND_END_ARG_INFO(); static PHP_METHOD(propro, __construct) { zend_error_handling zeh; zval *container, *parent = NULL; zend_string *member; zend_replace_error_handling(EH_THROW, NULL, &zeh); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "zS|O!", &container, &member, &parent, php_property_proxy_class_entry)) { php_property_proxy_object_t *obj; zval *ref = get_referenced_zval(container); switch (Z_TYPE_P(ref)) { case IS_OBJECT: case IS_ARRAY: break; default: convert_to_array(ref); } obj = get_propro(getThis()); obj->proxy = php_property_proxy_init(container, member); if (parent) { ZVAL_COPY(&obj->parent, parent); } } zend_restore_error_handling(&zeh); } static const zend_function_entry php_property_proxy_method_entry[] = { PHP_ME(propro, __construct, ai_propro_construct, ZEND_ACC_PUBLIC) {0} }; static PHP_MINIT_FUNCTION(propro) { zend_class_entry ce = {0}; INIT_NS_CLASS_ENTRY(ce, "php", "PropertyProxy", php_property_proxy_method_entry); php_property_proxy_class_entry = zend_register_internal_class(&ce); php_property_proxy_class_entry->create_object = php_property_proxy_object_new; php_property_proxy_class_entry->ce_flags |= ZEND_ACC_FINAL; memcpy(&php_property_proxy_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_property_proxy_object_handlers.offset = XtOffsetOf(php_property_proxy_object_t, zo); php_property_proxy_object_handlers.free_obj = destroy_obj; php_property_proxy_object_handlers.set = set_proxied_value; php_property_proxy_object_handlers.get = get_proxied_value; php_property_proxy_object_handlers.cast_object = cast_proxied_value; php_property_proxy_object_handlers.read_dimension = read_dimension; php_property_proxy_object_handlers.write_dimension = write_dimension; php_property_proxy_object_handlers.has_dimension = has_dimension; php_property_proxy_object_handlers.unset_dimension = unset_dimension; return SUCCESS; } PHP_MINFO_FUNCTION(propro) { php_info_print_table_start(); php_info_print_table_header(2, "Property proxy support", "enabled"); php_info_print_table_row(2, "Extension version", PHP_PROPRO_VERSION); php_info_print_table_end(); } static const zend_function_entry propro_functions[] = { {0} }; zend_module_entry propro_module_entry = { STANDARD_MODULE_HEADER, "propro", propro_functions, PHP_MINIT(propro), NULL, NULL, NULL, PHP_MINFO(propro), PHP_PROPRO_VERSION, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_PROPRO ZEND_GET_MODULE(propro) #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ /* +--------------------------------------------------------------------+ | PECL :: propro | +--------------------------------------------------------------------+ | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ | Copyright (c) 2013 Michael Wallner <mike@php.net> | +--------------------------------------------------------------------+ */ #ifndef PHP_PROPRO_H #define PHP_PROPRO_H #ifndef DOXYGEN extern zend_module_entry propro_module_entry; #define phpext_propro_ptr &propro_module_entry #define PHP_PROPRO_VERSION "2.0.0dev" #ifdef PHP_WIN32 # define PHP_PROPRO_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_PROPRO_API extern __attribute__ ((visibility("default"))) #else # define PHP_PROPRO_API extern #endif #ifdef ZTS # include <TSRM/TSRM.h> #endif #define PHP_PROPRO_PTR(zo) (void*)(((char*)(zo))-(zo)->handlers->offset) #endif /* DOXYGEN */ /** * The internal property proxy. * * Container for the object/array holding the proxied property. */ struct php_property_proxy { /** The container holding the property */ zval container; /** The name of the proxied property */ zend_string *member; }; typedef struct php_property_proxy php_property_proxy_t; /** * The userland object. * * Return an object instance of php\\PropertyProxy to make your C-struct * member accessible by reference from PHP userland. * * Example: * ~~~~~~~~~~{.c} * static zval *my_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp) * { * zval *return_value; * zend_string *member_name = zval_get_string(member); * my_prophandler_t *handler = my_get_prophandler(member_name); * * if (!handler || type == BP_VAR_R || type == BP_VAR_IS) { * return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp); * * if (handler) { * handler->read(object, tmp); * * zval_ptr_dtor(return_value); * ZVAL_COPY_VALUE(return_value, tmp); * } * } else { * return_value = php_property_proxy_zval(object, member_name); * } * * zend_string_release(member_name); * * return return_value; * } * ~~~~~~~~~~ */ struct php_property_proxy_object { /** The actual property proxy */ php_property_proxy_t *proxy; /** Any parent property proxy object */ zval parent; /** The std zend_object */ zend_object zo; }; typedef struct php_property_proxy_object php_property_proxy_object_t; PHP_PROPRO_API php_property_proxy_object_t *php_property_proxy_object_new_ex( zend_class_entry *ce, php_property_proxy_t *proxy); PHP_PROPRO_API zend_object *php_property_proxy_object_new(zend_class_entry *ce); /** * Create a property proxy * * The property proxy will forward reads and writes to itself to the * proxied property with name \a member_str of \a container. * * @param container the container holding the property * @param member the name of the proxied property * @return a new property proxy */ PHP_PROPRO_API php_property_proxy_t *php_property_proxy_init(zval *container, zend_string *member); /** * Destroy and free a property proxy. * * The destruction of the property proxy object calls this. * * @param proxy a pointer to the allocated property proxy */ PHP_PROPRO_API void php_property_proxy_free(php_property_proxy_t **proxy); /** * Get the zend_class_entry of php\\PropertyProxy * @return the class entry pointer */ PHP_PROPRO_API zend_class_entry *php_property_proxy_get_class_entry(void); #endif /* PHP_PROPRO_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ # pecl/propro ## About: The "Property Proxy" extension provides a fairly transparent proxy for internal object properties hidden in custom non-zval implementations. ## Installation: This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command: # pecl install propro Also, watch out for self-installing [pharext](https://github.com/m6w6/pharext) packages attached to [releases](https://github.com/m6w6/ext-propro/releases). ## Internals: > ***NOTE:*** This extension mostly only provides infrastructure for other extensions. See the [API docs here](http://m6w6.github.io/ext-propro/). ## Documentation Userland documentation can be found at http://devel-m6w6.rhcloud.com/mdref/propro --TEST-- property proxy --SKIPIF-- <?php if (!extension_loaded("propro")) print "skip"; ?> --FILE-- <?php echo "Test\n"; class c { private $prop; private $anon; function __get($p) { return new php\PropertyProxy($this, $p); } } $c = new c; $p = $c->prop; $a = $c->anon; var_dump($c); echo "set\n"; $a = 123; echo "get\n"; echo $a,"\n"; $p["foo"] = 123; $p["bar"]["baz"]["a"]["b"]=987; var_dump($c); ?> DONE --EXPECTF-- Test object(c)#%d (2) { ["prop":"c":private]=> NULL ["anon":"c":private]=> NULL } set get 123 object(c)#%d (2) { ["prop":"c":private]=> array(2) { ["foo"]=> int(123) ["bar"]=> array(1) { ["baz"]=> array(1) { ["a"]=> array(1) { ["b"]=> int(987) } } } } ["anon":"c":private]=> int(123) } DONE --TEST-- property proxy --SKIPIF-- <?php if (!extension_loaded("propro")) print "skip"; ?> --FILE-- <?php echo "Test\n"; class c { private $storage = array(); function __get($p) { return new php\PropertyProxy($this->storage, $p); } function __set($p, $v) { $this->storage[$p] = $v; } } $c = new c; $c->data["foo"] = 1; var_dump( isset($c->data["foo"]), isset($c->data["bar"]) ); var_dump($c); $c->data[] = 1; $c->data[] = 2; $c->data[] = 3; $c->data["bar"][] = 123; $c->data["bar"][] = 456; var_dump($c); unset($c->data["bar"][0]); var_dump($c); ?> DONE --EXPECTF-- Test bool(true) bool(false) object(c)#%d (1) { ["storage":"c":private]=> array(1) { ["data"]=> array(1) { ["foo"]=> int(1) } } } object(c)#%d (1) { ["storage":"c":private]=> array(1) { ["data"]=> array(5) { ["foo"]=> int(1) [0]=> int(1) [1]=> int(2) [2]=> int(3) ["bar"]=> array(2) { [0]=> int(123) [1]=> int(456) } } } } object(c)#%d (1) { ["storage":"c":private]=> array(1) { ["data"]=> array(5) { ["foo"]=> int(1) [0]=> int(1) [1]=> int(2) [2]=> int(3) ["bar"]=> array(1) { [1]=> int(456) } } } } DONE --TEST-- property proxy --SKIPIF-- <?php extension_loaded("propro") || print "skip"; ?> --FILE-- <?php echo "Test\n"; class t { private $ref; function __get($v) { return new php\PropertyProxy($this, $v); } } $t = new t; $r = &$t->ref; $r = 1; var_dump($t); $t->ref[] = 2; var_dump($t); ?> ===DONE=== --EXPECTF-- Test object(t)#%d (1) { ["ref":"t":private]=> int(1) } object(t)#%d (1) { ["ref":"t":private]=> array(2) { [0]=> int(1) [1]=> int(2) } } ===DONE===\fp8VZhM���GBMB