Added Canvas 1.1.0, originally not under SCM so no historical development records...
[canvas.git] / library / Canvas.php
blob2454fbca6e6b96d65ffbff9fde4d007cf82a92ee
1 <?php
2 // @title Canvas core class
3 // @author Matt Todd <matt@matttoddphoto.com>
4 // @created 2006-03-29
5 // @desc The core class every major Canvas component inherets from
6 // @requires stdexception.php (StdException class)
7 // @note Yes, it came a little late in the game.
9 include_once('stdexception.php');
11 // classes
12 class Canvas {
13 protected $config = array();
15 // loads the configuration for the current component if no other config data is requested
16 protected function load_config($config_section = null) {
17 $config = new Config2(); // load the configuration
19 // determine section, if any
20 if($config_section == true && !empty($this->config_section)) $config_section = $this->config_section; // if there's a special section name already set, use that
21 if($config_section == true) $config_section = strtolower(get_class()); // if nothing's been set, use the class name
23 // set config data
24 $this->config = ($config_section == null) ? $config->config : $config->$config_section;