Config Class Reference
[Core]
Contains Configuration parameters. More...
Static Public Member Functions |
|
static | create_fingerprint () |
Creates a hash from config values. |
|
static | get_url ($feature) |
Returns given url. |
|
static | get_value ($feature, $require=false, $default=false) |
Returns given value. |
|
static | has_feature ($feature) |
Returns TRUE, if given feature is enabled.
|
|
static | set_feature ($feature, $enabled) |
Enable or disable a feature. |
|
static | set_feature_from_constant ($feature, $constant, $default) |
Set a feature by reading given constant.
|
|
static | set_value ($feature, $value) |
Set a value. |
|
static | set_value_from_constant ($feature, $constant, $default) |
Set a value by reading given constant.
|
|
Public Attributes |
|
const | CACHEHEADER_CLASS_CACHED = 'CACHEHEADER_CLASS_CACHED' |
CacheHeaderManager policy for cached stuff.
|
|
const | CACHEHEADER_CLASS_UNCACHED = 'CACHEHEADER_CLASS_UNCACHED' |
CacheHeaderManager policy for uncached
stuff. |
|
const | DB_SLOW_QUERY_THRESHOLD = 'DB_SLOW_QUERY_THRESHOLD' |
const | DEBUG_QUERIES = 'DEBUG_QUERIES' |
const | DEFAULT_SCHEME = 'DEFAULT_SCHEME' |
Default scheme (used unless specified in
routes). |
|
const | DEFAULT_TEMPLATE_ENGINE = 'DEFAULT_TEMPLATE_ENGINE' |
Template engine. |
|
const | DISABLE_CACHE = 'DISABLE_CACHE' |
const | ENABLE_HTTPS = 'ENABLE_HTTPS' |
const | FORCE_FULL_DOMAINNAME = 'FORCE_FULL_DOMAINNAME' |
const | FORMVALIDATION_EXPIRATION_TIME = 'FORMVALIDATION_EXPIRATION_TIME' |
const | FORMVALIDATION_FIELD_NAME = 'FORMVALIDATION_FIELD_NAME' |
const | FORMVALIDATION_HANDLER_NAME = 'FORMVALIDATION_HANDLER_NAME' |
const | GZIP_SUPPORT = 'GZIP' |
const | ITEMS_PER_PAGE = 'ITEMS_PER_PAGE' |
const | LOG_FAILED_QUERIES = 'LOG_FAILED_QUERIES' |
const | LOG_HTML_ERROR_STATUS = 'LOG_HTML_ERROR_STATUS' |
const | LOG_HTTPREQUESTS = 'LOG_HTTPREQUESTS' |
const | LOG_QUERIES = 'LOG_QUERIES' |
LOGGING. |
|
const | LOG_SLOW_QUERIES = 'LOG_SLOW_QUERIES' |
const | LOG_TRANSLATIONS = 'LOG_TRANSLATIONS' |
const | MAIL_ADMIN = 'MAIL_ADMIN' |
Address to receive system notifications.
|
|
const | MAIL_SENDER = 'MAIL_SENDER' |
Default FROM address. |
|
const | MAIL_SUBJECT = 'MAIL_SUBJECT' |
Added to each email subject line. |
|
const | MAIL_SUPPORT = 'MAIL_SUPPORT' |
Address to receive user mails (e.g. |
|
const | MAILER_SMTP_HOST = 'MAILER_SMTP_HOST' |
SMTP Host. |
|
const | MAILER_SMTP_PASSWORD = 'MAILER_SMTP_PASSWORD' |
SMTP Password. |
|
const | MAILER_SMTP_USER = 'MAILER_SMTP_USER' |
SMTP User. |
|
const | MAILER_TYPE = 'MAILER_TYPE' |
Mailer type. |
|
const | OUT_DIR = 'OUT_DIR' |
Files output directory. |
|
const | PAGE_TEMPLATE = 'PAGE_TEMPLATE' |
const | PAGER_CALCULATOR = 'PAGER_CALCULATOR' |
const | PAGER_NUM_LINKS = 'PAGER_NUM_LINKS' |
const | PRINT_DURATION = 'PRINT_DURATION' |
const | QUERY_PARAM_PATH_INVOKED = 'QUERY_PARAM_PATH_INVOKED' |
The query parameter that contains the path
orignally invoked. |
|
const | SESSION_HANDLER = 'SESSION_HANDLER' |
Name of Session
Handling Class (class must be included manually). |
|
const | START_SESSION = 'START_SESSION' |
const | TEMP_DIR = 'TEMP_DIR' |
Temporary directory. |
|
const | TESTMODE = 'TESTMODE' |
const | THIRDPARTY_DIR = '3RDPARTY_DIR' |
Include 3rd party dir. |
|
const | THROW_ON_DB_ERROR = 'THROW_ON_DB_ERROR' |
const | THROW_ON_WARNING = 'THROW_ON_WARNING' |
const | TITLE = 'TITLE' |
const | URL_ABSPATH = 'URL_ABSPATH' |
const | URL_BASEDIR = 'URL_BASEDIR' |
const | URL_BASEURL = 'URL_BASEURL' |
const | URL_BASEURL_SAFE = 'URL_BASEURL_SAFE' |
const | URL_DEFAULT_PAGE = 'URL_DEFAULT_PAGE' |
The default URL for users not logged in.
|
|
const | URL_DOMAIN = 'URL_DOMAIN' |
Some URLs. |
|
const | URL_IMAGES = 'URL_IMAGES' |
const | URL_IMAGES_DIR = 'URL_IMAGES_DIR' |
URL of Images. |
|
const | URL_SERVER = 'URL_SERVER' |
const | URL_SERVER_SAFE = 'URL_SERVER_SAFE' |
const | VALIDATE_URL = 'VALIDATE_URL' |
True to validate url on start. |
|
const | VERSION = 'VERSION' |
Version of Gyro. |
|
const | VERSION_MAX = 'VERSION_MAX' |
Max Gyro version the application supports.
|
Detailed Description
Contains Configuration parameters.
Definition at line 8 of file config.cls.php.
Member Function Documentation
static Config::create_fingerprint | ( | ) | [static] |
Creates a hash from config values.
- Returns:
- string 40 character long hexstring (sha1)
Definition at line 247 of file config.cls.php.
static Config::get_url | ( | $ | feature | ) | [static] |
Returns given url.
Urls are values with placeholders, namely
- domain%: Replaced with domain
- basedir%: Replaced with base dir
- Parameters:
-
string $feature
- Returns:
- string
Definition at line 234 of file config.cls.php.
00234 { 00235 $url = self::get_value($feature, true); 00236 $url = str_replace('%scheme%', self::get_value(self::DEFAULT_SCHEME), $url); 00237 $url = str_replace('%domain%', self::get_value(self::URL_DOMAIN), $url); 00238 $url = str_replace('%basedir%', self::get_value(self::URL_BASEDIR), $url); 00239 return $url; 00240 }
Returns given value.
- Parameters:
-
string $feature bool $require If set, an exception is raised if value not set
- Returns:
- mixed
Definition at line 193 of file config.cls.php.
00193 { 00194 if (isset(self::$data[$feature])) { 00195 return self::$data[$feature]; 00196 } 00197 else if ($require) { 00198 throw new Exception(tr('Required Config-Value %feature not set', 'core', array('%feature' => $feature))); 00199 } 00200 return $default; 00201 }
static Config::has_feature | ( | $ | feature | ) | [static] |
Returns TRUE, if given feature is enabled.
- Parameters:
-
string $feature
- Returns:
- bool
Definition at line 156 of file config.cls.php.
static Config::set_feature | ( | $ | feature, | |
$ | enabled | |||
) | [static] |
Enable or disable a feature.
- Parameters:
-
string $feature bool $enabled
Definition at line 166 of file config.cls.php.
static Config::set_feature_from_constant | ( | $ | feature, | |
$ | constant, | |||
$ | default | |||
) | [static] |
Set a feature by reading given constant.
- Parameters:
-
string $feature string $constant bool $default
Definition at line 182 of file config.cls.php.
00182 { 00183 self::set_feature($feature, defined($constant) ? constant($constant) : $default); 00184 }
static Config::set_value | ( | $ | feature, | |
$ | value | |||
) | [static] |
Set a value.
- Parameters:
-
string $feature mixed $value
Definition at line 209 of file config.cls.php.
static Config::set_value_from_constant | ( | $ | feature, | |
$ | constant, | |||
$ | default | |||
) | [static] |
Set a value by reading given constant.
- Parameters:
-
string $feature string $constant mixed $default
Definition at line 220 of file config.cls.php.
00220 { 00221 self::set_value($feature, defined($constant) ? constant($constant) : $default); 00222 }
Member Data Documentation
CacheHeaderManager policy for cached stuff.
Class name without CacheHeaderManager, e.g. FullCache for FullCacheCacheHeaderManager
Definition at line 139 of file config.cls.php.
CacheHeaderManager policy for uncached stuff.
Class name without CacheHeaderManager, e.g. NoCache for NoCacheCacheHeaderManager
Definition at line 141 of file config.cls.php.
Definition at line 46 of file config.cls.php.
const Config::DEBUG_QUERIES = 'DEBUG_QUERIES' |
Definition at line 24 of file config.cls.php.
const Config::DEFAULT_SCHEME = 'DEFAULT_SCHEME' |
Default scheme (used unless specified in routes).
Definition at line 106 of file config.cls.php.
Template engine.
Definition at line 37 of file config.cls.php.
const Config::DISABLE_CACHE = 'DISABLE_CACHE' |
Definition at line 26 of file config.cls.php.
const Config::ENABLE_HTTPS = 'ENABLE_HTTPS' |
Definition at line 27 of file config.cls.php.
Definition at line 29 of file config.cls.php.
Definition at line 133 of file config.cls.php.
Definition at line 131 of file config.cls.php.
Definition at line 132 of file config.cls.php.
const Config::GZIP_SUPPORT = 'GZIP' |
Definition at line 39 of file config.cls.php.
const Config::ITEMS_PER_PAGE = 'ITEMS_PER_PAGE' |
Definition at line 19 of file config.cls.php.
const Config::LOG_FAILED_QUERIES = 'LOG_FAILED_QUERIES' |
Definition at line 44 of file config.cls.php.
Definition at line 48 of file config.cls.php.
const Config::LOG_HTTPREQUESTS = 'LOG_HTTPREQUESTS' |
Definition at line 49 of file config.cls.php.
const Config::LOG_QUERIES = 'LOG_QUERIES' |
LOGGING.
Definition at line 43 of file config.cls.php.
const Config::LOG_SLOW_QUERIES = 'LOG_SLOW_QUERIES' |
Definition at line 45 of file config.cls.php.
const Config::LOG_TRANSLATIONS = 'LOG_TRANSLATIONS' |
Definition at line 47 of file config.cls.php.
const Config::MAIL_ADMIN = 'MAIL_ADMIN' |
Address to receive system notifications.
Definition at line 61 of file config.cls.php.
const Config::MAIL_SENDER = 'MAIL_SENDER' |
Default FROM address.
Definition at line 57 of file config.cls.php.
const Config::MAIL_SUBJECT = 'MAIL_SUBJECT' |
Added to each email subject line.
Definition at line 53 of file config.cls.php.
const Config::MAIL_SUPPORT = 'MAIL_SUPPORT' |
const Config::MAILER_SMTP_HOST = 'MAILER_SMTP_HOST' |
SMTP Host.
MAILER_TYPE must be set to 'smtp' for this setting to take effect
Definition at line 74 of file config.cls.php.
SMTP Password.
MAILER_TYPE must be set to 'smtp' for this setting to take effect
Definition at line 82 of file config.cls.php.
const Config::MAILER_SMTP_USER = 'MAILER_SMTP_USER' |
SMTP User.
MAILER_TYPE must be set to 'smtp' for this setting to take effect
Definition at line 78 of file config.cls.php.
const Config::MAILER_TYPE = 'MAILER_TYPE' |
Mailer type.
Switch Mailer type to 'smtp' to use SMTP. All other values will use PHP's mail() function
Definition at line 70 of file config.cls.php.
const Config::OUT_DIR = 'OUT_DIR' |
Files output directory.
Definition at line 120 of file config.cls.php.
const Config::PAGE_TEMPLATE = 'PAGE_TEMPLATE' |
Definition at line 38 of file config.cls.php.
const Config::PAGER_CALCULATOR = 'PAGER_CALCULATOR' |
Definition at line 136 of file config.cls.php.
const Config::PAGER_NUM_LINKS = 'PAGER_NUM_LINKS' |
Definition at line 135 of file config.cls.php.
const Config::PRINT_DURATION = 'PRINT_DURATION' |
Definition at line 25 of file config.cls.php.
The query parameter that contains the path orignally invoked.
Definition at line 129 of file config.cls.php.
const Config::SESSION_HANDLER = 'SESSION_HANDLER' |
Name of Session Handling Class (class must be included manually).
Definition at line 33 of file config.cls.php.
const Config::START_SESSION = 'START_SESSION' |
Definition at line 28 of file config.cls.php.
const Config::TEMP_DIR = 'TEMP_DIR' |
Temporary directory.
Definition at line 116 of file config.cls.php.
const Config::TESTMODE = 'TESTMODE' |
Definition at line 21 of file config.cls.php.
const Config::THIRDPARTY_DIR = '3RDPARTY_DIR' |
Include 3rd party dir.
Definition at line 124 of file config.cls.php.
const Config::THROW_ON_DB_ERROR = 'THROW_ON_DB_ERROR' |
Definition at line 22 of file config.cls.php.
const Config::THROW_ON_WARNING = 'THROW_ON_WARNING' |
Definition at line 23 of file config.cls.php.
const Config::TITLE = 'TITLE' |
Definition at line 18 of file config.cls.php.
const Config::URL_ABSPATH = 'URL_ABSPATH' |
Definition at line 92 of file config.cls.php.
const Config::URL_BASEDIR = 'URL_BASEDIR' |
Definition at line 87 of file config.cls.php.
const Config::URL_BASEURL = 'URL_BASEURL' |
Definition at line 90 of file config.cls.php.
const Config::URL_BASEURL_SAFE = 'URL_BASEURL_SAFE' |
Definition at line 91 of file config.cls.php.
const Config::URL_DEFAULT_PAGE = 'URL_DEFAULT_PAGE' |
The default URL for users not logged in.
Definition at line 101 of file config.cls.php.
const Config::URL_DOMAIN = 'URL_DOMAIN' |
Some URLs.
Definition at line 86 of file config.cls.php.
const Config::URL_IMAGES = 'URL_IMAGES' |
Definition at line 97 of file config.cls.php.
const Config::URL_IMAGES_DIR = 'URL_IMAGES_DIR' |
URL of Images.
Definition at line 96 of file config.cls.php.
const Config::URL_SERVER = 'URL_SERVER' |
Definition at line 88 of file config.cls.php.
const Config::URL_SERVER_SAFE = 'URL_SERVER_SAFE' |
Definition at line 89 of file config.cls.php.
const Config::VALIDATE_URL = 'VALIDATE_URL' |
True to validate url on start.
Definition at line 111 of file config.cls.php.
const Config::VERSION = 'VERSION' |
Version of Gyro.
Definition at line 16 of file config.cls.php.
const Config::VERSION_MAX = 'VERSION_MAX' |
Max Gyro version the application supports.
Definition at line 12 of file config.cls.php.
The documentation for this class was generated from the following file:
- gyro/core/config.cls.php