Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ShieldonManager.php
Go to the documentation of this file.
1<?php
3
4use Psr\Http\Message\ResponseInterface;
5use Shieldon\Firewall\Firewall;
6use Shieldon\Firewall\HttpResolver;
7use Shieldon\Firewall\Panel;
8
18
19 private static Firewall $firewall;
20
21 public static function getFirewall(): Firewall {
22 return self::$firewall;
23 }
24
30 public static function start(string $writable = null): void {
31 $writable ??= \ROOT . \DS . 'cache' . \DS . 'shieldon';
32 self::$firewall = new Firewall();
33 self::$firewall->configure($writable);
34 $response = self::$firewall->run();
35 if ($response->getStatusCode() !== 200) {
36 $httpResolver = new HttpResolver();
37 $httpResolver($response);
38 }
39 }
40
44 public static function createPanel(string $uri): Panel {
45 $panel = new Panel();
46 self::$firewall->controlPanel($uri);
47 return $panel;
48 }
49
54 public static function run(): ResponseInterface {
55 return self::$firewall->run();
56 }
57}
Ubiquity\security\shieldon$ShieldonManager This class is part of Ubiquity.
static start(string $writable=null)
Starts th Shieldon service.
static createPanel(string $uri)
Creates the admin panel.