예제 #1
0
 public function __construct()
 {
     $this->view = new Model_View();
     $this->front = Model_Front::getInstance();
     $this->config = $this->view->config = Pixelpost_Config::getInstance();
     // for use in the controllers
     $this->view->plugins = Pixelpost_Plugin::getInstance();
     /**
      * Default Layout
      * If empty, no layout will be used.
      */
     $this->layout = 'layout.phtml';
     // $this->view->setTemplateDir(THMPATH . '/' . $this->config->theme);
     $this->view->setCacheDir(CSHPATH);
     // $this->view->setCaching(true);
     // if ( (int)$this->front->getAction() === 0 && $this->front->getAction() != 'index' && !method_exists($this,$this->front->getAction())) {
     Pixelpost_Plugin::executeAction('hook_base_construct', $this, $this->front->getController(), $this->front->getAction());
     // }
 }
예제 #2
0
        Pixelpost_DB::connect('sqlite:' . $config->database['sqlite']);
        break;
    case 'mysql':
    default:
        Pixelpost_DB::init('mysql');
        Pixelpost_DB::connect($config->database['username'], $config->database['password'], $config->database['database'], $config->database['host']);
        break;
}
Pixelpost_DB::set_table_prefix($config->database['prefix']);
if (!Pixelpost_DB::$connected) {
    throw new Pixelpost_Exception("Unable to connect to database", E_ERROR);
}
/**
 * Initialize Page
 */
$front = Model_Front::getInstance();
/**
 * Initialize Timezone
 */
if (!empty($config->timezone)) {
    date_default_timezone_set($config->timezone);
}
$config->current_time = date("Y-m-d H:i:s", time());
/**
 * Initialize Plugin Hooks
 */
Pixelpost_Plugin::executeAction('hook_init');
/**
 * Helper Functions
 */
/**