/** * 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; }
/** * Method to create the Phalcon MVC Micro Object * @return object Phalcon MVC Micro Object */ private function createPhalcon() { $di = new \Phalcon\DI\FactoryDefault(); if (AppConfig::get('pp', 'usePhalconDatabaseObject') == 'on') { //Set up the database service $di->set('db', function () { return new \Phalcon\Db\Adapter\Pdo\Mysql(AppConfig::getSection('database')); }); } return new \Phalcon\Mvc\Micro($di); }