public function init() { require_once 'Modela/Loader.php'; $loader = Modela_Loader::getInstance(); $loader->loadModels($this->_options['modelsPath']); $modela = Modela_Core::getInstance(); $modela->setHostname($this->_options["hostname"]); $modela->setDatabase($this->_options["database"]); if ($this->_options['useAuthentication']) { $modela->setUsername($this->_options['username']); $modela->setPassword($this->_options['password']); } return $modela; }
public function run() { if ($this->_options['database']) { Modela_Core::getInstance()->setDatabase($this->_options['database']); } switch ($this->_action) { case "loadviews": if ($this->_options['viewspath']) { $viewsPath = $this->_options['viewspath']; } else { $viewsPath = realpath(getcwd()); } Modela_View::loadViews($viewsPath); break; } }
public function getAttachmentUrl($attachmentFilename) { $core = Modela_Core::getInstance(); $url = $core->getBaseUrl(true); $url .= '/' . $this->_id . '/' . $attachmentFilename; return $url; }
public static function reset() { self::$_instance = null; }