get() public static method

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
return mixed
Beispiel #1
0
 /**
  * Dependency injection aside from the controller. Allows you to write your
  * own constructors.
  * 
  * This is final so nobody changes it in a Gear. Please don't mess with 
  * this component.
  * 
  * @param Lens $lens
  * @param array $databases
  * @param string $urlPrefix
  */
 public final function airshipEjectFromCockpit(Lens $lens, array $databases = [], string $urlPrefix = '')
 {
     $this->airship_http_method = $_SERVER['REQUEST_METHOD'];
     $this->airship_lens_object = $lens;
     $this->airship_databases = $databases;
     $this->airship_csrf = Gears::get('CSRF');
     $this->airship_cabin_prefix = \rtrim('/' . $urlPrefix, '/');
     $file = ROOT . '/config/Cabin/' . \CABIN_NAME . '/config.json';
     if (\file_exists($file)) {
         $this->airship_config = \Airship\loadJSON($file);
     }
     $this->airshipLand();
 }