Wrapper for Midgard-related functionality, provides compatibility between versions

package midcom

 Methods

_get ($key, $subkey)

Static

Parameters

$key

$subkey

get (string $key, string $subkey)

Getter for various environment-related variables.
Static

this serves mostly as a drop-in replacement for $_MIDGARD superglobal access

Parameters

$key

stringThe key to look up

$subkey

stringThe subkey, if any

Returns

mixedThe found value or null

get_error ()

Get Midgard error code
Static

Returns

intMidgard error code

get_error_string ()

Get Midgard error message
Static

Returns

stringMidgard error message

get_schema_types ()

Lists all available MgdSchema types
Static

Returns

arrayA list of class names

get_unique_host_name ()

Static

get_url ($key)

Get various pieces of information extracted from the URL
Static
todo this should mabe check the key for validity

Parameters

$key

Returns

mixedThe data for the requested key or false if it doesn't exist

get_user ()

Get current Midgard user
Static

Returns

intThe current user ID

is_admin ()

Check if the current user is admin
Static

Returns

booleanTrue or false

is_connected ()

Check whether Midgard database connection exists
Static

Returns

boolean

is_user ($person)

Static

Parameters

$person

prepare_password ($password, $username)

Static

Parameters

$password

$username

set_error (int $errorcode)

Set Midgard error code
Static

Parameters

$errorcode

intMidgard error code

set_loglevel (string $loglevel)

Set Midgard log level
Static

Parameters

$loglevel

stringMidgard log level

_crypt_password ($password, $username)

Static

Parameters

$password

$username

_parse_url (string $uri, string $self, string $prefix)

Helper function that enables themes to have subdirectories (which have a similar effect to mgd1 pages)
Static

Parameters

$uri

stringThe request path

$self

stringThe instance's root URL

$prefix

stringThe root URL's prefix, if any (corresponds to mgd1 host)

 Properties

 

array $_data

Private cache for connection information
 

mixed $_defaults