From 1f635bb5533223811be057479d22acc624bf119c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5nis=20Ormisson?= Date: Wed, 3 Jan 2018 10:14:42 +0200 Subject: [PATCH] Move imports to constructor --- application/commands/ImportCommand.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/application/commands/ImportCommand.php b/application/commands/ImportCommand.php index 04f99174fc5..d1258721276 100644 --- a/application/commands/ImportCommand.php +++ b/application/commands/ImportCommand.php @@ -15,15 +15,25 @@ class ImportCommand extends CConsoleCommand { /** + * ImportCommand constructor. + * @param $name + * @param CConsoleCommandRunner $runner * @throws CException - * @throws Exception */ - public function actionIndex($file,$userId=null) + public function __construct($name, CConsoleCommandRunner $runner) { - + parent::__construct($name, $runner); \Yii::import('application.helpers.admin.import_helper', true); \Yii::import('application.helpers.common_helper', true); \Yii::import('application.helpers.expressions.em_manager_helper', true); + } + + + /** + * @throws Exception + */ + public function actionIndex($file,$userId=null) + { if(!$file){ echo 'File name must be defined. Use --file= argument to define file path.'.PHP_EOL;;