Commit beb95869bf10b498d13b0c30e286b3eb5e558f68

Authored by Mihail
1 parent 92dc80b4

fixed issue with deleting parsed files

backend/models/UploadFileCrossingForm.php
@@ -48,9 +48,8 @@ class UploadFileCrossingForm extends Model @@ -48,9 +48,8 @@ class UploadFileCrossingForm extends Model
48 if( !is_array( $data ) ){ 48 if( !is_array( $data ) ){
49 throw new ErrorException("Ошибка чтения из файла кроссов {$this->file_path}"); 49 throw new ErrorException("Ошибка чтения из файла кроссов {$this->file_path}");
50 } 50 }
51 - // файл больше не нужен - данные прочитаны и сохранены в кеш  
52 -// if( file_exists($this->file_path) )  
53 -// unlink($this->file_path); 51 + if( file_exists($this->file_path) )
  52 + unlink($this->file_path);
54 53
55 return $data; 54 return $data;
56 } 55 }
backend/models/UploadFileParsingForm.php
@@ -77,8 +77,7 @@ class UploadFileParsingForm extends Model @@ -77,8 +77,7 @@ class UploadFileParsingForm extends Model
77 } 77 }
78 // файл больше не нужен - данные прочитаны и сохранены в кеш 78 // файл больше не нужен - данные прочитаны и сохранены в кеш
79 if( file_exists($this->file_path) ) 79 if( file_exists($this->file_path) )
80 - //@ todo - перестало работать - нет доступа на удалениев этом сеансе, в следующем - файл удаляется - разобраться  
81 - // unlink( $this->file_path ); 80 + unlink( $this->file_path );
82 81
83 82
84 return $data; 83 return $data;
backend/models/UploadFileRgForm.php
@@ -46,16 +46,12 @@ class UploadFileRgForm extends Model @@ -46,16 +46,12 @@ class UploadFileRgForm extends Model
46 throw new ErrorException("Ошибка чтения из файла RG групп {$this->file_path}"); 46 throw new ErrorException("Ошибка чтения из файла RG групп {$this->file_path}");
47 } 47 }
48 48
  49 + if( file_exists($this->file_path) )
  50 + unlink($this->file_path);
49 51
50 return $data; 52 return $data;
51 } 53 }
52 54
53 - function __destruct()  
54 - {  
55 - // файл больше не нужен - данные прочитаны и сохранены в кеш  
56 - // if( file_exists($this->file_path) )  
57 - // unlink($this->file_path);  
58 - }  
59 55
60 56
61 } 57 }
62 \ No newline at end of file 58 \ No newline at end of file