Exemple #1
0
 public function __construct($id = null)
 {
     $this->_conn = \Pste\Database::getInstance()->getConnection();
     $this->_initStatementBuilder();
     if ($id) {
         $this->_id = $id;
         $this->_populate();
     }
 }
Exemple #2
0
//path for the pastebin => for http:/domain/pastebin/
$CONF['pastebin'] = '';
// Pull in the required database class.
switch ($CONF['driver']) {
    case "postgresql":
    case "pgsql":
    case "postgres":
        \Pste\Database::getInstance()->createConnection('pgsql', $CONF["dbhost"], $CONF['dbname'], $CONF["dbuser"], $CONF["dbpass"]);
        require_once 'classes/db.php';
        break;
    case "mysql":
        \Pste\Database::getInstance()->createConnection('mysql', $CONF["dbhost"], $CONF['dbname'], $CONF["dbuser"], $CONF["dbpass"]);
        require_once 'classes/db.php';
        break;
}
\Pste\Database::getInstance()->getConnection()->exec("SET NAMES 'utf8'");
$ht = new Pste_View_Helper_HeadTitle();
$ht->setTitle('Pste', 'replace');
/**
 * wrapper for config instance creation so the instance does not live in global
 * scope 
 */
function bootstrap($configuration_array)
{
    $config = new \Pste\Config($configuration_array);
    \Pste\Registry::getInstance()->config = $config;
    $route = new \Pste\Route();
    $route->setTemplatePath($config->template);
    \Pste\Registry::getInstance()->route = $route;
}
function __autoload($class)
Exemple #3
0
 public function __construct()
 {
     $this->_conn = \Pste\Database::getInstance()->getConnection();
     $this->_driver = $this->_conn->getAttribute(PDO::ATTR_DRIVER_NAME);
 }