diff options
author | redmatrix <mike@macgirvin.com> | 2016-09-05 18:11:00 -0700 |
---|---|---|
committer | redmatrix <mike@macgirvin.com> | 2016-09-05 18:11:00 -0700 |
commit | bedc7b7b69dcc772243f5a1da692987459f324f0 (patch) | |
tree | d917aa939f0e907fc791272829a6aecae6a447ce /Zotlabs/Web | |
parent | d7d46def9d6893b239c4e4e468fe151cedb28477 (diff) | |
download | volse-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')
-rw-r--r-- | Zotlabs/Web/SubModule.php | 31 |
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; + } + +} + |