mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 12:18:43 +09:00
* Removed legacy files * Refactor Filesystem and Path handling * Removed `FOSSBilling\Tools` legacy functions * Update live-tests to include file check for `php_error.log` * Update Extension module tables to fix wrapping issue * Apply suggestions from @Copilot Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com> * Update Extension module icon URL handling --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
38 lines
992 B
PHP
38 lines
992 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* Copyright 2022-2025 FOSSBilling
|
|
* Copyright 2011-2021 BoxBilling, Inc.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*
|
|
* @copyright FOSSBilling (https://www.fossbilling.org)
|
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
|
|
*/
|
|
require_once __DIR__ . DIRECTORY_SEPARATOR . 'load.php';
|
|
|
|
use FOSSBilling\Environment;
|
|
use Symfony\Component\Filesystem\Path;
|
|
|
|
$di = include Path::join(PATH_ROOT, 'di.php');
|
|
|
|
$di['translate']();
|
|
|
|
try {
|
|
$interval = $argv[1] ?? null;
|
|
$service = $di['mod_service']('cron');
|
|
|
|
if (Environment::isCLI()) {
|
|
echo "\e[33m- Welcome to FOSSBilling.\n";
|
|
echo "\e[34mLast executed: {$service->getLastExecutionTime()}.\e[0m";
|
|
}
|
|
|
|
$service->runCrons($interval);
|
|
} catch (Exception $exception) {
|
|
throw new Exception($exception->getMessage(), $exception->getCode(), $exception);
|
|
} finally {
|
|
if (Environment::isCLI()) {
|
|
echo "\e[32mSuccessfully ran the cron jobs.\e[0m";
|
|
}
|
|
}
|