PHP Класс Airship\Engine\Gears

The gears class contains a bunch of methods for the plugin system (Airship Gears)
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
attach ( string $index, string $new_type, string $namespace = '' ) : boolean Attach a plugin to overload the base class
extract ( string $index, string $desired_name, string $namespace = '' ) : string Create a shim that extends a gear type
forge ( string $index, string $type ) : boolean Add a new type to the Gears registry
get ( string $name, variadic $args ) : mixed Get an instance of a gear (all arguments after the first are passed to its constructor)
getName ( string $name ) : string Get the class name of a Gear
init ( array $gears = [] ) Set up initial classes
lazyForge ( string $index, string $type ) : boolean Add a new type to the Gears registry

Защищенные методы

Метод Описание
coreEval ( string $code, boolean $cache = false, boolean $do_not_eval = false ) : mixed Execute a block of code.
sandboxRequire ( string $file ) : boolean Load a file in a way that doesn't allow access to the parent method's internal functions

Описание методов

attach() публичный статический Метод

Attach a plugin to overload the base class
public static attach ( string $index, string $new_type, string $namespace = '' ) : boolean
$index string Index
$new_type string New type
$namespace string Namespace
Результат boolean

coreEval() защищенный статический Метод

Execute a block of code.
protected static coreEval ( string $code, boolean $cache = false, boolean $do_not_eval = false ) : mixed
$code string
$cache boolean
$do_not_eval boolean
Результат mixed

extract() публичный статический Метод

Create a shim that extends a gear type
public static extract ( string $index, string $desired_name, string $namespace = '' ) : string
$index string
$desired_name string
$namespace string Namespace
Результат string

forge() публичный статический Метод

Add a new type to the Gears registry
public static forge ( string $index, string $type ) : boolean
$index string
$type string
Результат boolean

get() публичный статический Метод

Get an instance of a gear (all arguments after the first are passed to its constructor)
public static get ( string $name, variadic $args ) : mixed
$name string - Gear identifier
$args variadic - constructor parameters
Результат mixed

getName() публичный статический Метод

Get the class name of a Gear
public static getName ( string $name ) : string
$name string
Результат string

init() публичный статический Метод

Set up initial classes
public static init ( array $gears = [] )
$gears array

lazyForge() публичный статический Метод

Add a new type to the Gears registry
public static lazyForge ( string $index, string $type ) : boolean
$index string
$type string
Результат boolean

sandboxRequire() защищенный Метод

Load a file in a way that doesn't allow access to the parent method's internal functions
protected sandboxRequire ( string $file ) : boolean
$file string
Результат boolean