<?php
    namespace console\controllers;
    
    use yii\console\Controller;
    use yii\db\Exception;
    
    /**
     * 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 );
        }
    }