Files
interview-demo-code/module/oc_telegram_shop/upload/cli.php
2025-12-07 19:55:05 +03:00

18 lines
589 B
PHP

#!/usr/bin/env php
<?php
if (PHP_SAPI !== 'cli') {
die("This script can only be run from CLI.\n");
}
$baseDir = __DIR__;
$sysLibPath = rtrim(DIR_SYSTEM, '/') . '/library/oc_telegram_shop';
$basePath = rtrim(DIR_APPLICATION, '/') . '/..';
if (is_readable($sysLibPath . '/oc_telegram_shop.phar')) {
require_once "phar://{$sysLibPath}/oc_telegram_shop.phar/vendor/autoload.php";
} elseif (is_dir("$basePath/oc_telegram_shop")) {
require_once "$basePath/oc_telegram_shop/vendor/autoload.php";
} else {
throw new RuntimeException('Unable to locate application directory.');
}