Design/ZE2 migration note: If PHP would support nested classes. All the phing/parser/*Filter classes would be nested within this class

Author: Andreas Aderhold (andi@binarycloud.com)
Inheritance: extends AbstractHandler
コード例 #1
0
ファイル: ProjectHandler.php プロジェクト: pmoutet/navinum
 /**
  * Handles start elements within the <project> tag by creating and
  * calling the required handlers for the detected element.
  *
  * @param  string  the tag that comes in
  * @param  array   attributes the tag carries
  * @throws ExpatParseException if a unxepected element occurs
  * @access public
  */
 function startElement($name, $attrs)
 {
     $project = $this->configurator->project;
     $types = $project->getDataTypeDefinitions();
     if ($name == "target") {
         $tf = new TargetHandler($this->parser, $this, $this->configurator);
         $tf->init($name, $attrs);
     } elseif (isset($types[$name])) {
         $tyf = new DataTypeHandler($this->parser, $this, $this->configurator);
         $tyf->init($name, $attrs);
     } else {
         $tf = new TaskHandler($this->parser, $this, $this->configurator);
         $tf->init($name, $attrs);
     }
 }
コード例 #2
0
 /**
  * Checks for nested tags within the current one. Creates and calls
  * handlers respectively.
  *
  * @param  string  the tag that comes in
  * @param  array   attributes the tag carries
  */
 function startElement($name, $attrs)
 {
     // shorthands
     $project = $this->configurator->project;
     $types = $project->getDataTypeDefinitions();
     if (isset($types[$name])) {
         $th = new DataTypeHandler($this->parser, $this, $this->configurator, $this->target);
         $th->init($name, $attrs);
     } else {
         $tmp = new TaskHandler($this->parser, $this, $this->configurator, $this->target, null, $this->target);
         $tmp->init($name, $attrs);
     }
 }