PHP Class Airship\Engine\Gears

The gears class contains a bunch of methods for the plugin system (Airship Gears)
Afficher le fichier Open project: paragonie/airship Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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

Method Details

attach() public static méthode

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
Résultat boolean

coreEval() protected static méthode

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
Résultat mixed

extract() public static méthode

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
Résultat string

forge() public static méthode

Add a new type to the Gears registry
public static forge ( string $index, string $type ) : boolean
$index string
$type string
Résultat boolean

get() public static méthode

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
Résultat mixed

getName() public static méthode

Get the class name of a Gear
public static getName ( string $name ) : string
$name string
Résultat string

init() public static méthode

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

lazyForge() public static méthode

Add a new type to the Gears registry
public static lazyForge ( string $index, string $type ) : boolean
$index string
$type string
Résultat boolean

sandboxRequire() protected méthode

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
Résultat boolean