3 require_once("AOOSException.php");
8 * The core class of AOOS
10 * @author Sebastian Skejø
15 private $_exceptions = array();
16 private $_loadedModules = array();
17 private $_settings = array();
18 private $_transStrings = array();
20 public function __construct()
22 require_once("config.php");
23 $this->_settings
= $settings;
25 $l = $this->getSetting("lang");
26 require_once("lang.php");
27 if (!in_array($l, array_keys($lang)))
29 throw new AOOSException($this, "Language not found in lang.php. You will not be able to translate strings","",true, 1);
33 $this->_transStrings
= $lang[$l];
39 * @param AOOSException $e The exception
41 public function setException($e)
43 $this->_exceptions
[$e->getName()] = $e;
44 if ($e->getEcode() == 0)
52 public function printExceptions()
54 $str = "<div class=\"Exceptions\">";
55 foreach ($this->_exceptions
as $e)
63 public function getSetting($name)
65 if (!in_array($name, array_keys($this->_settings
)))
67 throw new AOOSException($this, "Settingkey not found", "", true, 2);
70 return $this->_settings
[$name];
73 public function getTranslatedString($string)
75 if (!in_array($string, array_keys($this->_transStrings
)))
77 throw new AOOSException($this, "Translated string not found", "String name: ".$string, true, 2);
80 return $this->_transStrings
[$string];