<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/22/022
 * Time: 19:31
 */

namespace console\controllers;


use yii\console\Controller;
use yii\di\Instance;
use yii\redis\Connection;

class BaseJobController extends Controller
{
    /**
     * @var string|Connection
     */
    public $redis = 'redis';

    public function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        ini_set('memory_limit', '256M');
        $this->redis = Instance::ensure($this->redis, Connection::className());
    }

    public function outLog($msg)
    {
        \Yii::warning($msg, get_called_class());
        $this->stdout($msg . "\n");
    }
}