Haplous Framework 

Haplous Framework Commit Details


Date:2014-04-27 21:05:19 (10 years 7 months ago)
Author:Natalie Adams
Branch:master
Commit:9eca035c3f554b8f71dcfb92768820b4f9931a1b
Parents: a7c962462d15afe06875d359e4648794cfbc4fc8
Message:updating framework

Changes:

File differences

system/engine/config-default.php
1010
1111
1212
13
1314
1415
$config["DEBUG"] = true;
$config["USE_HF_SMTP"] = true;
$config["SITE_NAME"] = "default";
$config["SITE_URL"] = "";
return $config;
system/engine/controller.php
1212
1313
1414
15
16
17
18
19
20
1521
$this->core = $core;
}
public function loadRender($template, $parameters=array())
{
$this->tpl->loadTemplate($template);
return $this->tpl->render($parameters);
}
}
system/engine/core.php
2323
2424
2525
26
26
27
28
2729
2830
2931
3032
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
3156
3257
3358
3459
3560
36
37
38
39
61
4062
41
63
64
65
66
67
4268
43
44
69
70
71
72
73
74
75
76
77
78
4579
46
4780
4881
4982
......
74107
75108
76109
77
110
111
112
78113
79114
80115
$this->config = array_merge($config, $newconfig);
if ($this->config["USE_H20_TPL"])
$this->tpl = new H2o(null, array(
"searchpath" => getcwd() . "/application/views/", "cache_dir" => "application/tmp/",
"searchpath" => getcwd() . "/application/views/",
"cache_dir" => "application/tmp/",
'cache' => 'file'
));
set_error_handler("HF_Core::error_handler");
$this->findController();
}
public function siteURL()
{
if (isvarset($this->config["SITE_URL"]))
{
return $this->config["SITE_URL"];
}
$path = explode("/", $_SERVER["REQUEST_URI"]);
$path = array_filter($path, 'strlen');
if (count($path) == 0)
{
return $_SERVER["HTTP_HOST"] . "/";
} else {
if (in_array($this->classname, $path))
{
$newpath = implode("/", array_splice($path, 0, -2));
return $_SERVER["HTTP_HOST"] . "/" . $newpath . "/";
} else {
$newpath = implode("/", $path);
return $_SERVER["HTTP_HOST"] . "/" . $newpath . "/";
}
}
}
private function findController()
{
try
{
$request = $_SERVER["PHP_SELF"];
$splitreq = explode("/", $request);
$request = "";
for($i = 0; $i < count($splitreq); $i++)
if (isvarset($_SERVER["PATH_INFO"]))
{
if ($splitreq[$i] == "index.php")
$request = $_SERVER["PATH_INFO"];
//$request = $_SERVER["PHP_SELF"];
$splitreq = explode("/", $request);
/*$request = "";
for($i = 0; $i < count($splitreq); $i++)
{
$request = implode("/", array_splice($splitreq, $i+1));
}
if ($splitreq[$i] == "index.php")
{
$request = implode("/", array_splice($splitreq, $i+1));
}
}*/
//print $request;
//$request = substr($request, 1);
//$request = substr($request, 0, -1);
} else {
$request = "";
}
if ($request == "" || $request == "/")
{
require("application/controllers/" . $this->config["DEFAULT_ROUTE"] . ".php");
continue;
}
$this->load404Controller();
include($path . $this->config["DEFAULT_ROUTE"] . ".php");
$this->loadController(new $this->config["DEFAULT_ROUTE"]($this->config, $this, $this->tpl), $this->config["DEFAULT_ROUTE"], "index");
//$this->load404Controller();
break;
// throw exception controller not found
}
system/vendor/StackTracePrint.php
1919
2020
2121
22
23
24
2225
2326
2427
foreach ($args as $arg)
var_dump($arg);
var_dump($_SERVER);
var_dump($_COOKIE);
$str = ob_get_contents();
ob_end_clean();
system/vendor/isvarset.php
1
2
3
4
5
6
<?php
function isvarset(&$var)
{
return (isset($var) && (!empty($var) || is_numeric($var))) ? true : false;
}

Archive Download the corresponding diff file

Branches

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