ParseError
syntax error, unexpected token "<<", expecting end of file ParseError thrown with message "syntax error, unexpected token "<<", expecting end of file" Stacktrace: #11 ParseError in /var/www/sultpoint/html/modules/Client/SidebarProvider.php:14 #10 AntCMS\AntLoader:autoload in [internal]:0 #9 class_exists in /var/www/sultpoint/html/library/FOSSBilling/SidebarRegistry.php:96 #8 FOSSBilling\SidebarRegistry:autoRegister in /var/www/sultpoint/html/library/FOSSBilling/SidebarRegistry.php:48 #7 FOSSBilling\SidebarRegistry:resolveAll in /var/www/sultpoint/html/library/Box/AppClient.php:285 #6 Box_AppClient:getTwig in /var/www/sultpoint/html/library/Box/AppClient.php:141 #5 Box_AppClient:render in /var/www/sultpoint/html/library/Box/AppClient.php:121 #4 Box_AppClient:get_custom_page in [internal]:0 #3 ReflectionMethod:invokeArgs in /var/www/sultpoint/html/library/Box/App.php:214 #2 Box_App:execute in /var/www/sultpoint/html/library/Box/App.php:339 #1 Box_App:processRequest in /var/www/sultpoint/html/library/Box/App.php:136 #0 Box_App:run in /var/www/sultpoint/html/index.php:145
Stack frames (12)
11
ParseError
/modules/Client/SidebarProvider.php:14
10
AntCMS\AntLoader autoload
[internal]:0
9
class_exists
/library/FOSSBilling/SidebarRegistry.php:96
8
FOSSBilling\SidebarRegistry autoRegister
/library/FOSSBilling/SidebarRegistry.php:48
7
FOSSBilling\SidebarRegistry resolveAll
/library/Box/AppClient.php:285
6
Box_AppClient getTwig
/library/Box/AppClient.php:141
5
Box_AppClient render
/library/Box/AppClient.php:121
4
Box_AppClient get_custom_page
[internal]:0
3
ReflectionMethod invokeArgs
/library/Box/App.php:214
2
Box_App execute
/library/Box/App.php:339
1
Box_App processRequest
/library/Box/App.php:136
0
Box_App run
/index.php:145
/var/www/sultpoint/html/modules/Client/SidebarProvider.php
<?php
 
/**
 * Sidebar provider for Client module account pages.
 * Handles: /clientarea/details, /clientarea/contacts, /clientarea/security,
 *          /clientarea/emails, /account/users, /account/contacts.
 */
 
namespace Box\Mod\Client;
 
use Box\Mod\Invoice\Entity\Invoice;
use Box\Mod\Invoice\Repository\InvoiceRepository;
use Box\Mod\Product\Entity\Product;
<<<<<<< HEAD
use Box\Mod\Servicessl\Entity\SslOrder;
=======
>>>>>>> 535bc07df (refactor: implement canonical JPY point-based architecture for pricing, currency conversion, and ledger reconciliation)
use FOSSBilling\SidebarItem;
use FOSSBilling\SidebarProviderInterface;
 
class SidebarProvider implements SidebarProviderInterface
{
    private const ACCOUNT_PAGES = [
        '/clientarea/details',
        '/clientarea/contacts',
        '/clientarea/security',
        '/clientarea/emails',
        '/clientarea/my-points',
        '/account/users',
        '/account/contacts',
    ];
 
    private const USER_PAGES = [
        '/user/profile',
        '/user/password',
        '/user/security',
        '/user/accounts',
    ];
 
