]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Проверка метода в консоли
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 22 Jan 2025 08:29:46 +0000 (11:29 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 22 Jan 2025 08:29:46 +0000 (11:29 +0300)
erp24/commands/EnvController.php

index 6840554c4a53c7c7cf67ef5b8d0bad946f86f076..bd6330775c9d3c3c812c14978a9f92c07ab0177f 100644 (file)
@@ -5,6 +5,7 @@ namespace yii_app\commands;
 use yii\console\Controller;
 use yii\console\ExitCode;
 use yii\helpers\BaseConsole;
+use yii_app\services\TelegramService;
 
 class EnvController extends Controller
 {
@@ -19,4 +20,14 @@ class EnvController extends Controller
         $this->stdout("Переменная окружения {$varName}: {$envValue}\n", BaseConsole::FG_GREEN);
         return ExitCode::OK;
     }
+
+    /**
+     * php yii env/is-dev
+     */
+    public function actionIsDev()
+    {
+        $result = TelegramService::isDevEnv() ? 'Да' : 'Нет';
+        $this->stdout("Тестовое окружение?  {$result}\n", BaseConsole::FG_GREEN);
+        return ExitCode::OK;
+    }
 }