Exemplo n.º 1
0
 function __construct()
 {
     try {
         $this->db = new PDO('sqlite:' . getenv('DOCUMENT_ROOT') . '/database.sdb');
         $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         BadKitty::getInstance()->error('db');
     }
 }
Exemplo n.º 2
0
<?php

/**
 * Yeah. You're definitely going to need this.
 * Probably don't edit anything in here.
 */
require getenv('DOCUMENT_ROOT') . '/app/bootstrap.php';
/**
 * And ah... don't forget to actually run the application.
 */
try {
    BadKitty::getInstance()->dispatch();
} catch (Exception $e) {
    $klass = new AppController();
    $klass->e = $e;
    if (__DEBUG__ == TRUE) {
        $klass->title = 'Error';
        echo $klass->render('error.php');
    } else {
        $klass->title = '404 Not Found';
        echo $klass->render('error404.php');
    }
}
Exemplo n.º 3
0
 function bind()
 {
     $router = BadKitty::getInstance()->add_url($this->pattern, $this->controller, $this->action, $this->http_method);
 }