You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by ch...@apache.org on 2009/09/23 14:20:16 UTC

svn commit: r818073 - in /incubator/shindig/trunk/php/src/social/service: DataRequestHandler.php RpcRequestItem.php

Author: chabotc
Date: Wed Sep 23 12:20:16 2009
New Revision: 818073

URL: http://svn.apache.org/viewvc?rev=818073&view=rev
Log:
Patch by Jinhui Du - Accept both mediaItems and mediaitems as a service

Modified:
    incubator/shindig/trunk/php/src/social/service/DataRequestHandler.php
    incubator/shindig/trunk/php/src/social/service/RpcRequestItem.php

Modified: incubator/shindig/trunk/php/src/social/service/DataRequestHandler.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/service/DataRequestHandler.php?rev=818073&r1=818072&r2=818073&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/service/DataRequestHandler.php (original)
+++ incubator/shindig/trunk/php/src/social/service/DataRequestHandler.php Wed Sep 23 12:20:16 2009
@@ -48,7 +48,7 @@
         throw new SocialSpiException("[$method] not allowed for anonymous users", ResponseError::$BAD_REQUEST);
       } elseif (in_array($method, self::$GET_SYNONYMS)) {
         $parameters = $requestItem->getParameters();
-        if (in_array("@supportedFields", $parameters)) {
+        if (in_array("@supportedFields", $parameters, true)) {
           $response = $this->getSupportedFields($parameters);
         } else {
           $response = $this->handleGet($requestItem);

Modified: incubator/shindig/trunk/php/src/social/service/RpcRequestItem.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/service/RpcRequestItem.php?rev=818073&r1=818072&r2=818073&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/service/RpcRequestItem.php (original)
+++ incubator/shindig/trunk/php/src/social/service/RpcRequestItem.php Wed Sep 23 12:20:16 2009
@@ -38,11 +38,17 @@
   }
 
   public function getService($rpcMethod = null) {
+    $service = null;
     if ($rpcMethod != null) {
-      return substr($rpcMethod, 0, strpos($rpcMethod, '.'));
+      $service = substr($rpcMethod, 0, strpos($rpcMethod, '.'));
     } else {
-      return substr($this->service, 0, strpos($this->service, '.'));
+      $service = substr($this->service, 0, strpos($this->service, '.'));
     }
+    // Accepts both 'mediaItems' and 'mediaitems'.
+    if ($service == 'mediaItems') {
+        $service = 'mediaitems';
+    }
+    return $service;
   }
 
   public function getOperation($rpcMethod = null) {