mini\Mini final class

Documentation

Core framework singleton that manages application configuration and service container.

This class is instantiated once when Composer's autoloader loads vendor/fubber/mini/bootstrap.php. It provides:

  • Application configuration (root, locale, timezone, debug mode)
  • PSR-11 service container with Singleton, Scoped, and Transient lifetimes
  • Path registries for multi-location file resolution (config, routes, views)
  • Lifecycle phase management (Initializing → Bootstrap → Ready → Shutdown)

Configuration is read from environment variables (MINI_* prefixed) or .env file in project root. All configuration happens during instantiation - the Mini instance is immutable after construction.

Inheritance

Implements: Psr\Container\ContainerInterface

Properties (15)

public static ?mini\Mini $mini

Global singleton instance of Mini framework.

public readonly string $root

Application root directory path.

public readonly mini\Mini\PathRegistries $paths

Path registries for multi-location file resolution.

public readonly ?string $docRoot

Web-accessible document root directory path.

public readonly ?string $baseUrl

Base URL for the application.

public readonly ?string $cdnUrl

CDN base URL for static assets.

public readonly string $locale

Default locale for internationalization.

public readonly string $timezone

Default timezone for date/time operations.

public readonly string $sqlTimezone

Database timezone for datetime storage (offset format, e.g., '+00:00').

public readonly string $defaultLanguage

Default language code for translations.

public readonly bool $debug

Debug mode flag.

public readonly string $salt

Application-wide cryptographic salt.

private readonly WeakMap $instanceCache

Caches instances using a scope object; each request will

public readonly mini\Hooks\StateMachine $phase

Application lifecycle state machine

private array $services

Service definitions (factory closures + lifetime)

Methods (13)

Documentation missing

An object that uniquely identifies the current request scope.

Load a configuration file using the path registry system.

Load service configuration by class name using path registry.

Returns an object that will survive for the duration of the current

Register a service with the container

Set a service instance directly, bypassing factory creation.

Check if a service is registered in the container

Get a service from the container

Create a closure that invokes a callable or constructs a class with dependency injection.

Resolve parameters for dependency injection.

Detect the project root directory.

Documentation missing

Source

src/Mini.php:34-751