]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Standardized engine/handlers/*
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Oct 2009 21:36:23 +0000 (21:36 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Oct 2009 21:36:23 +0000 (21:36 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3545 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/handlers/action_handler.php
engine/handlers/cron_handler.php
engine/handlers/pagehandler.php
engine/handlers/xml-rpc_handler.php

index 4878084adcb1db0bbd42c20b73bfcbe09c719129..52c1a2633dea9dd5d722a27b9f38d23409e55860 100644 (file)
@@ -1,21 +1,18 @@
 <?php
 
-    /**
-        * Elgg action handler
-        * 
-        * @package Elgg
-        * @subpackage Core
+/**
+ * Elgg action handler
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
 
-        * @author Curverider Ltd
-
-        * @link http://elgg.org/
-        */
-    /**
-     *  Load Elgg framework
-     */
-               define('externalpage',true);
-        require_once("../start.php");
-        $action = get_input("action");
-        action($action);
-    
-?>
+/**
+ *  Load Elgg framework
+ */
+define('externalpage',true);
+require_once("../start.php");
+$action = get_input("action");
+action($action);
\ No newline at end of file
index 71a8cf2a4980d39f5974130c08d2bc6bed70a9b4..37a0335f6ce42e9132ecd7123a9c56fefb46e728 100644 (file)
@@ -1,38 +1,41 @@
 <?php
-       /**
-        * Elgg Cron handler.
-        * 
-        * @package Elgg
-        * @subpackage Core
-        * @author Curverider Ltd
-        * @link http://elgg.org/
-        */
-
-       // Load Elgg engine
-       define('externalpage',true);
-       require_once("../start.php");
-       global $CONFIG;
-       
-       // Get basic parameters
-       $period = get_input('period');
-       if (!$period) throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $period));
-       
-       // Get a list of parameters
-       $params = array();
-       $params['time'] = time();
-       
-       foreach ($CONFIG->input as $k => $v)
-               $params[$k] = $v;
-       
-       // Trigger hack
-       $std_out = ""; // Data to return to
-       $old_stdout = "";
-       ob_start();
-       
-       $old_stdout = trigger_plugin_hook('cron', $period, $params, $old_stdout);
-               
-       $std_out = ob_get_clean();
-       
-       // Return event
-       echo $std_out . $old_stdout;
-?>
\ No newline at end of file
+/**
+ * Elgg Cron handler.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+// Load Elgg engine
+define('externalpage',true);
+require_once("../start.php");
+global $CONFIG;
+
+// Get basic parameters
+$period = get_input('period');
+if (!$period) {
+       throw new CronException(sprintf(elgg_echo('CronException:unknownperiod'), $period));
+}
+
+// Get a list of parameters
+$params = array();
+$params['time'] = time();
+
+foreach ($CONFIG->input as $k => $v) {
+       $params[$k] = $v;
+}
+
+// Trigger hack
+
+// Data to return to
+$std_out = "";
+$old_stdout = "";
+ob_start();
+
+$old_stdout = trigger_plugin_hook('cron', $period, $params, $old_stdout);
+$std_out = ob_get_clean();
+
+// Return event
+echo $std_out . $old_stdout;
\ No newline at end of file
index 506ae980219d5f464aee32ed40a87aa17b25c8c4..a0837caa183bccdf7d37e1884fef91f5c5f99fe0 100644 (file)
@@ -1,27 +1,22 @@
 <?php
+/**
+ * Elgg page handler
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
 
-       /**
-        * Elgg page handler
-        * 
-        * @package Elgg
-        * @subpackage Core
+// Load Elgg engine
+// define('externalpage',true);
+require_once("../start.php");
 
-        * @author Curverider Ltd
+// Get input
+$handler = get_input('handler');
+$page = get_input('page');
 
-        * @link http://elgg.org/
-        */
-
-       // Load Elgg engine
-               // define('externalpage',true);
-               require_once("../start.php");
-
-       // Get input
-               $handler = get_input('handler');
-               $page = get_input('page');
-               
-       // Call the page handler functions
-               if (!page_handler($handler, $page)) {
-                       forward();
-               }
-
-?>
\ No newline at end of file
+// Call the page handler functions
+if (!page_handler($handler, $page)) {
+       forward();
+}
\ No newline at end of file
index bc87306c72249e4109d5111d291b5aceb44be634..26c1454bf697c4ea7136cdd1329affd3a7b7d00f 100644 (file)
@@ -1,47 +1,45 @@
 <?php
-       /**
-        * Elgg XML-RPC handler.
-        * 
-        * @package Elgg
-        * @subpackage Core
-        * @author Curverider Ltd
-        * @link http://elgg.org/
-        */
-
-       // Load Elgg engine
-       define('externalpage',true);
-       require_once("../start.php");
-       global $CONFIG;
-
-       // Register the error handler
-       error_reporting(E_ALL); 
-       set_error_handler('__php_xmlrpc_error_handler');
-       
-       // Register a default exception handler
-       set_exception_handler('__php_xmlrpc_exception_handler'); 
-       
-       // Set some defaults
-       $result = null;
-       set_input('view', 'xml'); // Set default view regardless
-
-       // Get the post data
-       $input = get_post_data();
-       
-       if ($input)
-       {
-               //      Parse structures from xml
-               $call = new XMLRPCCall($input);
-               
-               // Process call
-               $result = trigger_xmlrpc_handler($call);
-       }
-       else
-               throw new CallException(elgg_echo('xmlrpc:noinputdata'));
-
-       if (!($result instanceof XMLRPCResponse))
-               throw new APIException(elgg_echo('APIException:ApiResultUnknown'));
-
-       // Output result
-       page_draw("XML-RPC", elgg_view("xml-rpc/output", array('result' => $result)));
-       
-?>
\ No newline at end of file
+/**
+ * Elgg XML-RPC handler.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+// Load Elgg engine
+define('externalpage',true);
+require_once("../start.php");
+global $CONFIG;
+
+// Register the error handler
+error_reporting(E_ALL);
+set_error_handler('__php_xmlrpc_error_handler');
+
+// Register a default exception handler
+set_exception_handler('__php_xmlrpc_exception_handler');
+
+// Set some defaults
+$result = null;
+set_input('view', 'xml'); // Set default view regardless
+
+// Get the post data
+$input = get_post_data();
+
+if ($input) {
+       //      Parse structures from xml
+       $call = new XMLRPCCall($input);
+
+       // Process call
+       $result = trigger_xmlrpc_handler($call);
+} else {
+       throw new CallException(elgg_echo('xmlrpc:noinputdata'));
+}
+
+if (!($result instanceof XMLRPCResponse)) {
+       throw new APIException(elgg_echo('APIException:ApiResultUnknown'));
+}
+
+// Output result
+page_draw("XML-RPC", elgg_view("xml-rpc/output", array('result' => $result)));
\ No newline at end of file