From 98dbe6f0d2edfff3a1f5785504504b4a6e5dd4eb Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 19 Nov 2011 11:33:31 +0000 Subject: updating phpDocumentor, part 2: add new version --- .../PhpDocumentor/phpDocumentor/Publisher.inc | 110 +++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc (limited to 'buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc') diff --git a/buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc b/buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc new file mode 100755 index 00000000..f0c78eb2 --- /dev/null +++ b/buildscripts/PhpDocumentor/phpDocumentor/Publisher.inc @@ -0,0 +1,110 @@ + + * @author Joshua Eichorn + * @copyright 2000-2007 Kellin, Joshua Eichorn + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @version CVS: $Id: Publisher.inc 244033 2007-10-11 03:30:34Z ashnazg $ + * @link http://www.phpdoc.org + * @link http://pear.php.net/PhpDocumentor + * @since 0.1 + * @todo CS cleanup - change package to PhpDocumentor + */ +/** + * a class for handling the publishing of data + * + * @category ToolsAndUtilities + * @package phpDocumentor + * @author Kellin + * @author Joshua Eichorn + * @copyright 2000-2007 Kellin, Joshua Eichorn + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @version Release: 1.4.3 + * @link http://www.phpdoc.org + * @link http://pear.php.net/PhpDocumentor + * @todo CS cleanup - change package to PhpDocumentor + */ +class Publisher +{ + /**#@+ + * @var array + */ + /** + * Array of references objects that have Subscribed to this publisher + */ + var $subscriber = array(); + + var $tokens = array(); + + var $pushEvent = array(); + var $popEvent = array(); + /**#@-*/ + + + /** + * Adds a subscriber to the {@link $subscriber} array(). + * if $event is '*', the publisher will use $object as the default event handler + * + * @param integer $event see {@link Parser.inc} PARSER_EVENT_* constants + * @param class &$object any class that has a HandleEvent() method like + * {@link phpDocumentor_IntermediateParser::HandleEvent()} + * or {@link Classes::HandleEvent()} + * + * @return void + * @todo CS Cleanup - there's no way I can get the &$object desc under 85 chars + */ + function subscribe($event, &$object) + { + $this->subscriber[$event] =& $object; + } + + /** + * Publish an event + * + * @param integer $event see {@link Parser.inc} PARSER_EVENT_* constants + * @param mixed $data anything the subscribed event handler is expecting + * + * @return void + */ + function publishEvent($event,$data) + { + + // see if there is a specific event handler + if (!empty($this->subscriber[$event])) { + $this->subscriber[$event]->HandleEvent($event, $data); + } else if (isset($this->subscriber['*']) + && is_object($this->subscriber['*'])) { + // check to see if a generic handler exists + + $this->subscriber['*']->HandleEvent($event, $data); + } + } +} +?> -- cgit v1.2.3