v-wordpress-plugin-updater/v-update-api/cron.php
Nikolai X. Shadeauxs 8fc3bc20ad
Some checks failed
CI & Security / CI Scan (push) Failing after 9s
CI & Security / CodeQL (JavaScript) (push) Failing after 6s
CI & Security / Semgrep (PHP) (push) Failing after 8s
modified: .github/copilot-instructions.md
modified:   CHANGELOG.md
	modified:   README.md
2026-04-06 14:39:21 -04:00

40 lines
987 B
PHP

<?php
// phpcs:ignoreFile PSR1.Files.SideEffects
/**
* Project: UpdateAPI
* Author: Vontainment <services@vontainment.com>
* License: https://opensource.org/licenses/MIT MIT License
* Link: https://vontainment.com
* Version: 4.5.0
*
* File: cron.php
* Description: WordPress Update API
*/
if (php_sapi_name() !== 'cli') {
http_response_code(403);
exit('Forbidden');
}
require_once __DIR__ . '/vendor/autoload.php';
use App\Core\ErrorManager;
use App\Models\PluginModel;
use App\Models\ThemeModel;
use App\Models\BlacklistModel;
ErrorManager::handle(function (): void {
$_SERVER['DOCUMENT_ROOT'] = __DIR__ . '/public';
require __DIR__ . '/config.php';
$pluginModel = new PluginModel();
$themeModel = new ThemeModel();
$blacklistModel = new BlacklistModel();
$pluginModel->syncFromDirectory(PLUGINS_DIR);
$themeModel->syncFromDirectory(THEMES_DIR);
$blacklistModel->cleanup();
echo "Cron job completed successfully.\n";
});