Ejemplo n.º 1
0
 /**
  * Run when initializing
  *
  * @return null
  */
 public static function setUpBeforeClass()
 {
     $file = realpath(dirname(__FILE__) . "/../database/test.sqlite3");
     self::$con = new PDO("sqlite:{$file}");
     // self::$con  = new PDO('mysql:host=localhost;dbname=torm',"torm","torm");
     TORM\Connection::setConnection(self::$con, "test");
     TORM\Connection::setEncoding("UTF-8");
     TORM\Connection::setDriver("sqlite");
     TORM\Factory::setFactoriesPath("./factories");
     TORM\Log::enable(false);
     TORM\Cache::getInstance()->setTimeout(300);
 }
Ejemplo n.º 2
0
 /**
  * Run when initializing
  *
  * @return null
  */
 public static function setUpBeforeClass()
 {
     $database = self::_database();
     $con = self::_connection();
     TORM\Connection::setConnection($con, "test");
     TORM\Connection::setEncoding("UTF-8");
     TORM\Connection::setDriver($database);
     TORM\Factory::setFactoriesPath("./factories");
     TORM\Log::enable(false);
     self::$user = new User();
     self::$user->id = 1;
     self::$user->name = "John Doe Jr.";
     self::$user->email = "*****@*****.**";
     self::$user->code = "12345";
     self::$user->user_level = 1;
 }
Ejemplo n.º 3
0
 /**
  * Run when initializing
  *
  * @return null
  */
 public static function setUpBeforeClass()
 {
     $file = realpath(dirname(__FILE__) . "/../database/test.sqlite3");
     self::$con = new PDO("sqlite:{$file}");
     // self::$con  = new PDO('mysql:host=localhost;dbname=torm',"torm","torm");
     TORM\Connection::setConnection(self::$con, "test");
     TORM\Connection::setEncoding("UTF-8");
     TORM\Connection::setDriver("sqlite");
     // TORM\Connection::setDriver("mysql");
     TORM\Factory::setFactoriesPath("./factories");
     TORM\Log::enable(false);
     self::$user = new User();
     self::$user->id = 1;
     self::$user->name = "John Doe Jr.";
     self::$user->email = "*****@*****.**";
     self::$user->code = "12345";
     self::$user->level = 1;
 }
Ejemplo n.º 4
0
<?php

require 'vendor/autoload.php';
$con = new PDO("sqlite:db/database.sqlite3");
TORM\Connection::setConnection($con);
TORM\Connection::setDriver("sqlite");
$app = new \Framework\Initializer();
if (getenv('BIRDS_ENV') == 'development') {
    $app->public_folder = dirname(__FILE__) . '/public/';
} else {
    \Framework\Application::$url_prefix = '/projetos/gaia-pdti/index.php';
    if ($_SERVER['REQUEST_URI'] == '/projetos/gaia-pdti/') {
        header('Location: ' . \Framework\Application::$url_prefix);
    }
}
$app->run($_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD']);