Completed
Push — master ( 7a5046...12c141 )
by Jean-Christophe
01:42
created

Framework::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This class gives access to useful methods or objects of the framework
5
 * @author jc
6
 * @version 1.0.0.1
7
 *
8
 */
9
namespace Ubiquity\core;
10
11
use Ubiquity\controllers\Startup;
12
use Ubiquity\controllers\Router;
13
use Ubiquity\utils\RequestUtils;
14
use Ubiquity\utils\SessionUtils;
15
use Ubiquity\utils\CookieUtils;
16
17
class Framework {
18
19
	public const version='2.0.0-beta.1';
20
21
	public static function getController(){
22
		return Startup::getController();
23
	}
24
	public static function getAction(){
25
		return Startup::getAction();
26
	}
27
28
	public static function getUrl(){
29
		return \implode("/", Startup::$urlParts);
30
	}
31
32
	public static function getRouter(){
33
		return new Router();
34
	}
35
36
	public static function getRequest(){
37
		return new RequestUtils();
38
	}
39
40
	public static function getSession(){
41
		return new SessionUtils();
42
	}
43
44
	public static function getCookies(){
45
		return new CookieUtils();
46
	}
47
48
	public static function hasAdmin(){
49
		return \class_exists("controllers\Admin");
50
	}
51
}
52
53