From ca64c4f49cfe1c568c4019fc0a19da39cad28d5c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 5 Nov 2013 12:14:13 +0100 Subject: [PATCH] flush --- php/PropertyProxy.md | 11 ++++ php/PropertyProxy/__construct.md | 97 ++++++++++++++++++++++++++++++++ propro.md | 9 +++ 3 files changed, 117 insertions(+) create mode 100644 php/PropertyProxy.md create mode 100644 php/PropertyProxy/__construct.md create mode 100644 propro.md diff --git a/php/PropertyProxy.md b/php/PropertyProxy.md new file mode 100644 index 0000000..5e82e3e --- /dev/null +++ b/php/PropertyProxy.md @@ -0,0 +1,11 @@ +# final class php\PropertyProxy + +This is the user-land visible PropertyProxy class. + +## Constants: + +None. + +## Properties: + +None. diff --git a/php/PropertyProxy/__construct.md b/php/PropertyProxy/__construct.md new file mode 100644 index 0000000..747e8c1 --- /dev/null +++ b/php/PropertyProxy/__construct.md @@ -0,0 +1,97 @@ +# void php\PropertyProxy::__construct(mixed &$object, string $member[, php\PropertyProxy $parent = NLL]) + +Create a new property proxy for the property $member of $object. + +## Params: + +* mixed reference &$object + The storage from which to reference the property. +* string $member + The name of the property to reference. +* php\PropertyProxy $parent = NULL + Any parent property proxy. + +## Example: + + 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($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); + +Yields: + + object(c)#1 (1) { + ["storage":"c":private]=> + array(1) { + ["data"]=> + array(1) { + ["foo"]=> + int(1) + } + } + } + object(c)#1 (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)#1 (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) + } + } + } + } diff --git a/propro.md b/propro.md new file mode 100644 index 0000000..bd01503 --- /dev/null +++ b/propro.md @@ -0,0 +1,9 @@ +# pecl/propro + +## About: + +The "Property Proxy" extension provides a fairly transparent proxy for internal object properties hidden in custom non-zval implementations. + +> **Note:** This extension mostly only provides infrastructure for other extensions. + +See the php\PropertyProxy class, for the user-land visible part of the implementation. -- 2.30.2