PHP Class Flarum\Extension\Extension

Inheritance: implements Illuminate\Contracts\Support\Arrayable
显示文件 Open project: flarum/core Class Usage Examples

Protected Properties

Property Type Description
$composerJson array Composer json of the package.
$enabled boolean Whether the extension is enabled.
$id string Unique Id of the extension.
$installed boolean Whether the extension is installed.
$path string The directory of this extension.
$version string The installed version of the extension.

Public Methods

Method Description
__construct ( $path, array $composerJson )
__get ( $name )
__isset ( $name )
composerJsonAttribute ( $name ) : mixed Dot notation getter for composer.json attributes.
getIcon ( ) : array | null Loads the icon information from the composer.json.
getId ( ) : string The raw path of the directory under extensions.
getPath ( ) : string
getVersion ( ) : string
hasAssets ( ) : boolean Tests whether the extension has assets.
hasMigrations ( ) : boolean Tests whether the extension has migrations.
isEnabled ( ) : boolean
isInstalled ( ) : boolean
setEnabled ( boolean $enabled ) : Extension
setInstalled ( boolean $installed ) : Extension
setVersion ( string $version ) : Extension
toArray ( ) : array Generates an array result for the object.

Protected Methods

Method Description
assignId ( ) Assigns the id for the extension used globally.

Method Details

__construct() public method

public __construct ( $path, array $composerJson )
$path
$composerJson array

__get() public method

public __get ( $name )

__isset() public method

public __isset ( $name )

assignId() protected method

Assigns the id for the extension used globally.
protected assignId ( )

composerJsonAttribute() public method

Dot notation getter for composer.json attributes.
See also: https://laravel.com/docs/5.1/helpers#arrays
public composerJsonAttribute ( $name ) : mixed
$name
return mixed

getIcon() public method

Loads the icon information from the composer.json.
public getIcon ( ) : array | null
return array | null

getId() public method

The raw path of the directory under extensions.
public getId ( ) : string
return string

getPath() public method

public getPath ( ) : string
return string

getVersion() public method

public getVersion ( ) : string
return string

hasAssets() public method

Tests whether the extension has assets.
public hasAssets ( ) : boolean
return boolean

hasMigrations() public method

Tests whether the extension has migrations.
public hasMigrations ( ) : boolean
return boolean

isEnabled() public method

public isEnabled ( ) : boolean
return boolean

isInstalled() public method

public isInstalled ( ) : boolean
return boolean

setEnabled() public method

public setEnabled ( boolean $enabled ) : Extension
$enabled boolean
return Extension

setInstalled() public method

public setInstalled ( boolean $installed ) : Extension
$installed boolean
return Extension

setVersion() public method

public setVersion ( string $version ) : Extension
$version string
return Extension

toArray() public method

Generates an array result for the object.
public toArray ( ) : array
return array

Property Details

$composerJson protected_oe property

Composer json of the package.
protected array $composerJson
return array

$enabled protected_oe property

Whether the extension is enabled.
protected bool $enabled
return boolean

$id protected_oe property

Unique Id of the extension.
protected string $id
return string

$installed protected_oe property

Whether the extension is installed.
protected bool $installed
return boolean

$path protected_oe property

The directory of this extension.
protected string $path
return string

$version protected_oe property

The installed version of the extension.
protected string $version
return string