Commit 9d57a9ea303ec87e77d937a0608047b0e256ebc9

Authored by Mihail
1 parent 9075f464

try organize ini settings

backend/components/parsers/config.php
1 1 <?php
2 2 return [
  3 + 'global' =>
  4 + ['ini' => ['upload_max_filesize' => '20M',
  5 + 'post_max_size integer' => '30M',
  6 + ]],
3 7 'csv' =>
4 8 ['web' =>
5 9 ['class' => 'backend\components\parsers\CustomCsvParser',
... ...
backend/controllers/ParserController.php
... ... @@ -68,13 +68,19 @@ class ParserController extends BaseController
68 68 $model = new UploadFileParsingForm();
69 69 // установим режим, 0 - ручная загрузка, 1 - автозагрузка
70 70 $model->mode = $mode;
71   -
  71 + //CustomVarDamp::dumpAndDie(phpinfo());
72 72 return $this->render('index', ['model' => $model]);
73 73 }
74 74  
  75 +// public function beforeAction($action)
  76 +// {
  77 +// if($action->actionMethod ='actionResults'){
  78 +// CustomVarDamp::dumpAndDie(phpinfo());
  79 +// }
  80 +// }
  81 +
75 82 public function actionResults($mode = 0)
76 83 {
77   -
78 84 $model = new UploadFileParsingForm(['mode' => $mode]);
79 85 $data = [];
80 86 if ($model->load(Yii::$app->request->post())) {
... ...
vendor/yiisoft/multiparser/YiiMultiparser.php
... ... @@ -8,6 +8,7 @@
8 8  
9 9 namespace yii\multiparser;
10 10  
  11 +use common\components\CustomVarDamp;
11 12 use yii\base\Component;
12 13  
13 14  
... ... @@ -37,5 +38,15 @@ public $configuration;
37 38 return $parser->run();
38 39  
39 40 }
40   -
  41 +
  42 + public function init()
  43 + {
  44 + if( isset($this->configuration['glob']) && isset($this->configuration['glob']['ini'])){
  45 + foreach ($this->configuration['glob']['ini'] as $ini_setting => $ini_setting_value) {
  46 + ini_set( $ini_setting, $ini_setting_value );
  47 + }
  48 + }
  49 +
  50 + }
  51 +
41 52 }
42 53 \ No newline at end of file
... ...