예제 #1
0
 public function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new BadKitty();
     }
     return self::$instance;
 }
예제 #2
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');
     }
 }
예제 #3
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');
    }
}
예제 #4
0
 function bind()
 {
     $router = BadKitty::getInstance()->add_url($this->pattern, $this->controller, $this->action, $this->http_method);
 }