diff options
Diffstat (limited to 'framework/Util')
-rw-r--r-- | framework/Util/TBehavior.php | 87 | ||||
-rw-r--r-- | framework/Util/TCallChain.php | 147 | ||||
-rw-r--r-- | framework/Util/TClassBehavior.php | 36 | ||||
-rw-r--r-- | framework/Util/TDataFieldAccessor.php | 4 | ||||
-rw-r--r-- | framework/Util/TDateTimeStamp.php | 5 | ||||
-rw-r--r-- | framework/Util/TLogRouter.php | 18 | ||||
-rw-r--r-- | framework/Util/TLogger.php | 4 | ||||
-rw-r--r-- | framework/Util/TParameterModule.php | 4 | ||||
-rw-r--r-- | framework/Util/TSimpleDateFormatter.php | 4 | ||||
-rw-r--r-- | framework/Util/TVarDumper.php | 4 |
10 files changed, 22 insertions, 291 deletions
diff --git a/framework/Util/TBehavior.php b/framework/Util/TBehavior.php deleted file mode 100644 index ab53a225..00000000 --- a/framework/Util/TBehavior.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * TBehavior class file. - * - * @author Qiang Xue <qiang.xue@gmail.com> - * @link http://www.yiiframework.com/ - * @copyright Copyright © 2008-2009 Yii Software LLC - * @license http://www.yiiframework.com/license/ - */ - -/** - * TBehavior is a convenient base class for behavior classes. - * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id: TBehaviour.php 3211 2012-10-31 02:35:01Z javalizard@gmail.com $ - * @package System.Util - * @since 3.2.1 - */ -class TBehavior extends TComponent implements IBehavior -{ - private $_enabled; - private $_owner; - - /** - * Declares events and the corresponding event handler methods. - * The events are defined by the {@link owner} component, while the handler - * methods by the behavior class. The handlers will be attached to the corresponding - * events when the behavior is attached to the {@link owner} component; and they - * will be detached from the events when the behavior is detached from the component. - * @return array events (array keys) and the corresponding event handler methods (array values). - */ - public function events() - { - return array(); - } - - /** - * Attaches the behavior object to the component. - * The default implementation will set the {@link owner} property - * and attach event handlers as declared in {@link events}. - * Make sure you call the parent implementation if you override this method. - * @param TComponent the component that this behavior is to be attached to. - */ - public function attach($owner) - { - $this->_owner=$owner; - foreach($this->events() as $event=>$handler) - $owner->attachEventHandler($event,array($this,$handler)); - } - - /** - * Detaches the behavior object from the component. - * The default implementation will unset the {@link owner} property - * and detach event handlers declared in {@link events}. - * Make sure you call the parent implementation if you override this method. - * @param TComponent the component that this behavior is to be detached from. - */ - public function detach($owner) - { - foreach($this->events() as $event=>$handler) - $owner->detachEventHandler($event,array($this,$handler)); - $this->_owner=null; - } - - /** - * @return TComponent the owner component that this behavior is attached to. - */ - public function getOwner() - { - return $this->_owner; - } - - /** - * @return boolean whether this behavior is enabled - */ - public function getEnabled() - { - return $this->_enabled; - } - - /** - * @param boolean whether this behavior is enabled - */ - public function setEnabled($value) - { - $this->_enabled=$value; - } -}
\ No newline at end of file diff --git a/framework/Util/TCallChain.php b/framework/Util/TCallChain.php deleted file mode 100644 index c7609dfa..00000000 --- a/framework/Util/TCallChain.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php -/** - * TCallChain class file. - * - * @author Brad Anderson <javalizard@gmail.com> - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2008-2012 Pradosoft - * @license http://www.pradosoft.com/license/ - */ - -/** - * TCallChain is a recursive event calling mechanism. This class implements - * the {@link IDynamicMethods} class so that any 'dy' event calls can be caught - * and patched through to the intended recipient - * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TCallChain.php 564 2009-01-21 22:07:10Z javalizard $ - * @package System.Util - * @since 3.2.1 - */ -class TCallChain extends TList implements IDynamicMethods -{ - /** - * @var {@link TListIterator} for moving through the chained method calls - */ - private $_iterator=null; - - /** - * @var string the method name of the call chain - */ - private $_method=null; - - /** - * This initializes the list and the name of the method to be called - * @param string the name of the function call - */ - public function __construct($method) { - $this->_method=$method; - parent::__construct(); - } - - - /** - * This initializes the list and the name of the method to be called - * @param string|array this is a callable function as a string or array with - * the object and method name as string - * @param array The array of arguments to the function call chain - */ - public function addCall($method,$args) - { - $this->add(array($method,$args)); - } - - /** - * This method calls the next Callable in the list. All of the method arguments - * coming into this method are substituted into the original method argument of - * call in the chain. - * - * If the original method call has these parameters - * <code> - * $originalobject->dyExampleMethod('param1', 'param2', 'param3') - * </code> - * <code> - * $callchain->dyExampleMethod('alt1', 'alt2') - * </code> - * then the next call in the call chain will recieve the parameters as if this were called - * <code> - * $behavior->dyExampleMethod('alt1', 'alt2', 'param3', $callchainobject) - * </code> - * - * When dealing with {@link IClassBehaviors}, the first parameter of the stored argument - * list in 'dy' event calls is always the object containing the behavior. This modifies - * the parameter replacement mechanism slightly to leave the object containing the behavior - * alone and only replacing the other parameters in the argument list. As per {@link __call}, - * any calls to a 'dy' event do not need the object containing the behavior as the addition of - * the object to the argument list as the first element is automatic for IClassBehaviors. - * - * The last parameter of the method parameter list for any callable in the call chain - * will be the TCallChain object itself. This is so that any behavior implementing - * these calls will have access to the call chain. Each callable should either call - * the TCallChain call method internally for direct chaining or call the method being - * chained (in which case the dynamic handler will pass through to this call method). - * - * If the dynamic intra object/behavior event is not called in the behavior implemented - * dynamic method, it will return to this method and call the following behavior - * implementation so as no behavior with an implementation of the dynamic event is left - * uncalled. This does break the call chain though and will not act as a "parameter filter". - * - * When there are no handlers or no handlers left, it returns the first parameter of the - * argument list. - * - */ - public function call() - { - $args=func_get_args(); - if($this->getCount()===0) - return isset($args[0])?$args[0]:null; - - if(!$this->_iterator) - { - $chain_array=array_reverse($this->toArray()); - $this->_iterator=new TListIterator($chain_array); - } - if($this->_iterator->valid()) - do { - $handler=$this->_iterator->current(); - $this->_iterator->next(); - if(is_array($handler[0])&&$handler[0][0] instanceof IClassBehavior) - array_splice($handler[1],1,count($args),$args); - else - array_splice($handler[1],0,count($args),$args); - $handler[1][]=$this; - $result=call_user_func_array($handler[0],$handler[1]); - } while($this->_iterator->valid()); - else - $result = $args[0]; - return $result; - } - - - /** - * This catches all the unpatched dynamic events. When the method call matches the - * call chain method, it passes the arguments to the original __call (of the dynamic - * event being unspecified in TCallChain) and funnels into the method {@link call}, - * so the next dynamic event handler can be called. - * If the original method call has these parameters - * <code> - * $originalobject->dyExampleMethod('param1', 'param2', 'param3') - * </code> - * and within the chained dynamic events, this can be called - * <code> - * class DyBehavior extends TBehavior { - * public function dyExampleMethod($param1, $param2, $param3, $callchain) - * $callchain->dyExampleMethod($param1, $param2, $param3) - * } - * { - * </code> - * to call the next event in the chain. - * @param string method name of the unspecified object method - * @param array arguments to the unspecified object method - */ - public function __dycall($method,$args) - { - if($this->_method==$method) - return call_user_func_array(array($this,'call'),$args); - return null; - } -}
\ No newline at end of file diff --git a/framework/Util/TClassBehavior.php b/framework/Util/TClassBehavior.php deleted file mode 100644 index 499e3e18..00000000 --- a/framework/Util/TClassBehavior.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * TClassBehavior class file. - * - * @author Brad Anderson <javalizard@gmail.com> - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2008-2011 Pradosoft - * @license http://www.pradosoft.com/license/ - */ - -/** - * TClassBehavior is a convenient base class for whole class behaviors. - * @author Brad Anderson <javalizard@gmail.com> - * @version $Id: TClassBehavior.php 564 2009-01-21 22:07:10Z javalizard $ - * @package System.Util - * @since 3.2.1 - */ -class TClassBehavior extends TComponent implements IClassBehavior -{ - - /** - * Attaches the behavior object to the component. - * @param TComponent the component that this behavior is to be attached to. - */ - public function attach($component) - { - } - - /** - * Detaches the behavior object from the component. - * @param TComponent the component that this behavior is to be detached from. - */ - public function detach($component) - { - } -}
\ No newline at end of file diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php index 94a7f0af..ae9df57b 100644 --- a/framework/Util/TDataFieldAccessor.php +++ b/framework/Util/TDataFieldAccessor.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -26,7 +26,7 @@ * then field 'MyValue.MySubValue' will return that method call result. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TDataFieldAccessor.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Util/TDateTimeStamp.php b/framework/Util/TDateTimeStamp.php index 26355bec..7a995b00 100644 --- a/framework/Util/TDateTimeStamp.php +++ b/framework/Util/TDateTimeStamp.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $ * @package System.Util */ @@ -20,9 +20,10 @@ * julian dates anymore. * * @author Fabio Bas ctrlaltca[AT]gmail[DOT]com - * @version $Id$ + * @version $Id: TDateTimeStamp.php 3246 2013-01-07 21:07:38Z ctrlaltca $ * @package System.Util * @since 3.0.4 + * @deprecated since 3.2.1 */ class TDateTimeStamp { diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php index 45102a81..32273c0c 100644 --- a/framework/Util/TLogRouter.php +++ b/framework/Util/TLogRouter.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -36,7 +36,7 @@ Prado::using('System.Data.TDbConnection'); * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -190,7 +190,7 @@ class TLogRouter extends TModule * satisfying both filter conditions will they be returned. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -363,7 +363,7 @@ abstract class TLogRoute extends TApplicationComponent * specifies how many files to be kept. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -503,7 +503,7 @@ class TFileLogRoute extends TLogRoute * {@link setSentFrom SentFrom} address. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -629,7 +629,7 @@ class TEmailLogRoute extends TLogRoute * TBrowserLogRoute prints selected log messages in the response. * * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ @@ -816,7 +816,7 @@ EOD; * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.2 */ @@ -1022,7 +1022,7 @@ class TDbLogRoute extends TLogRoute * {@link http://www.getfirebug.com/ FireBug Website} * * @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.2 */ @@ -1099,7 +1099,7 @@ EOD; * {@link http://www.firephp.org/ FirePHP Website} * * @author Yves Berkholz <godzilla80[at]gmx[dot]net> - * @version $Id$ + * @version $Id: TLogRouter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.1.5 */ diff --git a/framework/Util/TLogger.php b/framework/Util/TLogger.php index a4e2e58d..74fa22bf 100644 --- a/framework/Util/TLogger.php +++ b/framework/Util/TLogger.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -18,7 +18,7 @@ * log categories, and by control. * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TLogger.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php index 7c70bafc..9ab25936 100644 --- a/framework/Util/TParameterModule.php +++ b/framework/Util/TParameterModule.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -41,7 +41,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @author Carl G. Mathisen <carlgmathisen@gmail.com> - * @version $Id$ + * @version $Id: TParameterModule.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Util/TSimpleDateFormatter.php b/framework/Util/TSimpleDateFormatter.php index c7e1cba8..295a2d60 100644 --- a/framework/Util/TSimpleDateFormatter.php +++ b/framework/Util/TSimpleDateFormatter.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -40,7 +40,7 @@ * </code> * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @version $Id$ + * @version $Id: TSimpleDateFormatter.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php index 309c3e2e..f49a1274 100644 --- a/framework/Util/TVarDumper.php +++ b/framework/Util/TVarDumper.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id$ + * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util */ @@ -24,7 +24,7 @@ * </code> * * @author Qiang Xue <qiang.xue@gmail.com> - * @version $Id$ + * @version $Id: TVarDumper.php 3245 2013-01-07 20:23:32Z ctrlaltca $ * @package System.Util * @since 3.0 */ |