Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param string $file The file name
  * @param string $relativePath The relative path
  * @param string $relativePathname The relative path name
  * @param array $info
  */
 public function __construct($file, $relativePath, $relativePathname, $info)
 {
     parent::__construct($file, $relativePath, $relativePathname, $info);
     $module = end($this->info['path_parts']);
     $this->namespace = prev($this->info['path_parts']);
     $this->codepool = prev($this->info['path_parts']);
     $this->name = $this->namespace . '_' . $module;
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @param string $file The file name
  * @param string $relativePath The relative path
  * @param string $relativePathname The relative path name
  * @param array $info
  */
 public function __construct($file, $relativePath, $relativePathname, $info)
 {
     parent::__construct($file, $relativePath, $relativePathname, $info);
     $parser = new PhpParser\Parser(new PhpParser\Lexer\Emulative());
     $traverser = new PhpParser\NodeTraverser();
     libxml_use_internal_errors(true);
     try {
         $this->xml = new SimpleXMLElement($traverser->traverse($parser->parse($this->getContents())));
     } catch (Exception $e) {
         $this->xml = new SimpleXMLElement('<?xml version="1.0"?><dummy></dummy>');
     }
 }
Exemplo n.º 3
0
 /**
  * Constructor
  *
  * @param string $file The file name
  * @param string $relativePath The relative path
  * @param string $relativePathname The relative path name
  * @param array $info
  */
 public function __construct($file, $relativePath, $relativePathname, $info)
 {
     parent::__construct($file, $relativePath, $relativePathname, $info);
     $this->xml = new SimpleXMLElement($this->getContents());
     $this->helper = new Helper();
 }