FOSSBilling \ Exception
Invalid module name FOSSBilling\Exception thrown with message "Invalid module name" Stacktrace: #4 FOSSBilling\Exception in /home/admin/domains/nicsdata.no/public_html/library/Box/Mod.php:57 #3 Box_Mod:__construct in /home/admin/domains/nicsdata.no/public_html/di.php:186 #2 {closure} in /home/admin/domains/nicsdata.no/public_html/library/Box/AppClient.php:22 #1 Box_AppClient:init in /home/admin/domains/nicsdata.no/public_html/library/Box/App.php:122 #0 Box_App:run in /home/admin/domains/nicsdata.no/public_html/index.php:94
Stack frames (5)
4
FOSSBilling\Exception
/library/Box/Mod.php57
3
Box_Mod __construct
/di.php186
2
{closure}
/library/Box/AppClient.php22
1
Box_AppClient init
/library/Box/App.php122
0
Box_App run
/index.php94
/home/admin/domains/nicsdata.no/public_html/library/Box/Mod.php
        'servicedomain',
        'servicedownloadable',
        'servicehosting',
        'servicelicense',
        'staff',
        'stats',
        'support',
        'system',
        'theme',
        'orderbutton',
        'formbuilder',
    ];
 
    /**
     * @param string $mod
     */
    public function __construct($mod)
    {
        if (!preg_match('#[a-zA-Z]#', $mod)) {
            throw new FOSSBilling\Exception('Invalid module name');
        }
 
        $this->mod = strtolower($mod);
    }
 
    public function setDi(Pimple\Container $di): void
    {
        $this->di = $di;
    }
 
    public function hasManifest()
    {
        return file_exists(Path::normalize($this->_getModPath() . 'manifest.json'));
    }
 
    public function getManifest(): array
    {
        if (!$this->hasManifest()) {
            throw new FOSSBilling\Exception('Module :mod manifest file is missing', [':mod' => $this->mod], 5897);
        }
Arguments
  1. "Invalid module name"
    
/home/admin/domains/nicsdata.no/public_html/di.php
 *
 * @return Box_Url
 */
$di['url'] = function () use ($di) {
    $url = new Box_Url();
    $url->setDi($di);
    $url->setBaseUri(SYSTEM_URL);
 
    return $url;
};
 
/*
 * Returns a new Box_Mod object, created with the provided module name.
 *
 * @param string $name The name of the module to create the object with.
 *
 * @return \Box_Mod The new Box_Mod object that was just created.
 */
$di['mod'] = $di->protect(function ($name) use ($di) {
    $mod = new Box_Mod($name);
    $mod->setDi($di);
 
    return $mod;
});
 
/*
 *
 * @param string $mod the name of the module to get
 *
 * @return mixed the service of the associated module
 */
$di['mod_service'] = $di->protect(fn ($mod, $sub = '') => $di['mod']($mod)->getService($sub));
 
/*
 *
 * @param string $name the name of the module to get the configuration of
 *
 * @return mixed the configuration of the associated module
 */
$di['mod_config'] = $di->protect(fn ($name) => $di['mod']($name)->getConfig());
/home/admin/domains/nicsdata.no/public_html/library/Box/AppClient.php
/**
 * Copyright 2022-2024 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
 */
 
use DebugBar\Bridge\NamespacedTwigProfileCollector;
use FOSSBilling\Environment;
use FOSSBilling\TwigExtensions\DebugBar;
use Twig\Extension\ProfilerExtension;
use Twig\Profiler\Profile;
 
class Box_AppClient extends Box_App
{
    protected function init(): void
    {
        $m = $this->di['mod']($this->mod);
        $m->registerClientRoutes($this);
 
        if ($this->mod == 'api') {
            define('API_MODE', true);
 
            // Prevent errors from being displayed in API mode as it can cause invalid JSON to be returned.
            ini_set('display_errors', '0');
            ini_set('display_startup_errors', '0');
        } else {
            $extensionService = $this->di['mod_service']('extension');
            if ($extensionService->isExtensionActive('mod', 'redirect')) {
                $m = $this->di['mod']('redirect');
                $m->registerClientRoutes($this);
            }
 
            // init index module manually
            $this->get('', 'get_index');
            $this->get('/', 'get_index');
 
            // init custom methods for undefined pages
/home/admin/domains/nicsdata.no/public_html/library/Box/App.php
    }
 
    public function put(string $url, string $methodName, ?array $conditions = [], string $class = null): void
    {
        $this->event('put', $url, $methodName, $conditions, $class);
    }
 
    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
/home/admin/domains/nicsdata.no/public_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.3.16"
Error code
0
Instance ID
"11aac6c6-de74-40fe-b9e2-f799dfbe4a31"
Key Value
_url
"/2019/02/05/klimashop-as-hjemmeside/"
empty
empty
empty
empty
Key Value
USER
"admin"
HOME
"/home/admin"
SCRIPT_NAME
"/index.php"
REQUEST_URI
"/2019/02/05/klimashop-as-hjemmeside/"
QUERY_STRING
"_url=/2019/02/05/klimashop-as-hjemmeside/"
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/2.0"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_QUERY_STRING
"_url=/2019/02/05/klimashop-as-hjemmeside/"
REDIRECT_URL
"/2019/02/05/klimashop-as-hjemmeside/"
REMOTE_PORT
"56682"
SCRIPT_FILENAME
"/home/admin/domains/nicsdata.no/private_html/index.php"
SERVER_ADMIN
"webmaster@nicsdata.no"
CONTEXT_DOCUMENT_ROOT
"/home/admin/domains/nicsdata.no/private_html"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/home/admin/domains/nicsdata.no/private_html"
REMOTE_ADDR
"216.73.216.58"
SERVER_PORT
"443"
SERVER_ADDR
"192.168.1.72"
SERVER_NAME
"nicsdata.no"
SERVER_SOFTWARE
"Apache/2"
SERVER_SIGNATURE
""
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
HTTP_HOST
"nicsdata.no"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_ACCEPT
"*/*"
proxy-nokeepalive
"1"
H2_STREAM_TAG
"2157390-137-3"
H2_STREAM_ID
"3"
H2_PUSHED_ON
""
H2_PUSHED
""
H2_PUSH
"off"
H2PUSH
"off"
HTTP2
"on"
SSL_TLS_SNI
"nicsdata.no"
HTTPS
"on"
HTTP_AUTHORIZATION
""
SCRIPT_URI
"https://nicsdata.no/2019/02/05/klimashop-as-hjemmeside/"
SCRIPT_URL
"/2019/02/05/klimashop-as-hjemmeside/"
UNIQUE_ID
"aGl1MtxhZNBO_fqQU567VgAArw8"
REDIRECT_STATUS
"200"
REDIRECT_H2_STREAM_TAG
"2157390-137-3"
REDIRECT_H2_STREAM_ID
"3"
REDIRECT_H2_PUSHED_ON
""
REDIRECT_H2_PUSHED
""
REDIRECT_H2_PUSH
"off"
REDIRECT_H2PUSH
"off"
REDIRECT_HTTP2
"on"
REDIRECT_SSL_TLS_SNI
"nicsdata.no"
REDIRECT_HTTPS
"on"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_SCRIPT_URI
"https://nicsdata.no/2019/02/05/klimashop-as-hjemmeside/"
REDIRECT_SCRIPT_URL
"/2019/02/05/klimashop-as-hjemmeside/"
REDIRECT_UNIQUE_ID
"aGl1MtxhZNBO_fqQU567VgAArw8"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1751741746.7138
REQUEST_TIME
1751741746
empty
0. Whoops\Handler\PrettyPageHandler