Public Member Functions | Static Public Member Functions | Data Fields
Config Class Reference

Stores all configuration options of an application. More...

Public Member Functions

 getRoute ($url)
 
 getDbSettings ()
 
 getBaseUrl ()
 
 getModelFor ($model_name)
 
 getErrorSettings ()
 
 pageNotFound ()
 
 getUrls ()
 
 get ($setting_name)
 
 autoloadSettings ($index=null)
 

Static Public Member Functions

static getInstance ()
 
static db ($setting_name, $setting_value)
 
static baseurl ($url)
 
static url ($url_key, $url_val)
 
static timezone ($timezone)
 
static autoload ($setting_name, $setting_value)
 
static models ($current_model, $new_model)
 
static disablemodels ($models=array())
 
static errors ($setting_name, $setting_value)
 
static phpini ($setting_name, $setting_value)
 
static addroute ($url, $newroute)
 
static set ($setting_name, $setting_value)
 

Data Fields

 $db = array()
 
 $base_path = ''
 
 $url = array()
 
 $autoload = array()
 
 $models = array()
 
 $routes = array()
 
 $errors = array()
 
 $phpini = array()
 
 $custom = array()
 
 $instance = null
 
 $new_route = array()
 
 $new_route_size = 0
 

Detailed Description

Stores all configuration options of an application.

Version
1.1
Author
DinuSV

Gets accessed through configuration files found within the "application" directory of each web-app.

Member Function Documentation

static getInstance ( )
static

Singleton class with only one instance returned

Returns
Config : instance of this class, or null otherwise
Exceptions
Exception
static db (   $setting_name,
  $setting_value 
)
static

Database settings

Parameters
string$setting_name
string$setting_value
static baseurl (   $url)
static

Base url

Parameters
string$url
static url (   $url_key,
  $url_val 
)
static

Urls to use

Parameters
string$url_key
string$url_val
static timezone (   $timezone)
static

Set the default timezone

Parameters
string$timezone
static autoload (   $setting_name,
  $setting_value 
)
static

Autoload settings

Parameters
string$setting_name
array$setting_value
static models (   $current_model,
  $new_model 
)
static

Model settings

Parameters
string$current_model
string$new_model
static disablemodels (   $models = array())
static

Disable models ( shortcut for the models function )

Parameters
array$models
static errors (   $setting_name,
  $setting_value 
)
static

Error settings

Parameters
string$setting_name
string$setting_value
static phpini (   $setting_name,
  $setting_value 
)
static

Php ini settings

Parameters
string$setting_name
string$setting_value
static addroute (   $url,
  $newroute 
)
static

Add routes

Parameters
string$url: the url to match
string$newroute
getRoute (   $url)

Main route method to get the new route.

Parameters
string$url: the url to check routing for
Exceptions
IllegalArgumentTypeException
Returns
string : the new url
static set (   $setting_name,
  $setting_value 
)
static

Set custom values

Parameters
string$setting_name
mixed$setting_value
getDbSettings ( )

Db settings

Returns
array
getBaseUrl ( )

Base url

Returns
string
getModelFor (   $model_name)

Get the model for the controller

Parameters
string$model_name
Returns
string
getErrorSettings ( )

Error settings

Returns
array
pageNotFound ( )

Get settings for page not found

Returns
array
getUrls ( )

Get custom urls

Returns
array
get (   $setting_name)

Get custom settings

Returns
mixed
Exceptions
IndexOutOfBoundsException
autoloadSettings (   $index = null)

Autoload settings

Parameters
string$index: get a specific setting
Exceptions
IndexOutOfBoundsException
Returns
array

Field Documentation

$db = array()

array : Database options

$base_path = ''

string : Url of the website

$url = array()

array : Custom urls

$autoload = array()

array : Autoload settings : defaultcontroller, libraries, viewfiles

$models = array()

array : Model-controller mapping

$routes = array()

array : Store routes from the config

$errors = array()

array : Settings on displaying errors : stage, output_source_lines, log_exceptions, log_exceptions_file, page_not_found, page_not_found_param

$phpini = array()

array : Settings to overwrite php ini : overwrite, log_errors, log_file

$custom = array()

array : Stores custom settings

$instance = null

Config : Singleton instance

$new_route = array()

Store routing

$new_route_size = 0

int : Size of the new_rout field