#!/usr/bin/env php select("SELECT value FROM `{$prefix}setting` WHERE `key` = 'module_telecart_settings'"); $json = json_decode($raw[0]['value'], true, 512, JSON_THROW_ON_ERROR); $items = Arr::mergeArraysRecursively($json, [ 'app' => [ 'shop_base_url' => HTTPS_CATALOG, // for catalog: HTTPS_SERVER, for admin: HTTPS_CATALOG 'language_id' => 1, ], 'paths' => [ 'images' => DIR_IMAGE, ], 'logs' => [ 'path' => DIR_LOGS, ], 'database' => [ 'host' => DB_HOSTNAME, 'database' => DB_DATABASE, 'username' => DB_USERNAME, 'password' => DB_PASSWORD, 'prefix' => DB_PREFIX, 'port' => (int) DB_PORT, ], 'store' => [ 'oc_store_id' => 0, 'oc_default_currency' => 'RUB', 'oc_config_tax' => false, ], 'orders' => [ 'oc_customer_group_id' => 1, ], 'telegram' => [ 'mini_app_url' => rtrim(HTTPS_CATALOG, '/') . '/image/catalog/tgshopspa/#/', ], ]); // Create logger $logger = new Logger('TeleCart_CLI', [], [], new DateTimeZone('UTC')); $logger->pushHandler( new RotatingFileHandler( DIR_LOGS . '/telecart.log', 14, $debug ? Logger::DEBUG : Logger::INFO ), ); // Creates TeleCart application. $app = ApplicationFactory::create($items); $app->setLogger($logger); $app->boot(); // Creates Console and bind commands. $console = new Application('TeleCart', module_version()); $console->add($app->get(VersionCommand::class)); $console->add($app->get(ScheduleRunCommand::class)); $console->add($app->get(ScheduleListCommand::class)); $console->add($app->get(PulseSendEventsCommand::class)); $console->add($app->get(WarmupImagesCacheCommand::class)); $console->run();