class Extension implements Arrayable

Constants

LOGO_MIMETYPES

Properties

protected string $id <p>Unique Id of the extension.</p>
protected string $path <p>The directory of this extension.</p>
protected array $composerJson <p>Composer json of the package.</p>
protected string[] $extensionDependencyIds <p>The IDs of all Flarum extensions that this extension depends on.</p>
protected string[] $optionalDependencyIds <p>The IDs of all Flarum extensions that this extension should be booted after if enabled.</p>
protected bool $installed <p>Whether the extension is installed.</p>
protected string $version <p>The installed version of the extension.</p>
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()

<p>Assigns the id for the extension used globally.</p>

extend(Container $container)

No description

__get($name)

<p>{@inheritdoc}</p>

__isset($name)

<p>{@inheritdoc}</p>

mixed
composerJsonAttribute($name)

<p>Dot notation getter for composer.json attributes.</p>

setInstalled(bool $installed)

No description

bool
isInstalled()

No description

setVersion(string $version)

No description

calculateDependencies($extensionSet, $enabledIds)

<p>Get the list of flarum extensions that this extension depends on.</p>

string
getVersion()

No description

array|null
getIcon()

<p>Loads the icon information from the composer.json.</p>

string
getIconStyles()

No description

enable(Container $container)

No description

disable(Container $container)

No description

string
getId()

<p>The raw path of the directory under extensions.</p>

string
getTitle()

No description

string
getPath()

No description

array
getExtensionDependencyIds()

<p>The IDs of all Flarum extensions that this extension depends on.</p>

array
getOptionalDependencyIds()

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

getLinks()

<p>Compile a list of links for this extension.</p>

bool
hasAssets()

<p>Tests whether the extension has assets.</p>

copyAssetsTo(Filesystem $target)

No description

bool
hasMigrations()

<p>Tests whether the extension has migrations.</p>

migrate(Migrator $migrator, $direction = 'up')

No description

array
toArray()

<p>Generates an array result for the object.</p>

string|null
getReadme()

<p>Gets the rendered contents of the extension README file as a HTML string.</p>

Details

__construct($path, array $composerJson)

Parameters

$path
array $composerJson

static protected nameToId($name)

Parameters

$name

protected assignId()

<p>Assigns the id for the extension used globally.</p>

extend(Container $container)

Parameters

Container $container

__get($name)

<p>{@inheritdoc}</p>

Parameters

$name

__isset($name)

<p>{@inheritdoc}</p>

Parameters

$name

mixed composerJsonAttribute($name)

<p>Dot notation getter for composer.json attributes.</p>

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

calculateDependencies($extensionSet, $enabledIds)

<p>Get the list of flarum extensions that this extension depends on.</p>

Parameters

$extensionSet
$enabledIds

string getVersion()

Return Value

string

array|null getIcon()

<p>Loads the icon information from the composer.json.</p>

Return Value

array|null

string getIconStyles()

Return Value

string

enable(Container $container)

Parameters

Container $container

disable(Container $container)

Parameters

Container $container

string getId()

<p>The raw path of the directory under extensions.</p>

Return Value

string

string getTitle()

Return Value

string

string getPath()

Return Value

string

array getExtensionDependencyIds()

<p>The IDs of all Flarum extensions that this extension depends on.</p>

Return Value

array

array getOptionalDependencyIds()

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

Return Value

array

<p>Compile a list of links for this extension.</p>

bool hasAssets()

<p>Tests whether the extension has assets.</p>

Return Value

bool

copyAssetsTo(Filesystem $target)

Parameters

Filesystem $target

bool hasMigrations()

<p>Tests whether the extension has migrations.</p>

Return Value

bool

migrate(Migrator $migrator, $direction = 'up')

Parameters

Migrator $migrator
$direction

array toArray()

<p>Generates an array result for the object.</p>

Return Value

array

string|null getReadme()

<p>Gets the rendered contents of the extension README file as a HTML string.</p>

Return Value

string|null