Blame view

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