\AlphredGlobals

A class to reteive certain Global variables

Basically, it gives you access to the subset of variables.

This class was written so that CodeClimate would stop throwing a fit because I was accessing the $_SERVER variable directly.

Summary

Methods
Properties
Constants
__construct()
get()
bundle()
data()
cache()
is_background()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$variables
N/A

Properties

$variables

$variables : array

An array of Global variables that can be accessed

Type

array

Methods

__construct()

__construct() 

Throws an exception if you try to instantiate it

Throws

\Alphred\UseOnlyAsStatic

if you try to institate a Globals object

get()

get(string  $name) : string

Retrieves a variable from the global $_SERVER array

Parameters

string $name

name of the variable

Throws

\Alphred\RunningOutsideOfAlfred

Returns

string —

value of the variable

bundle()

bundle() : string

Retrieves the bundle id of the workflow from the global $_SERVER array

Returns

string —

the bundle id of the running workflow

data()

data() : string

Retrieves the data directory of the running workflow

Returns

string —

path to the workflow's data directory

cache()

cache() : string

Retrieves the cache directory of the running workflow

Returns

string —

path to the workflow's cache directory

is_background()

is_background() : boolean

Checks if the script is running in the background

This is aware only of a script running in the background if it was launched by the Alphred wrapper's background() method.

Returns

boolean —

[description]