filePath = $filePath; $this->mode = $mode; try { $this->fileObject = new \SplFileObject( $this->filePath , 'r' );; } catch (\ErrorException $e) { Yii::warning("Ошибка открытия файла {$this->filePath}"); } //preg_match( '/\.[^\.]+$/i',$filePath, $resultArray ); $this->extension = $this->fileObject->getExtension(); } public function run(){ $parser = Yii::createObject( ParserConfigurator::getConfiguration() ); $parser->setup(); return $parser->read(); } }