* @revision 05 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @homepage http://oss.tiggerswelt.net/xmpp * @copyright Copyright © 2009 tiggersWelt.net **/ /** * tiggerXMPP Extensions * --------------------- * Basic interface for extensions * * @class tiggerXMPP_Extension * @package tiggerXMPP * @revision 01 * @author Bernd Holzmueller **/ abstract class tiggerXMPP_Extension { private $Parent = null; // {{{ __construct /** * Create and register a new extension * * @access friendly * @return void **/ function __construct ($Parent = null) { // Register this extension on our parent if (is_object ($Parent)) $Parent->registerExtension ($this); } // }}} // {{{ setParent /** * Register a new parent for this extension * * @param object $Handle * * @access public * @return bool **/ public final function setParent ($Handle) { // Check if there is already a parent if (is_object ($this->Parent)) return false; // Check if the new handle is of the right type elseif (!($Handle instanceof tiggerXMPP_Stream)) return false; // Set the new parent $this->Parent = $Handle; return true; } // }}} // {{{ getParent /** * Retrive a handle of our assigned parent * * @access protected * @return object **/ protected function getParent () { return $this->Parent; } // }}} // {{{ getNamespaces /** * Retrive a list of the namespaces we handle * * @access public * @return array **/ public function getNamespaces () { if (($c = get_class ($this)) && defined ($c . '::XEP_NAMESPACE')) return constant ($c . '::XEP_NAMESPACE'); } // }}} // {{{ getTags /** * Retrive a list of all tags we handle for a given namespace * * @param string $Namespace * * @access public * @return array **/ public function getTags ($NS = "") { return array (); } // }}} protected function __debug ($lvl, $msg, $fnc, $lin, $cls, $fle, $rc = null) { if (is_object ($p = $this->getParent ())) $p->__debug ($lvl, $msg, $fnc, $lin, $cls, $fle, $rc); } } ?>