    private const SERVICES_PAGES = [
Arguments
  1. "syntax error, unexpected token "<<", expecting end of file"
    
[internal]
/var/www/sultpoint/html/library/FOSSBilling/SidebarRegistry.php
     * For testing and long-lived processes (Swoole, RoadRunner).
     */
    public static function reset(): void
    {
        self::$providers = [];
    }
 
    /**
     * Auto-discover and register all module SidebarProviders.
     */
    private static function autoRegister(\Pimple\Container $di): void
    {
        if (!defined('PATH_MODS')) {
            return;
        }
 
        foreach (glob(PATH_MODS . '/*/SidebarProvider.php') as $file) {
            $moduleName = basename(dirname($file));
            $className = "Box\\Mod\\{$moduleName}\\SidebarProvider";
            if (class_exists($className)) {
                $provider = new $className();
                if ($provider instanceof SidebarProviderInterface) {
                    self::register($provider);
                } else {
                    $di['logger']->warning("SidebarProvider in module {$moduleName} does not implement SidebarProviderInterface");
                }
            }
        }
    }
 
    private static function fireSidebarBuildEvent(\Pimple\Container $di, ?SidebarItem $sidebar, string $path, string $position): void
    {
        if ($sidebar === null) {
            return;
        }
 
        $di['events_manager']->fire([
            'event' => 'onAfterSidebarBuild',
            'params' => [
                'sidebar' => $sidebar,
/var/www/sultpoint/html/library/FOSSBilling/SidebarRegistry.php
     * Returns null if no module provides a sidebar for this path.
     */
    public static function resolve(\Pimple\Container $di, string $path): ?SidebarItem
    {
        return self::resolveAll($di, $path)['primary'];
    }
 
    /**
     * Resolve all sidebars for the current path.
     *
     * Providers may optionally expose buildSecondary(\Pimple\Container $di, string $path): ?SidebarItem
     * to supply a secondary sidebar without forcing every provider to implement it.
     *
     * @return array{primary: ?SidebarItem, secondary: ?SidebarItem}
     */
    public static function resolveAll(\Pimple\Container $di, string $path): array
    {
        // Lazy auto-registration: only scan for providers when we actually need a sidebar
        if (empty(self::$providers)) {
            self::autoRegister($di);
        }
 
        // 1. Find matching provider
        $primarySidebar = null;
        $secondarySidebar = null;
        foreach (self::$providers as $provider) {
            if ($provider->supports($path)) {
                $primarySidebar = $provider->build($di);
 
                if (method_exists($provider, 'buildSecondary')) {
                    $secondarySidebar = $provider->buildSecondary($di, $path);
                }
 
                break;
            }
        }
 
        self::fireSidebarBuildEvent($di, $primarySidebar, $path, 'primary');
        self::fireSidebarBuildEvent($di, $secondarySidebar, $path, 'secondary');
 
/var/www/sultpoint/html/library/Box/AppClient.php
            if (!$this->debugBar->hasCollector($collector->getName())) {
                $this->debugBar->addCollector($collector);
            }
        }
 
        $twig->addExtension(new DebugBar($this->getDebugBar()));
 
        if ($this->di['auth']->isClientLoggedIn()) {
            $twig->addGlobal('client', $this->di['api_client']);
        }
        $clientAreaAlertContext = $this->getClientAreaAlertContext();
        foreach ($clientAreaAlertContext as $key => $value) {
            $twig->addGlobal($key, $value);
        }
 
        // Sidebar is 100% opt-in. Ask the provider registry for a sidebar.
        // If no module claims this path, an empty sidebar is used (no panels rendered).
        // Sidebars exist for both guest-facing pages (Announcements, KB) and logged-in pages.
        $currentPath = rtrim((string) (parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/'), '/');
        $sidebars = FOSSBilling\SidebarRegistry::resolveAll($this->di, $currentPath);
        $twig->addGlobal('primarySidebar', $sidebars['primary'] ?? new FOSSBilling\SidebarItem('primarySidebar', ''));
        $twig->addGlobal('secondarySidebar', $sidebars['secondary'] ?? new FOSSBilling\SidebarItem('secondarySidebar', ''));
 
        $isUserLoggedIn = $this->di['auth']->isUserLoggedIn();
        $twig->addGlobal('loggedin', $isUserLoggedIn);
        if ($isUserLoggedIn) {
            $twig->addGlobal('user', $this->di['api_user']);
        }
 
        if ($this->di['auth']->isAdminLoggedIn()) {
            $twig->addGlobal('admin', $this->di['api_admin']);
            $twig->addGlobal('adminLoggedIn', true);
        }
 
        // --- Auto Breadcrumb & Page Title ---
        $breadcrumbResolver = new FOSSBilling\BreadcrumbResolver();
        $breadcrumbResolver->setDi($this->di);
        $breadcrumbData = $breadcrumbResolver->resolve($_SERVER['REQUEST_URI'] ?? '/');
        $twig->addGlobal('breadcrumbnav', $breadcrumbData['breadcrumbnav']);
        $twig->addGlobal('pagetitle', $breadcrumbData['pagetitle']);
/var/www/sultpoint/html/library/Box/AppClient.php
        } catch (Exception $e) {
            if (DEBUG) {
                error_log($e->getMessage());
            }
        }
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
        $this->di['logger']->setChannel('routing')->info($e->getMessage());
        http_response_code(404);
 
        return $this->render('error', ['exception' => $e]);
    }
 
    /**
     * @param string $fileName
     */
    public function render($fileName, $variableArray = [], $ext = 'html.twig'): string
    {
        try {
            $template = $this->getTwig()->load(Path::changeExtension($fileName, $ext));
        } catch (Twig\Error\LoaderError $e) {
            $this->di['logger']->setChannel('routing')->info($e->getMessage());
            http_response_code(404);
 
            throw new FOSSBilling\InformationException('Page not found', null, 404);
        }
 
        if ("{$fileName}.{$ext}" == 'mod_page_sitemap.xml') {
            header('Content-Type: application/xml');
        }
 
        // Set filename for WHMCS template compatibility
        // Use templatefile if provided, otherwise extract from the template path
        if (!isset($variableArray['filename'])) {
            $variableArray['filename'] = $variableArray['templatefile'] ?? basename($fileName);
        }
 
        return $template->render($variableArray);
    }
 
/var/www/sultpoint/html/library/Box/AppClient.php
        $ext = $this->ext;
        if (str_contains((string) $page, '.')) {
            $ext = substr((string) $page, strpos((string) $page, '.') + 1);
            $page = substr((string) $page, 0, strpos((string) $page, '.'));
        }
        $page = str_replace('/', '_', $page);
 
        // Redirect logged-in users away from login/register pages
        if (in_array($page, ['login', 'register', 'signup'], true)) {
            if ($this->di['auth']->isClientLoggedIn()) {
                $redirectUrl = $this->di['url']->link('clientarea');
                header("Location: {$redirectUrl}");
                exit;
            }
        }
 
        $tpl = 'mod_page_' . $page;
 
        try {
            return $this->render($tpl, ['post' => $_POST], $ext);
        } catch (Exception $e) {
            if (DEBUG) {
                error_log($e->getMessage());
            }
        }
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
        $this->di['logger']->setChannel('routing')->info($e->getMessage());
        http_response_code(404);
 
        return $this->render('error', ['exception' => $e]);
    }
 
    /**
     * @param string $fileName
     */
    public function render($fileName, $variableArray = [], $ext = 'html.twig'): string
    {
        try {
            $template = $this->getTwig()->load(Path::changeExtension($fileName, $ext));
[internal]
/var/www/sultpoint/html/library/Box/App.php
    }
 
    protected function execute($methodName, $params, $classname = null): string
    {
        $this->debugBar['time']->startMeasure('execute', 'Reflecting module controller');
 
        $reflection = new ReflectionMethod(static::class, $methodName);
        $args = [];
 
        foreach ($reflection->getParameters() as $param) {
            if (isset($params[$param->name])) {
                $args[$param->name] = $params[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $args[$param->name] = $param->getDefaultValue();
            }
        }
 
        $this->debugBar['time']->stopMeasure('execute');
 
        return $reflection->invokeArgs($this, $args);
    }
 
    protected function event(string $httpMethod, string $url, string $methodName, ?array $conditions = [], ?string $classname = null): void
    {
        if (method_exists($this, $methodName)) {
            $this->mappings[] = [$httpMethod, $url, $methodName, $conditions];
        }
        if ($classname !== null) {
            $this->shared[] = [$httpMethod, $url, $methodName, $conditions, $classname];
        }
    }
 
    protected function checkAllowedURLs(): bool
    {
        $REQUEST_URI = $_SERVER['REQUEST_URI'] ?? null;
 
        $allowedURLs = Config::getProperty('maintenance_mode.allowed_urls', []);
 
        // Allow access to the staff panel all the time
        $adminApiPrefixes = [
/var/www/sultpoint/html/library/Box/App.php
            $mapping = $this->shared[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $this->debugBar['time']->stopMeasure('sharedMapping');
 
                return $this->executeShared($mapping[4], $mapping[2], $url->params);
            }
        }
        $this->debugBar['time']->stopMeasure('sharedMapping');
 
        // this class mappings
        $this->debugBar['time']->startMeasure('mapping', 'Checking mappings');
        $mappingsCount = count($this->mappings);
        for ($i = 0; $i < $mappingsCount; ++$i) {
            $mapping = $this->mappings[$i];
            $url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url);
            if ($url->match) {
                $this->debugBar['time']->stopMeasure('mapping');
 
                return $this->execute($mapping[2], $url->params);
            }
        }
        $this->debugBar['time']->stopMeasure('mapping');
 
        $e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
 
        return $this->show404($e);
    }
}
 
/var/www/sultpoint/html/library/Box/App.php
    public function delete(string $url, string $methodName, ?array $conditions = [], ?string $class = null): void
    {
        $this->event('delete', $url, $methodName, $conditions, $class);
    }
 
    public function run(): string
    {
        $this->debugBar['time']->startMeasure('registerModule', 'Registering module routes');
        $this->registerModule();
        $this->debugBar['time']->stopMeasure('registerModule');
 
        $this->debugBar['time']->startMeasure('init', 'Initializing the app');
        $this->init();
        $this->debugBar['time']->stopMeasure('init');
 
        $this->debugBar['time']->startMeasure('checkperm', 'Checking access to module');
        $this->checkPermission();
        $this->debugBar['time']->stopMeasure('checkperm');
 
        return $this->processRequest();
    }
 
    /**
     * @param string $path
     */
    public function redirect($path): never
    {
        $location = $this->di['url']->link($path);
        header("Location: $location");
        exit;
    }
 
    public function render($fileName, $variableArray = []): string
    {
        return 'Rendering ' . $fileName;
    }
 
    public function sendFile($filename, $contentType, $path): false|int
    {
        header("Content-type: $contentType");
/var/www/sultpoint/html/index.php
 
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
    switch ($http_err_code) {
        case '404':
            $e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
            echo $app->show404($e);
 
            break;
        default:
            $http_err_code = intval($http_err_code);
            http_response_code($http_err_code);
            $e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
            echo $app->render('error', ['exception' => $e]);
    }
    exit;
}
 
// If no HTTP error passed, run the app.
echo $app->run();
exit;
 

Environment & details:

Key Value
PHP Version
"8.4.15"
Error code
0
Instance ID
"440abc0d-700b-4722-b33f-e4998afe30c6"
Key Value
_url
"/sitemap.xml"
empty
empty
empty
empty
Key Value
REDIRECT_MMDB_ADDR
"216.73.216.87"
REDIRECT_MMDB_INFO
"result found"
REDIRECT_MM_COUNTRY_CODE
"US"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
MMDB_ADDR
"216.73.216.87"
MMDB_INFO
"result found"
MM_COUNTRY_CODE
"US"
HTTP_AUTHORIZATION
""
HTTP_X_FORWARDED_PROTO
"https"
HTTP_X_FORWARDED_PORT
"443"
HTTP_HOST
"sultpoint.net"
HTTP_X_AMZN_TRACE_ID
"Root=1-6a0f1c75-29838a6765e6536158a0a06e"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin"
SERVER_SIGNATURE
"<address>Apache Server at sultpoint.net Port 80</address>\n"
SERVER_SOFTWARE
"Apache"
SERVER_NAME
"sultpoint.net"
SERVER_ADDR
"10.140.3.201"
SERVER_PORT
"80"
REMOTE_ADDR
"216.73.216.87"
DOCUMENT_ROOT
"/var/www/sultpoint/html"
REQUEST_SCHEME
"http"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/sultpoint/html"
SERVER_ADMIN
"webmaster@sultpoint.net"
SCRIPT_FILENAME
"/var/www/sultpoint/html/index.php"
REMOTE_PORT
"32936"
REDIRECT_URL
"/sitemap.xml"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/sitemap.xml"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1779375221.253
REQUEST_TIME
1779375221
empty
0. Whoops\Handler\PrettyPageHandler