aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/cron.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-15 04:41:46 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-15 04:41:46 +0000
commit54a3c3e7e9e70c4770010e442e95f734200d03f9 (patch)
treef8e2e7e383523bbf28654ec171e57c841ed1910b /engine/lib/cron.php
parentba331497c03a51ae4b46b387e5f6773620a98cff (diff)
downloadelgg-54a3c3e7e9e70c4770010e442e95f734200d03f9.tar.gz
elgg-54a3c3e7e9e70c4770010e442e95f734200d03f9.tar.bz2
Standardized gobs of files.
git-svn-id: http://code.elgg.org/elgg/trunk@3548 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/cron.php')
-rw-r--r--engine/lib/cron.php106
1 files changed, 51 insertions, 55 deletions
diff --git a/engine/lib/cron.php b/engine/lib/cron.php
index e991e49a2..b4952e2ee 100644
--- a/engine/lib/cron.php
+++ b/engine/lib/cron.php
@@ -1,61 +1,57 @@
<?php
- /**
- * Elgg cron library.
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
+/**
+ * Elgg cron library.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
- /** The cron exception. */
- class CronException extends Exception {}
+/** The cron exception. */
+class CronException extends Exception {}
- /**
- * Initialisation
- *
- */
- function cron_init()
- {
- // Register a pagehandler for cron
- register_page_handler('cron','cron_page_handler');
- }
-
- /**
- * Cron handler for redirecting pages.
- *
- * @param unknown_type $page
- */
- function cron_page_handler($page)
- {
- global $CONFIG;
-
- if ($page[0])
- {
- switch (strtolower($page[0]))
- {
- case 'minute' :
- case 'fiveminute' :
- case 'fifteenmin' :
- case 'halfhour' :
- case 'hourly' :
- case 'daily' :
- case 'weekly' :
- case 'monthly':
- case 'yearly' :
- case 'reboot' : set_input('period', $page[0]); break;
- default : throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $page[0]));
- }
-
- // Include cron handler
- include($CONFIG->path . "engine/handlers/cron_handler.php");
- }
- else
- forward();
- }
+/**
+ * Initialisation
+ *
+ */
+function cron_init() {
+ // Register a pagehandler for cron
+ register_page_handler('cron','cron_page_handler');
+}
+/**
+ * Cron handler for redirecting pages.
+ *
+ * @param unknown_type $page
+ */
+function cron_page_handler($page) {
+ global $CONFIG;
- // Register a startup event
- register_elgg_event_handler('init','system','cron_init');
+ if ($page[0]) {
+ switch (strtolower($page[0])) {
+ case 'minute' :
+ case 'fiveminute' :
+ case 'fifteenmin' :
+ case 'halfhour' :
+ case 'hourly' :
+ case 'daily' :
+ case 'weekly' :
+ case 'monthly':
+ case 'yearly' :
+ case 'reboot' :
+ set_input('period', $page[0]);
+ break;
+ default :
+ throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $page[0]));
+ }
+
+ // Include cron handler
+ include($CONFIG->path . "engine/handlers/cron_handler.php");
+ } else {
+ forward();
+ }
+}
-?> \ No newline at end of file
+// Register a startup event
+register_elgg_event_handler('init','system','cron_init'); \ No newline at end of file