Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Framework.php
Go to the documentation of this file.
1<?php
2
11namespace Ubiquity\core;
12
23
24class Framework {
25 public const VERSION = '2.5.2';
26
31 public static function getVersion(): string {
32 return self::VERSION;
33 }
34
39 public static function getEnv(): string {
40 return Startup::getConfig()['app.env'] ?? 'dev';
41 }
42
47 public static function getController(): ?string {
48 return Startup::getController();
49 }
50
55 public static function getAction(): ?string {
56 return Startup::getAction();
57 }
58
63 public static function getUrl(): string {
64 return \implode('/', Startup::$urlParts);
65 }
66
67 public static function getRouter(): Router {
68 return new Router();
69 }
70
71 public static function getORM(): OrmUtils {
72 return new OrmUtils();
73 }
74
75 public static function getRequest(): URequest {
76 return new URequest();
77 }
78
79 public static function getSession(): USession {
80 return new USession();
81 }
82
83 public static function getCookies(): UCookie {
84 return new UCookie();
85 }
86
87 public static function getTranslator(): TranslatorManager {
88 return new TranslatorManager();
89 }
90
91 public static function getNormalizer(): NormalizersManager {
92 return new NormalizersManager();
93 }
94
95 public static function hasAdmin(): bool {
96 return \class_exists("controllers\Admin");
97 }
98
99 public static function getAssets(): AssetsManager {
100 return new AssetsManager();
101 }
102
103 public static function getCacheSystem(): string {
104 return \get_class(CacheManager::$cache);
105 }
106
107 public static function getAnnotationsEngine(): string {
108 return \get_class(CacheManager::getAnnotationsEngineInstance());
109 }
110}
111
Assets manager for css and js inclusions in templates.
Manager for caches (Router, Rest, models).
Normalize objects and arrays of objects.
Starts the framework.
Definition Startup.php:19
static getController()
Returns the active controller class name.
Definition Framework.php:47
static getVersion()
Returns framework version.
Definition Framework.php:31
static getEnv()
Returns the app.env value in config cache.
Definition Framework.php:39
static getUrl()
Gets the active URL.
Definition Framework.php:63
static getAction()
Returns the active action.
Definition Framework.php:55
Object/relational mapping utilities.
Definition OrmUtils.php:17
Http Request utilities, wrapper for accessing to $_GET, $_POST and php://input.
Definition URequest.php:18
Http Session utilities This class is part of Ubiquity.
Definition USession.php:16
Ubiquity\core This class is part of Ubiquity.
Definition Framework.php:11