+++ /dev/null
-<?php\r
-/**\r
- * a class for handling the publishing of data\r
- * \r
- * phpDocumentor :: automatic documentation generator\r
- * \r
- * PHP versions 4 and 5\r
- *\r
- * Copyright (c) 2000-2007 Kellin, Joshua Eichorn\r
- * \r
- * LICENSE:\r
- * \r
- * This library is free software; you can redistribute it\r
- * and/or modify it under the terms of the GNU Lesser General\r
- * Public License as published by the Free Software Foundation;\r
- * either version 2.1 of the License, or (at your option) any\r
- * later version.\r
- * \r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- * \r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @author Kellin <passionplay@hotmail.com>\r
- * @author Joshua Eichorn <jeichorn@phpdoc.org>\r
- * @copyright 2000-2007 Kellin, Joshua Eichorn\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version CVS: $Id: Publisher.inc,v 1.4 2007/10/11 03:30:34 ashnazg Exp $\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @since 0.1\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- */\r
-/**\r
- * a class for handling the publishing of data\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @author Kellin <passionplay@hotmail.com>\r
- * @author Joshua Eichorn <jeichorn@phpdoc.org>\r
- * @copyright 2000-2007 Kellin, Joshua Eichorn\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version Release: 1.4.1\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- */\r
-class Publisher\r
-{\r
- /**#@+\r
- * @var array\r
- */\r
- /**\r
- * Array of references objects that have Subscribed to this publisher\r
- */\r
- var $subscriber = array();\r
-\r
- var $tokens = array();\r
-\r
- var $pushEvent = array();\r
- var $popEvent = array();\r
- /**#@-*/\r
-\r
-\r
- /**\r
- * Adds a subscriber to the {@link $subscriber} array().\r
- * if $event is '*', the publisher will use $object as the default event handler\r
- *\r
- * @param integer $event see {@link Parser.inc} PARSER_EVENT_* constants\r
- * @param class &$object any class that has a HandleEvent() method like \r
- * {@link phpDocumentor_IntermediateParser::HandleEvent()}\r
- * or {@link Classes::HandleEvent()}\r
- *\r
- * @return void\r
- * @todo CS Cleanup - there's no way I can get the &$object desc under 85 chars\r
- */\r
- function subscribe($event, &$object)\r
- {\r
- $this->subscriber[$event] =& $object;\r
- }\r
-\r
- /**\r
- * Publish an event\r
- *\r
- * @param integer $event see {@link Parser.inc} PARSER_EVENT_* constants\r
- * @param mixed $data anything the subscribed event handler is expecting\r
- *\r
- * @return void\r
- */\r
- function publishEvent($event,$data)\r
- {\r
- \r
- // see if there is a specific event handler\r
- if (!empty($this->subscriber[$event])) {\r
- $this->subscriber[$event]->HandleEvent($event, $data);\r
- } else if (isset($this->subscriber['*']) \r
- && is_object($this->subscriber['*'])) {\r
- // check to see if a generic handler exists\r
-\r
- $this->subscriber['*']->HandleEvent($event, $data);\r
- }\r
- } \r
-}\r
-?>\r