Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- /**
- * ILLI
- *
- * @category ILLI_System
- * @package ILLI
- * @link http://illi.be
- * @license http://l.illi.be
- * @copyright ILLI Conference
- */
- NAMESPACE ILLI\System;
- USE Serializable;
- /**
- * ILLI Object
- *
- * @category ILLI_System
- * @package ILLI
- * @subpackage System
- * @namespace ILLI\System
- * @link http://illi.be
- * @license http://l.illi.be
- * @copyright ILLI Conference
- * @since 2.0.1
- * @version 3.0.1
- */
- CLASS Object IMPLEMENTS Serializable
- {
- USE tSplHashRegister
- {
- tSplHashRegister_getCode as getHashCode;
- tSplHashRegister_getInstances as getSplInstances;
- tSplHashRegister_getSiblings as getSplSiblingInstances;
- tSplHashRegister___register as __registerSpl;
- tSplHashRegister___unregister as __unregisterSpl;
- }
- USE tAdapter
- {
- tAdapter_registerTrigger as adapterRegisterTrigger;
- tAdapter_registerTriggerMethod as adapterRegisterTriggerMethod;
- tAdapter_registerTriggerStaticMethod as adapterRegisterTriggerStaticMethod;
- tAdapter_registerTriggerClosure as adapterRegisterTriggerClosure;
- tAdapter_unregisterTrigger as adapterUnregisterTrigger;
- tAdapter_callAlias as adapterCallAlias;
- tAdapter_triggerExists as adapterTriggerExists;
- }
- USE tObserver
- {
- tObserver_registerEvent as observerRegisterEvent;
- tObserver_registerEventMethod as observerRegisterEventMethod;
- tObserver_registerEventStaticMethod as observerRegisterEventStaticMethod;
- tObserver_registerEventClosure as observerRegisterEventClosure;
- tObserver_unregisterEvent as observerUnregisterEvent;
- tObserver_notify as observerNotify;
- tObserver_eventExists as observerEventExists;
- }
- USE tFilter
- {
- tFilter_registerEvent as filterRegisterEvent;
- tFilter_registerEventMethod as filterRegisterEventMethod;
- tFilter_registerEventStaticMethod as filterRegisterEventStaticMethod;
- tFilter_registerEventClosure as filterRegisterEventClosure;
- tFilter_unregisterTrigger as filterUnregisterEvent;
- tFilter_triggerExists as filterTriggerExists;
- tFilter_applyFilter as filterApply;
- }
- USE tSerializable
- {
- tSerializable_serialize as serialize;
- tSerializable_unserialize as unserialize;
- tSerializable___sleep as __sleep;
- tSerializable___set_state as __set_state;
- tSerializable___registerSerializableProperty as __serializableRegister;
- }
- protected $__Collection = NULL;
- public function randomize($arg)
- {
- (TRUE === $this->adapterTriggerExists(__METHOD__))
- ? $this->adapterCallAlias(__METHOD__, $arg)
- : var_dump(__METHOD__.'->'.$arg);
- }
- public function __set($index, $value)
- {
- $foo = $this->filterApply('args', __METHOD__, array('index' => $index, 'value' => $value));
- $index = $foo['index'];
- $value = $foo['value'];
- $this->__Collection->offsetSet($index, $value);
- $this->observerNotify(__METHOD__, $index, $value);
- }
- public function __construct()
- {
- $this->__serializableRegister('__Collection');
- $this->__registerSpl();
- $this->__Collection = new Collection;
- //$this->adapterRegisterTriggerStaticMethod('\ILLI\System\Object::randomize', 'ILLI\System\Foo::bar');
- //$this->observerRegisterEventStaticMethod('foo', 'ILLI\System\Object::randomize');
- //$this->observerNotify('foo', 'notify');
- //$this->randomize('foobar');
- $this->filterRegisterEventMethod('args', __CLASS__.'::__set', 'ILLI\System\Foo::findex');
- $this->filterRegisterEventMethod('args', __CLASS__.'::__set', 'ILLI\System\Foo::toUpper');
- //throw new \Exception('Test!');
- /*
- \ILLI\Boot\ErrorHandler::config
- (
- array
- (
- array
- (
- //'code' => E_ALL | E_PARSE | E_STRICT | E_DEPRECATED | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE
- //'type' => 'Exception',
- 'handler' => function($info) use ($self) { $self->errors[] = $info; }
- )
- )
- );
- \ILLI\Boot\ErrorHandler::handle(new \Exception('Test!'));
- */
- /*
- \ILLI\Boot\ErrorHandler::config
- (
- array
- (
- array
- (
- //'code' => E_ALL | E_PARSE | E_STRICT | E_DEPRECATED | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE
- //'type' => 'Exception',
- 'handler' => function($info) use ($self) { $self->errors[] = $info; }
- )
- )
- );
- \ILLI\Boot\ErrorHandler::handle(new \Exception('Test!'));
- */
- }
- }
- // ...
- $foo = new \ILLI\System\UUID;
- $foo->baz = 'bar';
- var_dump(unserialize(serialize($foo)));
- object(ILLI\System\UUID)#34 (12) {
- ["__value":"ILLI\System\UUID":private]=>
- string(0) ""
- ["__Collection":protected]=>
- object(ILLI\System\Collection)#47 (6) {
- ["__data":"ILLI\System\Collection":private]=>
- array(1) {
- ["***ILLI\System\Foo::findex->baz***"]=>
- string(3) "BAR"
- }
- ["__offsets":"ILLI\System\Collection":private]=>
- array(1) {
- [0]=>
- string(34) "***ILLI\System\Foo::findex->baz***"
- }
- ["__indexes":"ILLI\System\Collection":private]=>
- array(1) {
- ["***ILLI\System\Foo::findex->baz***"]=>
- int(0)
- }
- ["__iteratorIndex":"ILLI\System\Collection":private]=>
- int(0)
- ["__lastOffsetUpdate":"ILLI\System\Collection":private]=>
- string(34) "***ILLI\System\Foo::findex->baz***"
- ["__lastOffsetInsert":"ILLI\System\Collection":private]=>
- NULL
- }
- ["__splHashRegisterAddress":"ILLI\System\Object":private]=>
- string(32) "000000004247f66c00000000026382bc"
- ["__adapterTracesEnabled":"ILLI\System\Object":private]=>
- bool(false)
- ["__adapterTraces":"ILLI\System\Object":private]=>
- array(0) {
- }
- ["__adapters":protected]=>
- array(0) {
- }
- ["__observerTracesEnabled":"ILLI\System\Object":private]=>
- bool(false)
- ["__observerTraces":"ILLI\System\Object":private]=>
- array(0) {
- }
- ["__observers":protected]=>
- array(0) {
- }
- ["__filterTracesEnabled":"ILLI\System\Object":private]=>
- bool(false)
- ["__filterTraces":"ILLI\System\Object":private]=>
- array(0) {
- }
- ["__filters":protected]=>
- array(1) {
- ["ILLI\System\Object::__set"]=>
- array(2) {
- [0]=>
- object(ILLI\System\FilterAlias)#48 (3) {
- ["__event":"ILLI\System\FilterAlias":private]=>
- string(4) "args"
- ["__TRIGGER":"ILLI\System\FilterAlias":private]=>
- object(ILLI\System\Method)#49 (3) {
- ["__class":protected]=>
- string(18) "ILLI\System\Object"
- ["__function":protected]=>
- string(5) "__set"
- ["__method":protected]=>
- string(25) "ILLI\System\Object::__set"
- }
- ["__FILTER":"ILLI\System\FilterAlias":private]=>
- object(ILLI\System\InvokeMethod)#50 (1) {
- ["__callable":protected]=>
- object(ILLI\System\Method)#51 (3) {
- ["__class":protected]=>
- string(15) "ILLI\System\Foo"
- ["__function":protected]=>
- string(6) "findex"
- ["__method":protected]=>
- string(23) "ILLI\System\Foo::findex"
- }
- }
- }
- [1]=>
- object(ILLI\System\FilterAlias)#52 (3) {
- ["__event":"ILLI\System\FilterAlias":private]=>
- string(4) "args"
- ["__TRIGGER":"ILLI\System\FilterAlias":private]=>
- object(ILLI\System\Method)#53 (3) {
- ["__class":protected]=>
- string(18) "ILLI\System\Object"
- ["__function":protected]=>
- string(5) "__set"
- ["__method":protected]=>
- string(25) "ILLI\System\Object::__set"
- }
- ["__FILTER":"ILLI\System\FilterAlias":private]=>
- object(ILLI\System\InvokeMethod)#54 (1) {
- ["__callable":protected]=>
- object(ILLI\System\Method)#55 (3) {
- ["__class":protected]=>
- string(15) "ILLI\System\Foo"
- ["__function":protected]=>
- string(7) "toUpper"
- ["__method":protected]=>
- string(24) "ILLI\System\Foo::toUpper"
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement