\Dewdrop\SilexEnv

Summary

Methods
Properties
Constants
isInUse()
getConfigData()
getBootstrapClass()
bootstrapCli()
initializeCli()
initializePimple()
providePimpleSessionResource()
getCurrentUserId()
getProjectNoun()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$configData
N/A

Properties

$configData

$configData : 

Type

Methods

isInUse()

isInUse() : boolean

Determine if your environment is currently in use. Typically, you'll look for the existence of some object, constant or class that indicates your environment is being used.

Returns

boolean

getConfigData()

getConfigData(  $file = null) : array

Get the configuration data Dewdrop needs to operate. Should be of this shape:

[ 'bootstrap' => '\Your\Bootstrap\ClassName', 'db' => [ 'type' => 'pgsql|mysql', 'username' => 'user', 'password' => '123456!', 'name' => 'my_database', 'host' => 'localhost' ] ]

Parameters

$file

Returns

array

getBootstrapClass()

getBootstrapClass() : string

Get the bootstrap class that should be used for your environment. Will often come from the config data. However, if you want to allow users to override the bootstrap class in your environment via some other constant or configuration flag, you can implement that logic here.

Returns

string

bootstrapCli()

bootstrapCli() : void

This method gets called on all environments when Dewdrop is run on the CLI.

It isn't only called on the active/in-use environment. This gives your environment an opportunity to configure any globals or PHP settings it needs to operate well on the CLI.

initializeCli()

initializeCli() : void

If, after the bootstrapCli() portion of the execution lifecycle, Dewdrop determines that your environment is the one that is currently in use, this method will be called to allow you to perform any application boot-up needed.

initializePimple()

initializePimple(\Pimple  $pimple) : void

Add or override any Pimple resources.

Parameters

\Pimple $pimple

providePimpleSessionResource()

providePimpleSessionResource(\Pimple  $pimple) : void

Provide session and session.storage resources for Pimple. The "session" resource should be the environment-specific session object typically used (e.g.

Zend_Session_Namespace, WP_Session, etc) and "session.storage" should be an implementor of \Dewdrop\Session\SessionStorageInterface that wraps that platform- specific API.

Parameters

\Pimple $pimple

getCurrentUserId()

getCurrentUserId() : integer|null

Get the ID for the currently logged in user or null if no user is logged in.

Returns

integer|null

getProjectNoun()

getProjectNoun() : string

Return a string that can be used to describe projects in this environment. Typically either app or plugin depending upon how Dewdrop is typically used.

Returns

string