class Project

Properties

static $instance
static array $modules
string $name
string $description

Methods

__construct()

No description

static Project
get()

Get the current project.

static void
setRootPath(string $path)

Set the project's root path.

static string
getRootPath()

Get the project's root path.

static void
init()

Bootstraps the whole application: environment, error handling, session, modules, the project's own boot hook, routing and dispatch.

static 
initPackages()

No description

static 
boot()

Executes the project boot file if exists

array
getLanguages()

Get the available languages for the project.

bool
hasLanguage(string $lang)

Check if the project supports a specific language.

string
getDefaultLanguage()

Get the default language for the project.

Collection
getModules()

Get the project active modules

bool
hasModule(string $module)

Get if a project has a module

static 
pushModule(string $name, string $fqcn)

No description

Details

at line 16
__construct()

No description

at line 27
static Project get()

Get the current project.

Return Value

Project

at line 43
static void setRootPath(string $path)

Set the project's root path.

This package is installed as a Composer dependency, so it has no reliable way to find the consuming project's root on its own. The entry point (public/index.php) is expected to call this, once, before anything that resolves paths (root_path(), public_path(), config(), ...) is used.

Parameters

string $path

The project's root path.

Return Value

void

at line 54
static string getRootPath()

Get the project's root path.

Return Value

string

Exceptions

Exception

at line 67
static void init()

Bootstraps the whole application: environment, error handling, session, modules, the project's own boot hook, routing and dispatch.

Return Value

void

at line 181
static initPackages()

No description

at line 199
static boot()

Executes the project boot file if exists

at line 211
array getLanguages()

Get the available languages for the project.

Return Value

array

The list of available languages.

at line 221
bool hasLanguage(string $lang)

Check if the project supports a specific language.

Parameters

string $lang

The language code to check (e.g., "en", "it").

Return Value

bool

True if the language is supported, false otherwise.

at line 230
string getDefaultLanguage()

Get the default language for the project.

Return Value

string

The default language.

at line 239
Collection getModules()

Get the project active modules

Return Value

Collection

The collection of active modules.

at line 253
bool hasModule(string $module)

Get if a project has a module

Parameters

string $module

The module to check for

Return Value

bool

True if the project has the module, false otherwise.

at line 258
static pushModule(string $name, string $fqcn)

No description

Parameters

string $name
string $fqcn