aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web/SubModule.php
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-09-05 18:11:00 -0700
committerredmatrix <mike@macgirvin.com>2016-09-05 18:11:00 -0700
commitbedc7b7b69dcc772243f5a1da692987459f324f0 (patch)
treed917aa939f0e907fc791272829a6aecae6a447ce /Zotlabs/Web/SubModule.php
parentd7d46def9d6893b239c4e4e468fe151cedb28477 (diff)
downloadvolse-hubzilla-bedc7b7b69dcc772243f5a1da692987459f324f0.tar.gz
volse-hubzilla-bedc7b7b69dcc772243f5a1da692987459f324f0.tar.bz2
volse-hubzilla-bedc7b7b69dcc772243f5a1da692987459f324f0.zip
use SubModule class for generalising submodules, move back to the zotlabs/module hierarchy
Diffstat (limited to 'Zotlabs/Web/SubModule.php')
-rw-r--r--Zotlabs/Web/SubModule.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/Zotlabs/Web/SubModule.php b/Zotlabs/Web/SubModule.php
new file mode 100644
index 000000000..122766d5a
--- /dev/null
+++ b/Zotlabs/Web/SubModule.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Zotlabs\Web;
+
+
+class SubModule {
+
+ private $controller = false;
+
+ function __construct() {
+
+ if(argc() < 2)
+ return;
+
+ $filename = 'Zotlabs/Module/' . ucfirst(argv(0)) . '/'. ucfirst(argv(1)) . '.php';
+ $modname = '\\Zotlabs\\Module\\' . ucfirst(argv(0)) . '\\' . ucfirst(argv(1));
+ if(file_exists($filename)) {
+ $this->controller = new $modname();
+ }
+ }
+
+ function call($method) {
+ if(! $this->controller)
+ return false;
+ if(method_exists($this->controller,$method))
+ return $this->controller->$method();
+ return false;
+ }
+
+}
+