public static function registerApp(string $path, ?string $app = null): void
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (isset(self::$repositories[$app])) {
            throw new ConfigException('Application ' . $app . ' already registered.');
        }
        $path = rtrim($path, '/');
        if (!is_dir($path)) {
            throw new ConfigException('Path ' . $path . ' does not exist.');
        }
        self::$repositories[$app] = new Repository($path);
    }
public static function registerApp(string $path, ?string $app = null): void
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (isset(self::$repositories[$app])) {
            throw new ConfigException('Application ' . $app . ' already registered.');
        }
        $path = rtrim($path, '/');
        if (!is_dir($path)) {
            throw new ConfigException('Path ' . $path . ' does not exist.');
        }
        self::$repositories[$app] = new Repository($path);
    }
public static function registerApp ( string $ path , ? string $ app = null ) : void { self :: initialize ( ) ; if ( $ app === null ) { $ app = '*' ; } if ( isset ( self :: $ repositories [ $ app ] ) ) { throw new ConfigException ( 'Application ' . $ app . ' already registered.' ) ; } $ path = rtrim ( $ path , '/' ) ; if ( ! is_dir ( $ path ) ) { throw new ConfigException ( 'Path ' . $ path . ' does not exist.' ) ; } self :: $ repositories [ $ app ] = new Repository ( $ path ) ; }
Register app.

@param string $path
@param string $app Default null which means default app '*'.
@throws ConfigException
Register app .