Example #1
0
 function testGetAndSet()
 {
     Flight::set('a', 1);
     $var = Flight::get('a');
     $this->assertEquals(1, $var);
     Flight::clear();
     $vars = Flight::get();
     $this->assertEquals(0, count($vars));
     Flight::set('a', 1);
     Flight::set('b', 2);
     $vars = Flight::get();
     $this->assertEquals(2, count($vars));
     $this->assertEquals(1, $vars['a']);
     $this->assertEquals(2, $vars['b']);
 }
Example #2
0
 */
$gui = new Core_GUI($module);
/**
 * Javascript Generator
 */
$js = new Core_GUI_JS($module);
/**
 * Build Page Header
 */
$gui->getHeader();
/**
 * Get Resource ID
 */
if (Flight::has('RESOURCE_ID')) {
    $resId = Flight::get('RESOURCE_ID');
    Flight::clear('RESOURCE_ID');
} else {
    // Bad Request
    Flight::redirect('/400');
}
// ===========================================================================================================
/**
 * Fetch Resource Model
 */
$dbh = Core_DBH::getDBH();
// Get Database Handle
$sth = $dbh->prepare("\n\tSELECT\n\t\tbox.box_id,\n\t\tos.operating_system,\n\t\tbox.name,\n\t\tbox.notes,\n\t\tbox.steam_lib_path\n\tFROM " . DB_PREFIX . "box AS box\n\tJOIN " . DB_PREFIX . "os AS os\n\t\tON box.os_id = os.os_id\n\tWHERE\n\t\tbox.box_id = :resId\n\t;");
$sth->bindParam(':resId', $resId);
$sth->execute();
$resModel = $sth->fetchAll(PDO::FETCH_ASSOC);
$resModel = $resModel[0];