Application settings and Constants.

Singleton object. Set application constants at design and at runtime.

package dstruct_common

 Methods

Used to count hits on prepared statements in {@link Base}

countStatementHit() 
Static

Retrieve a value by its key

get(string $key) : \mixed:

Parameters

$key

string

Returns

\mixed:

Get instance of this Singleton class

getInstance() : object
Static

Returns

objectPrefs

Get hits on prepared statements.

getStatementHitCount() : integer
Static

Returns

integer

Set a key / value pair

set(string $key, mixed $val) 

Parameters

$key

string

$val

mixed

Class constructor Only scalar values can be defined as class constants.

__construct() 

Define any global compile time values stored in arrays etc here.

 Properties

 

Instance of Prefs class

$instance : object
 

Properties held by the class

$props : array
 

Counts prepared statement hits

$statementhits : integer

 Constants

 

Application Name The application name is used by caches to identify the application to which the cache data belongs.

APP_NAME : string

Caches are often shared across applications (for instance running on the same server) so use a unique application name to prevent corruption etc. Alternatively, an application running on multiple servers may want this string the same so that data is shared. It is still important to set this constant if you do not use a cache within your script as the framework caches information behind the scenes to improve speed.

 

Default Cache Set the default cache system to be used by the framework.

CACHE_DEFAULT : string

Can be: APC, DStructMemCache, Database, another cache object which impliments DStructCacheInterface or leave blank for none. Not using APC (or using none) will not turn off the APC op-code cache.

 

Set handling for ClickController Session identifier is preferred, or will us the users IP

CLICK_CONTROL_IDENTIFIER_IS_SESSION : \unknown
 

Default currency symbol

CURRENCY_SYMBOL : string
 

DB Connection for {@link DatabaseCache} If you are using a DatabaseCache then you will need to define the name of the connection created in {@link Prefs::DB_CONNECTIONS} here.

DB_CACHE : string
 

<var>DB_CONNECTIONS</var> defines connection strings to databases.

DB_CONNECTIONS : string

These are fed to the system when inc_common.php is loaded but they are LAZY connected. The framework uses PDO. Options:- connectionname,dbtype,host,username,password,schema,port,defaultcharset

 

Development (DEV) or production mode

DEV : boolean

Effects things such as error reporting. Can be used in your scripts to control behaviour - for example missing out some code for a package not available on your local system, controlling logging etc.

 

Default email server If a default email server is available, the DNS name or IP can be entered here.

EMAIL_DEFAULT_HOST : string

All email settings can be overridden or set at runtime and therefore settings here are all optional.

see \SMTPEmail
 

Default email account password

EMAIL_DEFAULT_PASSWORD : string
 

Default email server port

EMAIL_DEFAULT_PORT : integer
 

Default username for email account

EMAIL_DEFAULT_USERNAME : string
 

Email address which receives default error messages DStruct can send error messages using PHP's register_shutdown_function() to notify you when an error occurs (not compile errors etc).

ERROR_DEFAULT_RECIPIENT : mixed

Enter the address you wish to receive these, or leave it blank to disable this feature.

 

Subject line for default error messages

ERROR_EMAIL_SUBJECT_LINE : string
 

Prepend the Application Name to the subject line of default error messages

ERROR_PREPEND_APP_NAME : boolean
 

Default 'long' date format Typically used to display dates to users As used by PHP's date() function

FORMAT_DISPLAY_DATE : string
 

Default 'long' timestamp format Typically used to display timestamps to users As used by PHP's date() function

FORMAT_DISPLAY_TS : string
 

Default 'short' date format Typically used to display datess to users As used by PHP's date() function

FORMAT_FORM_DATE : string
 

Default 'short' timestamp format Typicall used in form fields etc As used by PHP's date() function

FORMAT_FORM_TS : string
 

Define available Memcache servers Comma separated list of available servers to be used by the framework cache.

MEMCACHE_SERVERS : string

Application settings and Constants.

