Skip to content
LaCodon edited this page Mar 1, 2016 · 2 revisions

namespace Famework\Registry

This class offers an application wide registry (global variables). The registry is not available across requests.

Contents

Relevant public methods

set

Set a registry entry.
Throws Famework_Exception_Registry_Error if $name is already used

static void set(string $name, mixed $value)
Parameter Purpose
name The identifier
value The value to store

get

Get a registry entry.
Throws Famework_Exception_Registry_Error

static mixed get(string $name [, $strict = TRUE])
Parameter Purpose
name The identifier
strict If $strict is TRUE, an exception will be thrown if $name is not set.
RETURN The value or NULL

getDb

Get database instance, set by Famework::_construct if your config.ini provides DB credentials, else:
Throws Famework_Exception_Database_Fail

static \PDO getDb()

setEnv

Set the application environment.

static void setEnv(int $env)
Parameter Purpose
env 1: DEVELOPMENT; 2: PRODUCTION

getEnv

Get the application environment.

static int getEnv()
Parameter Purpose
RETURN 1: DEVELOPMENT; 2: PRODUCTION

getView

Get the current Famework_View.

static \Famework\View\Famework_View getView()