class Extension implements Arrayable

Constants

LOGO_MIMETYPES

Properties

protected string $id Unique ID of the extension.
protected string[] $extensionDependencyIds The IDs of all Flarum extensions that this extension depends on.
protected string[] $optionalDependencyIds The IDs of all Flarum extensions that this extension should be booted after if enabled.
protected bool $installed
protected string $version
protected bool|string $abandoned Whether the composer package is marked as abandoned.
string $name
string $description
string $type
array $keywords
string $homepage
string $time
string $license
array $authors
array $support
array $require
array $requireDev
array $autoload
array $autoloadDev
array $conflict
array $replace
array $provide
array $suggest
array $extra

Methods

__construct(string $path, array $composerJson)

No description

static string
nameToId(string $name)

No description

void
assignId()

Assigns the id for the extension used globally.

void
extend(Container $container)

No description

mixed
__get(string $name)

No description

bool
__isset(string $name)

No description

mixed
composerJsonAttribute(string $name)

Dot notation getter for composer.json attributes.

setInstalled(bool $installed)

No description

bool
isInstalled()

No description

setVersion(string $version)

No description

setAbandoned(bool|string $abandoned)

No description

void
calculateDependencies(array $extensionSet)

Get the list of flarum extensions that this extension depends on.

string|null
getVersion()

No description

bool
isAbandoned()

Check if the composer package is marked as abandoned.

bool|string
getAbandoned()

Get the abandoned status.

array|null
getIcon()

No description

string
getIconStyles()

No description

void
enable(Container $container)

No description

void
disable(Container $container)

No description

string
getId()

The raw path of the directory under extensions.

string
getTitle()

No description

string
getPath()

No description

array
getExtensionDependencyIds()

The IDs of all Flarum extensions that this extension depends on.

array
getOptionalDependencyIds()

The IDs of all Flarum extensions that this extension should be booted after if enabled.

array
getLinks()

Compile a list of links for this extension.

bool
hasAssets()

Tests whether the extension has assets.

void
copyAssetsTo(Filesystem $target)

No description

bool
hasMigrations()

Tests whether the extension has migrations.

int|null
migrate(Migrator $migrator, string $direction = 'up')

No description

array
toArray()

Generates an array result for the object.

string|null
getReadme()

Gets the rendered contents of the extension README file as a HTML string.

Details

__construct(string $path, array $composerJson)

Parameters

string $path
array $composerJson

static string nameToId(string $name)

Parameters

string $name

Return Value

string

protected void assignId()

Assigns the id for the extension used globally.

Return Value

void

void extend(Container $container)

Parameters

Container $container

Return Value

void

mixed __get(string $name)

Parameters

string $name

Return Value

mixed

bool __isset(string $name)

Parameters

string $name

Return Value

bool

mixed composerJsonAttribute(string $name)

Dot notation getter for composer.json attributes.

Parameters

string $name

Return Value

mixed

See also

https://laravel.com/docs/11.x/helpers#arrays

Extension setInstalled(bool $installed)

Parameters

bool $installed

Return Value

Extension

bool isInstalled()

Return Value

bool

Extension setVersion(string $version)

Parameters

string $version

Return Value

Extension

Extension setAbandoned(bool|string $abandoned)

Parameters

bool|string $abandoned

Return Value

Extension

void calculateDependencies(array $extensionSet)

Get the list of flarum extensions that this extension depends on.

Parameters

array $extensionSet

Return Value

void

string|null getVersion()

Return Value

string|null

bool isAbandoned()

Check if the composer package is marked as abandoned.

Return Value

bool

bool|string getAbandoned()

Get the abandoned status.

Returns false if not abandoned, or a string with the replacement package name if abandoned.

Return Value

bool|string

array|null getIcon()

Return Value

array|null

string getIconStyles()

Return Value

string

void enable(Container $container)

Parameters

Container $container

Return Value

void

void disable(Container $container)

Parameters

Container $container

Return Value

void

string getId()

The raw path of the directory under extensions.

Return Value

string

string getTitle()

Return Value

string

string getPath()

Return Value

string

array getExtensionDependencyIds()

The IDs of all Flarum extensions that this extension depends on.

Return Value

array

array getOptionalDependencyIds()

The IDs of all Flarum extensions that this extension should be booted after if enabled.

Return Value

array

Compile a list of links for this extension.

Return Value

array

bool hasAssets()

Tests whether the extension has assets.

Return Value

bool

void copyAssetsTo(Filesystem $target)

Parameters

Filesystem $target

Return Value

void

bool hasMigrations()

Tests whether the extension has migrations.

Return Value

bool

int|null migrate(Migrator $migrator, string $direction = 'up')

Parameters

Migrator $migrator
string $direction

Return Value

int|null

array toArray()

Generates an array result for the object.

Return Value

array

string|null getReadme()

Gets the rendered contents of the extension README file as a HTML string.

Return Value

string|null