aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Extend/Route.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-07-18 20:59:45 +0200
committerMario Vavti <mario@mariovavti.com>2018-07-18 20:59:45 +0200
commitdfbdeafa39da8605c124f47d811ebca2330d9169 (patch)
tree1f1431f9306cc06de7fc20616cb6124f4535d1a7 /Zotlabs/Extend/Route.php
parenteb322e831297ee8fd773049c1a00c915c49dc93e (diff)
parent82a4bbd571131462bbff1cb2455af46747f3b840 (diff)
downloadvolse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.tar.gz
volse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.tar.bz2
volse-hubzilla-dfbdeafa39da8605c124f47d811ebca2330d9169.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Extend/Route.php')
-rw-r--r--Zotlabs/Extend/Route.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/Zotlabs/Extend/Route.php b/Zotlabs/Extend/Route.php
new file mode 100644
index 000000000..f7b90ec6e
--- /dev/null
+++ b/Zotlabs/Extend/Route.php
@@ -0,0 +1,48 @@
+<?php
+
+namespace Zotlabs\Extend;
+
+
+class Route {
+
+ static function register($file,$modname) {
+ $rt = self::get();
+ $rt[] = [ $file, $modname ];
+ self::set($rt);
+ }
+
+ static function unregister($file,$modname) {
+ $rt = self::get();
+ if($rt) {
+ $n = [];
+ foreach($rt as $r) {
+ if($r[0] !== $file && $r[1] !== $modname) {
+ $n[] = $r;
+ }
+ }
+ self::set($n);
+ }
+ }
+
+ static function unregister_by_file($file) {
+ $rt = self::get();
+ if($rt) {
+ $n = [];
+ foreach($rt as $r) {
+ if($r[0] !== $file) {
+ $n[] = $r;
+ }
+ }
+ self::set($n);
+ }
+ }
+
+ static function get() {
+ return get_config('system','routes',[]);
+ }
+
+ static function set($r) {
+ return set_config('system','routes',$r);
+ }
+}
+