aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/web_services.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2012-11-14 21:54:13 -0500
committerSteve Clay <steve@mrclay.org>2012-11-14 22:14:55 -0500
commit4f9fb7df0dabfa470e1f7045428c5e47a6ce3919 (patch)
tree8f5e64d83e05584c076ad1b431d032738f1702a9 /engine/lib/web_services.php
parent3048db0f3f1ade31d6f3a2cdd3268e978a3e3cf3 (diff)
downloadelgg-4f9fb7df0dabfa470e1f7045428c5e47a6ce3919.tar.gz
elgg-4f9fb7df0dabfa470e1f7045428c5e47a6ce3919.tar.bz2
Style cleanup
Diffstat (limited to 'engine/lib/web_services.php')
-rw-r--r--engine/lib/web_services.php35
1 files changed, 23 insertions, 12 deletions
diff --git a/engine/lib/web_services.php b/engine/lib/web_services.php
index 39fb0dc44..c8e4a13cc 100644
--- a/engine/lib/web_services.php
+++ b/engine/lib/web_services.php
@@ -1195,6 +1195,8 @@ $ERRORS = array();
*
* @return void
* @access private
+ *
+ * @throws Exception
*/
function _php_api_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
global $ERRORS;
@@ -1300,6 +1302,7 @@ function service_handler($handler, $request) {
*/
function register_service_handler($handler, $function) {
global $CONFIG;
+
if (!isset($CONFIG->servicehandler)) {
$CONFIG->servicehandler = array();
}
@@ -1318,11 +1321,13 @@ function register_service_handler($handler, $function) {
*
* @param string $handler web services type
*
- * @return 1.7.0
+ * @return void
+ * @since 1.7.0
*/
function unregister_service_handler($handler) {
global $CONFIG;
- if (isset($CONFIG->servicehandler) && isset($CONFIG->servicehandler[$handler])) {
+
+ if (isset($CONFIG->servicehandler, $CONFIG->servicehandler[$handler])) {
unset($CONFIG->servicehandler[$handler]);
}
}
@@ -1332,6 +1337,8 @@ function unregister_service_handler($handler) {
*
* @return void
* @access private
+ *
+ * @throws SecurityException|APIException
*/
function rest_handler() {
global $CONFIG;
@@ -1386,7 +1393,7 @@ function rest_handler() {
/**
* Unit tests for API
*
- * @param sting $hook unit_test
+ * @param string $hook unit_test
* @param string $type system
* @param mixed $value Array of tests
* @param mixed $params Params
@@ -1396,6 +1403,7 @@ function rest_handler() {
*/
function api_unit_test($hook, $type, $value, $params) {
global $CONFIG;
+
$value[] = $CONFIG->path . 'engine/tests/services/api.php';
return $value;
}
@@ -1417,15 +1425,18 @@ function api_init() {
elgg_echo("system.api.list"), "GET", false, false);
// The authentication token api
- expose_function("auth.gettoken",
- "auth_gettoken", array(
- 'username' => array ('type' => 'string'),
- 'password' => array ('type' => 'string'),
- ),
- elgg_echo('auth.gettoken'),
- 'POST',
- false,
- false);
+ expose_function(
+ "auth.gettoken",
+ "auth_gettoken",
+ array(
+ 'username' => array ('type' => 'string'),
+ 'password' => array ('type' => 'string'),
+ ),
+ elgg_echo('auth.gettoken'),
+ 'POST',
+ false,
+ false
+ );
}