Haplous Framework 

Haplous Framework Commit Details


Date:2014-12-23 22:51:45 (10 years 3 months ago)
Author:Natalie Adams
Branch:master
Commit:00b092d62c631d3597f2ace2562f33fc2c5fe535
Parents: b555ea983c40a368fe3fb533f0242f6938996b24
Message:adding runtime and default DB detection

Changes:

File differences

system/engine/controller.php
33
44
55
6
67
78
89
......
1011
1112
1213
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
1334
1435
1536
{
    protected $config;
    protected $tpl;
    /** @var HF_Core  */
    protected $core;
    public function __construct($config, $core, $tpl = null)
        $this->config = $config;
        $this->tpl = $tpl;
        $this->core = $core;
        $this->initdb();
    }
    protected function initdb()
    {
        if (isvarset($this->config["MYSQL_DBNAME"]) && isvarset($this->config["MYSQL_USER"]))
        {
            $pdo = new PDO(
                "mysql:dbname={$this->config['MYSQL_DBNAME']};host={$this->config['MYSQL_HOST']}",
                $this->config['MYSQL_USER'],
                $this->config['MYSQL_PASS'],
                array(
                    PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
                    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
                    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
                )
            );
            DB::$c = $pdo;
        }
    }
    public function loadRender($template, $parameters=array())
system/engine/core.php
1212
1313
1414
15
1516
1617
1718
19
1820
1921
2022
......
3133
3234
3335
36
37
38
39
40
3441
3542
3643
private $args = array();
    private $config = array();
    private $tpl;
    private $starttime;
public function __construct()
{
        $this->starttime = microtime(true);
        $config = include("system/engine/config-default.php");
        if (is_file("application/config.php"))
        {
        $this->findController();
}
    public function getRuntime()
    {
        return $this->starttime - microtime(true);
    }
    public function siteURL()
    {
        if (isvarset($this->config["SITE_URL"]))

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.11547s using 14 queries.