class Extension implements Arrayable

Constants

LOGO_MIMETYPES

Properties

protected string $id Unique Id of the extension.
protected string $path The directory of this extension.
protected array $composerJson Composer json of the package.
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 Whether the extension is installed.
protected string $version The installed version of the extension.
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($path, array $composerJson)

No description

static 
nameToId($name)

No description

assignId()

Assigns the id for the extension used globally.

extend(Container $container)

No description

__get($name)

{@inheritdoc}

__isset($name)

{@inheritdoc}

mixed
composerJsonAttribute($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

calculateDependencies($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()

Loads the icon information from the composer.json.

string
getIconStyles()

No description

enable(Container $container)

No description

disable(Container $container)

No description

string
getId()

The raw path of the directory under extensions.

string
getTitle()

No description

string|null
getNamespace()

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.

getLinks()

Compile a list of links for this extension.

bool
hasAssets()

Tests whether the extension has assets.

copyAssetsTo(Filesystem $target)

No description

bool
hasMigrations()

Tests whether the extension has migrations.

int|void
migrate(Migrator $migrator, $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($path, array $composerJson)

Parameters

$path
array $composerJson

static protected nameToId($name)

Parameters

$name

protected assignId()

Assigns the id for the extension used globally.

extend(Container $container)

Parameters

Container $container

__get($name)

{@inheritdoc}

Parameters

$name

__isset($name)

{@inheritdoc}

Parameters

$name

mixed composerJsonAttribute($name)

Dot notation getter for composer.json attributes.

Parameters

$name

Return Value

mixed

See also

https://laravel.com/docs/8.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

calculateDependencies($extensionSet)

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

Parameters

$extensionSet

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()

Loads the icon information from the composer.json.

Return Value

array|null

string getIconStyles()

Return Value

string

enable(Container $container)

Parameters

Container $container

disable(Container $container)

Parameters

Container $container

string getId()

The raw path of the directory under extensions.

Return Value

string

string getTitle()

Return Value

string

string|null getNamespace()

Return Value

string|null

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.

bool hasAssets()

Tests whether the extension has assets.

Return Value

bool

copyAssetsTo(Filesystem $target)

Parameters

Filesystem $target

bool hasMigrations()

Tests whether the extension has migrations.

Return Value

bool

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

Parameters

Migrator $migrator
$direction

Return Value

int|void

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