.

Config Class Reference
[Core]

Contains Configuration parameters. More...

List of all members.

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.

Author:
Gerd Riesselmann

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.

00247                                                     {
00248                 $ret = '';
00249                 foreach(self::$data as $key => $value) {
00250                         $ret .= $value;
00251                 }
00252                 return sha1($ret);
00253         }
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         }       
static Config::get_value ( feature,
require = false,
default = false  
) [static]

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.

00156                                                      {
00157                 return isset(self::$data[$feature]);    
00158         }
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.

00166                                                                {
00167                 if ($enabled) {
00168                         self::$data[$feature] = true;
00169                 }
00170                 else {
00171                         unset(self::$data[$feature]);
00172                 }
00173         }
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.

00209                                                            {
00210                 self::$data[$feature] = $value;
00211         }
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 24 of file config.cls.php.

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.

Definition at line 26 of file config.cls.php.

Definition at line 27 of file config.cls.php.

const Config::GZIP_SUPPORT = 'GZIP'

Definition at line 39 of file config.cls.php.

Definition at line 19 of file config.cls.php.

Definition at line 44 of file config.cls.php.

Definition at line 49 of file config.cls.php.

LOGGING.

Definition at line 43 of file config.cls.php.

Definition at line 45 of file config.cls.php.

Definition at line 47 of file config.cls.php.

Address to receive system notifications.

Definition at line 61 of file config.cls.php.

Default FROM address.

Definition at line 57 of file config.cls.php.

Added to each email subject line.

Definition at line 53 of file config.cls.php.

Address to receive user mails (e.g.

contact)

Definition at line 65 of file config.cls.php.

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.

SMTP User.

MAILER_TYPE must be set to 'smtp' for this setting to take effect

Definition at line 78 of file config.cls.php.

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.

Files output directory.

Definition at line 120 of file config.cls.php.

Definition at line 38 of file config.cls.php.

Definition at line 136 of file config.cls.php.

Definition at line 135 of file config.cls.php.

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.

Name of Session Handling Class (class must be included manually).

Definition at line 33 of file config.cls.php.

Definition at line 28 of file config.cls.php.

Temporary directory.

Definition at line 116 of file config.cls.php.

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.

Definition at line 22 of file config.cls.php.

Definition at line 23 of file config.cls.php.

const Config::TITLE = 'TITLE'

Definition at line 18 of file config.cls.php.

Definition at line 92 of file config.cls.php.

Definition at line 87 of file config.cls.php.

Definition at line 90 of file config.cls.php.

Definition at line 91 of file config.cls.php.

The default URL for users not logged in.

Definition at line 101 of file config.cls.php.

Some URLs.

Definition at line 86 of file config.cls.php.

Definition at line 97 of file config.cls.php.

URL of Images.

Definition at line 96 of file config.cls.php.

Definition at line 88 of file config.cls.php.

Definition at line 89 of file config.cls.php.

True to validate url on start.

Definition at line 111 of file config.cls.php.

Version of Gyro.

Definition at line 16 of file config.cls.php.

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: