Blame view

common/components/parsers/YiiMultiparser.php 832 Bytes
ad2e91f7   Mihail   move multyparser ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  <?php
  /**
   * Created by PhpStorm.
   * User: Cibermag
   * Date: 07.09.2015
   * Time: 15:56
   */
  
  namespace common\components\parsers;
  
  use yii\base\Component;
  
  
  
  
  class YiiMultiparser extends Component{
  
  public $configuration;
  public $parserHandler;
  //public $file_path;
  
      public function init()
      {
          parent::init();
          $this->parserHandler = new YiiParserHandler( );
          $this->parserHandler->setConfiguration( $this->configuration );
  
      }
  
  
      public function parse( $filePath, $options = [] ){
  
         // $this->file_path = $file_path;
          $this->parserHandler->setup( $filePath, $options );
  
          return $this->parserHandler->run();
  
      }
  
      public function getConfiguration( $extension, $parameter ){
  
          return $this->parserHandler->getCustomConfiguration( $extension, $parameter );
  
      }
  
  }