From 35e5be8ac9aaa7a409c7f70b1b882b809c0bb2e1 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 18 Aug 2011 01:22:35 +0200 Subject: Added script that will create the documentation. Also rewritten some documentation, so NaturalDocs can handle them. --- ratatoeskr/sys/db.php | 1 + ratatoeskr/sys/models.php | 12 ++++++------ ratatoeskr/sys/plugin_api.php | 30 +++++++++++++++--------------- ratatoeskr/sys/urlprocess.php | 40 ++++++++++++++++++++-------------------- 4 files changed, 42 insertions(+), 41 deletions(-) (limited to 'ratatoeskr') diff --git a/ratatoeskr/sys/db.php b/ratatoeskr/sys/db.php index 0f3357a..fcde7f3 100644 --- a/ratatoeskr/sys/db.php +++ b/ratatoeskr/sys/db.php @@ -40,6 +40,7 @@ function sqlesc($str) /* * Class: MySQLException + * Will be thrown by qdb*, if the query induced an MySQL error. */ class MySQLException extends Exception { } diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php index 13d5843..f2f6076 100644 --- a/ratatoeskr/sys/models.php +++ b/ratatoeskr/sys/models.php @@ -13,6 +13,12 @@ require_once(dirname(__FILE__) . "/utils.php"); db_connect(); +/* + * Variable: $ratatoeskr_settings + * The global object. For internal use. + */ +$ratatoeskr_settings = new Settings("rw"); + /* * Class: DoesNotExistError * This Exception is thrown by an ::by_*-constructor or any array-like object if the desired object is not present in the database. @@ -891,12 +897,6 @@ class Settings implements Countable, ArrayAccess, IteratorAggregate public function getIterator() { return new SettingsIterator($this); } } -/* - * Variable: $ratatoeskr_settings - * The global object. For internal use. - */ -$ratatoeskr_settings = new Settings("rw"); - /* * Class: PluginKVStorage * A Key-Value-Storage for Plugins diff --git a/ratatoeskr/sys/plugin_api.php b/ratatoeskr/sys/plugin_api.php index e5625f8..697c375 100644 --- a/ratatoeskr/sys/plugin_api.php +++ b/ratatoeskr/sys/plugin_api.php @@ -11,6 +11,21 @@ require_once(dirname(__FILE__) . "/models.php"); +$url_handlers = array(); +/* + * Function: register_url_handler + * Register an URL handler. See for more details. + * + * Parameters: + * $name - The name of the new URL + * $callback - The Function to be called (see ). + */ +function register_url_handler($name, $callback) +{ + global $url_handlers; + $url_handlers[$name] = $callback; +} + /* * Class: RatatoeskrPlugin * An abstract class to be extended in order to write your own Plugin. @@ -84,19 +99,4 @@ abstract class RatatoeskrPlugin public function uninstall() {} } -$url_handlers = array(); -/* - * Function: register_url_handler - * Register an URL handler. See for more details. - * - * Parameters: - * $name - The name of the new URL - * $callback - The Function to be called (see ). - */ -function register_url_handler($name, $callback) -{ - global $url_handlers; - $url_handlers[$name] = $callback; -} - ?> diff --git a/ratatoeskr/sys/urlprocess.php b/ratatoeskr/sys/urlprocess.php index 2274197..d539c87 100644 --- a/ratatoeskr/sys/urlprocess.php +++ b/ratatoeskr/sys/urlprocess.php @@ -9,26 +9,6 @@ * See "ratatoeskr/licenses/ratatoeskr" for more information. */ -/* - * Class: Redirect - * Exception that can be thrown inside an . - * throw new Redirect(array("..", "foo")); will redirect to "../foo" and won't touch $data. - */ -class Redirect extends Exception -{ - public $nextpath; - public function __construct($nextpath) - { - $this->nextpath = $nextpath; - parent::__construct(); - } -} -/* - * Class: NotFoundError - * An Exception - */ -class NotFoundError extends Exception { } - /* * Function: url_action_simple * Generate an action in a more simple way. @@ -151,4 +131,24 @@ function url_process($url, $actions, &$data) return NULL; } +/* + * Class: Redirect + * Exception that can be thrown inside an . + * throw new Redirect(array("..", "foo")); will redirect to "../foo" and won't touch $data. + */ +class Redirect extends Exception +{ + public $nextpath; + public function __construct($nextpath) + { + $this->nextpath = $nextpath; + parent::__construct(); + } +} +/* + * Class: NotFoundError + * An Exception + */ +class NotFoundError extends Exception { } + ?> -- cgit v1.2.3-54-g00ecf