/** * Constructor * * @param string $configFile Path to .ini config file * @param string $writableFolder Path to folder with write permissions */ public function __construct($configFile, $writableFolder) { AppConfig::load($configFile); if (!is_writable($writableFolder)) { throw new \Exception('Folder is not writable'); } date_default_timezone_set(AppConfig::get('datetime', 'timezone', 'GMT')); $this->slim = $this->createSlim(); $this->template = FactoryLoader::load('Template', FALSE, $writableFolder); $this->init(); }
/** * Constructor * */ public function __construct($writableFolder) { // Create Smarty Object $this->sm = new Smarty(); // Setup Folders in Writable Folder $this->sm->setCompileDir($writableFolder . AppConfig::get('smarty', 'compileDir')); $this->sm->setConfigDir($writableFolder . AppConfig::get('smarty', 'configDir')); $this->sm->setCacheDir($writableFolder . AppConfig::get('smarty', 'cacheDir')); // This prevents undefined index errors if the variable is not defined $this->sm->error_reporting = E_ALL & ~E_NOTICE; }