| Server IP : 77.68.64.20 / Your IP : 216.73.217.31 Web Server : Apache System : Linux hp3-wp-1011317.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els8.x86_64 #1 SMP Sun Jul 5 17:25:39 UTC 2026 x86_64 User : csh2392878 ( 2033753) PHP Version : 8.3.30 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/domains/vol1/746/2880746/user/htdocs/wp-content/plugins/booknetic/ |
Upload File : |
<?php
require_once __DIR__ . '/vendor/autoload.php';
use BookneticApp\Providers\Router\RouteCache;
use BookneticApp\Providers\Router\RouteScanner;
$scanDir = $argv[1] ?? __DIR__ . '/app/Backend';
$cachePath = $argv[2] ?? __DIR__ . '/cache/routes.php';
// If scanning an addon directory, load its autoloader
$addonAutoload = dirname($scanDir) . '/vendor/autoload.php';
if (file_exists($addonAutoload) && realpath($addonAutoload) !== realpath(__DIR__ . '/vendor/autoload.php')) {
require_once $addonAutoload;
}
echo "Scanning for #[ApiController] classes in {$scanDir}...\n";
$scanner = new RouteScanner($scanDir);
$routes = $scanner->scan();
echo 'Found ' . count($routes) . " routes.\n";
foreach ($routes as $route) {
echo " {$route->method} {$route->route} → {$route->controller}::{$route->action}\n";
}
if (count($routes) === 0) {
echo "\nNo routes found — skipping cache write.\n";
exit(0);
}
$cache = new RouteCache($cachePath);
$cache->write($routes);
echo "\nRoute cache written to: {$cachePath}\n";
echo "Done.\n";