<?php
    namespace console\controllers;
    
    use yii\console\Controller;
    use yii\db\Connection;
    use yii\db\Exception;
    use yii\helpers\ArrayHelper;
    
    /**
     * Class CheckController
     *
     * @package console\controllers
     */
    class CheckController extends Controller
    {
        public function actionConnection($path)
        {
            $connection = \Yii::createObject(require( $path ));
            try {
                $connection->open();
            } catch (Exception $exception) {
                exit( 1 );
            }
            exit( 0 );
        }
    }