Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
 public function getAttachmentUrl($attachmentFilename)
 {
     $core = Modela_Core::getInstance();
     $url = $core->getBaseUrl(true);
     $url .= '/' . $this->_id . '/' . $attachmentFilename;
     return $url;
 }
Exemplo n.º 4
0
 public static function reset()
 {
     self::$_instance = null;
 }