Skip to content

Commit

Permalink
Move imports to constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Jan 3, 2018
1 parent 48fb64a commit 1f635bb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions application/commands/ImportCommand.php
Expand Up @@ -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;;
Expand Down

0 comments on commit 1f635bb

Please sign in to comment.