aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web/Router.php
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-09-05 00:23:42 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-11-03 23:04:27 +0100
commit1a737be2b408135177a9e94dcffd0f68c0aca90b (patch)
tree17e565688120ef94db2fa1e9635d0d55f2e43c58 /Zotlabs/Web/Router.php
parent0ce7358f0f00cb000562dc34be13459eb5779c18 (diff)
downloadvolse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.tar.gz
volse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.tar.bz2
volse-hubzilla-1a737be2b408135177a9e94dcffd0f68c0aca90b.zip
:bulb: Improving Doxygen documentation.
Fix some Doxygen parsing errors. Improve hooks documentation.
Diffstat (limited to 'Zotlabs/Web/Router.php')
-rw-r--r--Zotlabs/Web/Router.php40
1 files changed, 25 insertions, 15 deletions
diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php
index 9486130cb..12ef315d4 100644
--- a/Zotlabs/Web/Router.php
+++ b/Zotlabs/Web/Router.php
@@ -2,6 +2,8 @@
namespace Zotlabs\Web;
+use Exception;
+
/**
*
* We have already parsed the server path into App::$argc and App::$argv
@@ -34,7 +36,7 @@ class Router {
private $controller = null;
/**
- * @brief Router constructor
+ * @brief Router constructor.
*
* @param[in,out] App &$a
* @throws Exception module not found
@@ -98,15 +100,23 @@ class Router {
}
}
- /*
- * This provides a place for plugins to register module handlers which don't otherwise exist
- * on the system, or to completely over-ride an existing module.
- * If the plugin sets 'installed' to true we won't throw a 404 error for the specified module even if
- * there is no specific module file or matching plugin name.
- * The plugin should catch at least one of the module hooks for this URL.
+ $x = [
+ 'module' => $module,
+ 'installed' => \App::$module_loaded,
+ 'controller' => $this->controller
+ ];
+ /**
+ * @hooks module_loaded
+ * Called when a module has been successfully locate to server a URL request.
+ * This provides a place for plugins to register module handlers which don't otherwise exist
+ * on the system, or to completely over-ride an existing module.
+ * If the plugin sets 'installed' to true we won't throw a 404 error for the specified module even if
+ * there is no specific module file or matching plugin name.
+ * The plugin should catch at least one of the module hooks for this URL.
+ * * \e string \b module
+ * * \e boolean \b installed
+ * * \e mixed \b controller - The initialized module object
*/
-
- $x = array('module' => $module, 'installed' => \App::$module_loaded, 'controller' => $this->controller);
call_hooks('module_loaded', $x);
if($x['installed']) {
\App::$module_loaded = true;
@@ -131,14 +141,14 @@ class Router {
}
}
- $x = [
- 'module' => $module,
- 'installed' => \App::$module_loaded,
+ $x = [
+ 'module' => $module,
+ 'installed' => \App::$module_loaded,
'controller' => $this->controller
];
call_hooks('page_not_found',$x);
- // Stupid browser tried to pre-fetch our Javascript img template.
+ // Stupid browser tried to pre-fetch our Javascript img template.
// Don't log the event or return anything - just quietly exit.
if((x($_SERVER, 'QUERY_STRING')) && preg_match('/{[0-9]}/', $_SERVER['QUERY_STRING']) !== 0) {
@@ -147,8 +157,8 @@ class Router {
if(get_config('system','log_404',true)) {
logger("Module {$module} not found.", LOGGER_DEBUG, LOG_WARNING);
- logger('index.php: page not found: ' . $_SERVER['REQUEST_URI']
- . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: '
+ logger('index.php: page not found: ' . $_SERVER['REQUEST_URI']
+ . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: '
. $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
}