Commit 7d010dbaa6ac4636544a44e67329048fd13eabe1

Authored by Mihail
1 parent f5769826

fixed problem with undeleted manual files

Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
backend/models/UploadFileParsingForm.php
1 1 <?php
2 2 namespace backend\models;
3 3  
  4 +use yii\base\ErrorException;
4 5 use yii\base\Model;
5 6 use yii\web\UploadedFile;
6 7 use Yii;
... ... @@ -73,9 +74,10 @@ class UploadFileParsingForm extends Model
73 74  
74 75 $data = Yii::$app->multiparser->parse( $this->file_path, $options );
75 76 if( !is_array( $data ) ){
76   - $data = ['No results'];
  77 + throw new ErrorException("Ошибка чтения из файла прайса {$this->file_path}");
77 78 }
78   -
  79 + // файл больше не нужен - данные прочитаны и сохранены в кеш
  80 + unlink($this->file_path);
79 81 return $data;
80 82 }
81 83  
... ...