Singleton object. Set application constants at design and at runtime.

package dstruct_common

 Methods

Used to count hits on prepared statements in {@link Base}

countStatementHit() 
Static

Retrieve a value by its key

get(string $key) : \mixed:

Parameters

$key

string

Returns

\mixed:

Get instance of this Singleton class

getInstance() : object
Static

Returns

objectPrefs

Get hits on prepared statements.

getStatementHitCount() : integer
Static

Returns

integer

Set a key / value pair

set(string $key, mixed $val) 

Parameters

$key

string

$val

mixed

Class constructor Only scalar values can be defined as class constants.

__construct() 

Define any global compile time values stored in arrays etc here.

 Properties

 

Instance of Prefs class

$instance : object
 

Properties held by the class

$props : array
 

Counts prepared statement hits

$statementhits : integer

 Constants

 

Application Name The application name is used by caches to identify the application to which the cache data belongs.

APP_NAME : string

Caches are often shared across applications (for instance running on the same server) so use a unique application name to prevent corruption etc. Alternatively, an application running on multiple servers may want this string the same so that data is shared. It is still important to set this constant if you do not use a cache within your script as the framework caches information behind the scenes to improve speed.

 

Default Cache Set the default cache system to be used by the framework.

CACHE_DEFAULT : string

Can be: APC, DStructMemCache, Database, another cache object which impliments DStructCacheInterface or leave blank for none. Not using APC (or using none) will not turn off the APC op-code cache.

 

Set identifier used by {@link ClickController}.

CLICK_CONTROL_IDENTIFIER_IS_SESSION : boolean

Session identifier is preferred, but can use the user's IP if set to false. Unless there is some very good reason not to use the session then leave as true

see \ClickController
 

Default currency symbol

CURRENCY_SYMBOL : string
 

DB Connection for {@link DatabaseCache} If you are using a DatabaseCache then you will need to define the name of the connection created in {@link Prefs::DB_CONNECTIONS} here.

DB_CACHE : string
 

<var>DB_CONNECTIONS</var> defines connection strings to databases.

DB_CONNECTIONS : string

These are fed to the system when inc_common.php is loaded but they are LAZY connected. The framework uses PDO. Options:- connectionname,dbtype,host,username,password,schema,port,defaultcharset

 

Development (DEV) or production mode

DEV : boolean

Effects things such as error reporting. Can be used in your scripts to control behaviour - for example missing out some code for a package not available on your local system, controlling logging etc.

 

Default email server If a default email server is available, the DNS name or IP can be entered here.

EMAIL_DEFAULT_HOST : string

All email settings can be overridden or set at runtime and therefore settings here are all optional.

see \SMTPEmail
 

Default email account password

EMAIL_DEFAULT_PASSWORD : string
 

Default email server port

EMAIL_DEFAULT_PORT : integer
 

Default username for email account

EMAIL_DEFAULT_USERNAME : string
 

Email address which receives default error messages DStruct can send error messages using PHP's register_shutdown_function() to notify you when an error occurs (not compile errors etc).

ERROR_DEFAULT_RECIPIENT : mixed

Enter the address you wish to receive these, or leave it blank to disable this feature.

 

Subject line for default error messages

ERROR_EMAIL_SUBJECT_LINE : string
 

Prepend the Application Name to the subject line of default error messages

ERROR_PREPEND_APP_NAME : boolean
 

Default 'long' date format Typically used to display dates to users As used by PHP's date() function

FORMAT_DISPLAY_DATE : string
 

Default 'long' timestamp format Typically used to display timestamps to users As used by PHP's date() function

FORMAT_DISPLAY_TS : string
 

Default 'short' date format Typically used to display datess to users As used by PHP's date() function

FORMAT_FORM_DATE : string
 

Default 'short' timestamp format Typicall used in form fields etc As used by PHP's date() function

FORMAT_FORM_TS : string
 

Define available Memcache servers Comma separated list of available servers to be used by the framework cache.

MEMCACHE_SERVERS : string