svn: /phd/trunk/phpdotnet/phd/ Format.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Tue, 28 Jul 2009 05:37:26 +0000 |
| Subject: | svn: /phd/trunk/phpdotnet/phd/ Format.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4532@lists.php.net to get a copy of this message | ||
moacir Tue, 28 Jul 2009 05:37:26 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=286437
Log:
adding PI support
Changed paths:
U phd/trunk/phpdotnet/phd/Format.php
Modified: phd/trunk/phpdotnet/phd/Format.php
===================================================================
--- phd/trunk/phpdotnet/phd/Format.php 2009-07-28 05:35:48 UTC (rev 286436)
+++ phd/trunk/phpdotnet/phd/Format.php 2009-07-28 05:37:26 UTC (rev 286437)
@@ -16,10 +16,12 @@
protected $outputdir;
protected $chunked;
+ /*Processing Instructions Handlers*/
+ private $pihandlers = array();
+
/* Indexing maps */
protected $indexes = array();
protected $childrens = array();
-
protected $refs = array();
protected $vars = array();
protected $classes = array();
@@ -44,6 +46,23 @@
abstract public function appendData($data);
abstract public function update($event, $value = null);
+ public final function parsePI($target, $data) {
+ if (isset($this->pihandlers[$target])) {
+ return $this->pihandlers[$target]->parse($target, $data);
+ }
+ }
+
+ public final function registerPIHandlers($pihandlers) {
+ foreach ($pihandlers as $target => $classname) {
+ $class = __NAMESPACE__ . "\\" . $classname;
+ $this->pihandlers[$target] = new $class($this);
+ }
+ }
+
+ public function getPIHandler($target) {
+ return $this->pihandlers[$target];
+ }
+
public function sortIDs() {
$this->sqlite->createAggregate("indexes", array($this,
"SQLiteIndex"), array($this, "SQLiteFinal"), 8);
$this->sqlite->createAggregate("childrens", array($this,
"SQLiteChildrens"), array($this, "SQLiteFinal"), 2);