$set = new PutTextOB("lol");
$ob1= new onePutText($set);
$ob2 = new twoPutText ($set)
$set->setText();
$set = new PutTextOB("lol");
$set->addObserver(new onePutText());
$set->addObserver(new twoPutText());
$set->setText();
function get($file, $key = null, $default = null)
{
static $files = [];
if (!isset($files[$file])) {
if (is_file($path = INCLUDE_DIR . '/Settings/' . $file . '.php')) {
$files[$file] = include_once $path;
} else {
throw new \Exception('Error while connecting the settings file: ' . $file);
}
}
if ($key != null) {
if (isset($files[$file][$key])) {
return $files[$file][$key];
} else {
return $default;
}
} else {
return $files[$file];
}
}