Skip to content

Commit 5865ba4

Browse files
committed
Create ServicesChecker.php
1 parent 069bce0 commit 5865ba4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
namespace Ubiquity\controllers\admin;
3+
4+
/**
5+
* Ubiquity\controllers\admin$ServicesChecker
6+
* This class is part of Ubiquity
7+
*
8+
* @author jc
9+
* @version 1.0.0
10+
*
11+
*/
12+
class ServicesChecker {
13+
14+
public static function hasSecurity(): bool {
15+
return \class_exists('\\Ubiquity\\security\\csrf\\CsrfManager');
16+
}
17+
18+
public static function hasShieldon(): bool {
19+
return \class_exists('\\Shieldon\\Container');
20+
}
21+
22+
public static function isCsrfStarted(): bool {
23+
if (self::hasSecurity()) {
24+
return \Ubiquity\security\csrf\CsrfManager::isStarted();
25+
}
26+
return false;
27+
}
28+
29+
public static function isEncryptionStarted() {
30+
if (self::hasSecurity()) {
31+
return \Ubiquity\security\data\EncryptionManager::isStarted();
32+
}
33+
return false;
34+
}
35+
36+
public static function isShieldonStarted(): bool {
37+
if (self::hasShieldon()) {
38+
return \Shieldon\Container::get('firewall') !== null;
39+
}
40+
return false;
41+
}
42+
}
43+

0 commit comments

Comments
 (0)