コード例 #1
0
 /**
  * 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
  */
 public function startElement($name, $attrs)
 {
     $project = $this->configurator->project;
     $types = $project->getDataTypeDefinitions();
     if ($name == "target") {
         $tf = new TargetHandler($this->parser, $this, $this->configurator, $this->context);
         $tf->init($name, $attrs);
     } else {
         $tf = new ElementHandler($this->parser, $this, $this->configurator, null, null, $this->context->getImplicitTarget());
         $tf->init($name, $attrs);
     }
 }
コード例 #2
0
 /**
  * Removes the current configurator from the parsing stack.
  *
  * @author     Noah Fontes <*****@*****.**>
  * @since      1.0.4
  */
 public function endConfigure()
 {
     $this->getProject()->fireConfigureFinished();
     parent::endConfigure();
 }
コード例 #3
0
 /**
  * @param PhingXMLContext $ctx
  * @throws ExpatParseException
  */
 protected function _parse(PhingXMLContext $ctx)
 {
     // push action onto global stack
     $ctx->startConfigure($this);
     $reader = new BufferedReader(new FileReader($this->buildFile));
     $parser = new ExpatParser($reader);
     $parser->parserSetOption(XML_OPTION_CASE_FOLDING, 0);
     $parser->setHandler(new RootHandler($parser, $this, $ctx));
     $this->project->log("parsing buildfile " . $this->buildFile->getName(), Project::MSG_VERBOSE);
     $parser->parse();
     $reader->close();
     // mark parse phase as completed
     $this->isParsing = false;
     // execute delayed tasks
     $this->parseEndTarget->main();
     // pop this action from the global stack
     $ctx->endConfigure();
 }