Phpfox_Setting

Description

Global Site Settings

Class is used to load and retrieve global settings, which are stored in the database table "setting". Admins can easily modify these settings direct from the AdminCP. The most common interaction with this class is to get a setting value and to do this we use our core static class.

Example:

  1.  Phpfox::getParam('foo.bar');

  • author: Raymond Benc
  • version: $Id: setting.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/setting/setting.class.php (line 26)


	
			
Variable Summary
 array $_aDefaults
 array $_aParams
Method Summary
 Phpfox_Setting __construct ()
 nixed getParam (mixed $mVar, [string $sDef = ''])
 bool isParam (string $mVar)
 void set ()
 void setParam (array $mParam, [string $mValue = null])
Variables
array $_aDefaults = array(
'core.session_prefix' => 'phpfox',
'core.title_delim' => '»',
'core.site_title' => 'phpFox',
'core.branding' => false,
'core.default_lang_id' => 'en',
'core.default_style_name' => 'konsort',
'core.default_theme_name' => 'default',
'language.lang_pack_helper' => false,
'core.cookie_path' => '/',
'core.cookie_domain' => '',
'core.use_gzip' => true,
'core.url_rewrite' => '2',
'core.is_installed' => false,
'user.profile_use_id' => false,
'user.disable_username_on_sign_up' => false,
'core.site_copyright' => '',
'db' => array(
'prefix' => 'phpfox_',
'host' => 'localhost',
'user' => '',
'pass' => '',
'name' => '',
'driver' => 'mysql',
'slave' => false
),'core.cache_skip'=>false,'balancer'=>array('enabled'=>false),'user.min_length_for_username'=>'5','user.max_length_for_username'=>'25','core.default_time_zone_offset'=>'0','core.identify_dst'=>'1','core.global_site_title'=>'phpFox')
(line 42)

Default settings we load and their values. We only use this when installing the script the first time since the database hasn't been installed yet.

  • access: private
array $_aParams = array() (line 33)

List of all the settings.

  • access: private
Methods
Constructor __construct (line 85)

Class constructor. We run checks here to make sure the server setting file is in place and this is where we can judge if the script has been installed or not.

  • access: public
Phpfox_Setting __construct ()
getParam (line 331)

Get a setting and its value.

  • return: Returns the value of the setting, which can be a STRING, ARRAY, BOOL or INT.
  • access: public
nixed getParam (mixed $mVar, [string $sDef = ''])
  • mixed $mVar: STRING name of the setting or ARRAY name of the setting.
  • string $sDef: Default value in case the setting cannot be found.
isParam (line 361)

Checks to see if a setting exists or not.

  • return: TRUE it exists, FALSE if it does not.
  • access: public
bool isParam (string $mVar)
  • string $mVar: Name of the setting.
set (line 175)

Build the setting cache by getting all the settings from the database and then caching it. This way we only load it from the database the one time.

  • access: public
void set ()
setParam (line 161)

Creates a new setting.

  • access: public
void setParam (array $mParam, [string $mValue = null])
  • array $mParam: ARRAY of settings and values.
  • string $mValue: Value of setting if the 1st argument is a string.

Documentation generated on Tue, 28 Sep 2010 10:36:44 +0200 by phpDocumentor 1.4.0a2