You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2008/08/05 00:12:58 UTC

svn commit: r682527 [2/2] - in /incubator/shindig/trunk/php/src: common/ common/samplecontainer/ gadgets/ gadgets/http/ gadgets/oauth/ social-api/ social-api/converters/ social-api/dataservice/ social-api/http/ social-api/opensocial/model/ social-api/s...

Modified: incubator/shindig/trunk/php/src/social-api/dataservice/GroupId.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/dataservice/GroupId.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/dataservice/GroupId.php (original)
+++ incubator/shindig/trunk/php/src/social-api/dataservice/GroupId.php Mon Aug  4 15:12:56 2008
@@ -18,7 +18,7 @@
  */
 
 class GroupId {
-	static public $types = array('all', 'friends', 'self', 'groupId');
+	public static $types = array('all', 'friends', 'self', 'groupId');
 	private $type;
 	private $groupId;
 
@@ -40,7 +40,7 @@
 	{
 		return $this->groupId;
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;

Modified: incubator/shindig/trunk/php/src/social-api/dataservice/MessagesHandler.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/dataservice/MessagesHandler.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/dataservice/MessagesHandler.php (original)
+++ incubator/shindig/trunk/php/src/social-api/dataservice/MessagesHandler.php Mon Aug  4 15:12:56 2008
@@ -18,7 +18,7 @@
  */
 
 class MessagesHandler extends DataRequestHandler {
-
+	
 	private static $MESSAGES_PATH = "/messages/{userId}/outbox/{msgId}";
 	private $service;
 

Modified: incubator/shindig/trunk/php/src/social-api/dataservice/UserId.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/dataservice/UserId.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/dataservice/UserId.php (original)
+++ incubator/shindig/trunk/php/src/social-api/dataservice/UserId.php Mon Aug  4 15:12:56 2008
@@ -18,7 +18,7 @@
  */
 
 class UserId {
-	static public $types = array('viewer', 'owner', 'userId');
+	public static $types = array('viewer', 'owner', 'userId');
 	private $type;
 	private $userId;
 
@@ -53,7 +53,7 @@
 				break;
 		}
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;

Modified: incubator/shindig/trunk/php/src/social-api/http/RestServlet.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/http/RestServlet.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/http/RestServlet.php (original)
+++ incubator/shindig/trunk/php/src/social-api/http/RestServlet.php Mon Aug  4 15:12:56 2008
@@ -65,8 +65,10 @@
 define('FORBIDDEN', "forbidden");
 define('BAD_REQUEST', "badRequest");
 define('INTERNAL_ERROR', "internalError");
+
 //FIXME Delete should respond with a 204 No Content to indicate success
 
+
 class RestServlet extends HttpServlet {
 	
 	// The json Batch Route is used by the gadgets 
@@ -88,7 +90,7 @@
 	{
 		$this->doPost('DELETE');
 	}
-		
+
 	public function doPost($method = 'POST')
 	{
 		try {
@@ -128,7 +130,7 @@
 		} catch (Exception $e) {
 			header("HTTP/1.0 500 Internal Server Error");
 			echo "<html><body><h1>500 Internal Server Error</h1>";
-			echo "Message: ".$e->getMessage()."<br />\n";
+			echo "Message: " . $e->getMessage() . "<br />\n";
 			if (Config::get('debug')) {
 				echo "<pre>\n";
 				print_r($e);
@@ -150,7 +152,7 @@
 		$responseItem = $this->getResponseItem($requestItem);
 		return array('request' => $requestItem, 'response' => $responseItem);
 	}
-	
+
 	private function handleJsonBatchRequest($token)
 	{
 		// we support both a raw http post (without application/x-www-form-urlencoded headers) like java does
@@ -168,24 +170,25 @@
 			throw new Exception("No post data set");
 		}
 	}
-	
+
 	private function handleBatchProxyRequest($token)
 	{
 		// Is this is a multipath/mixed post? Check content type:
-		if (isset($GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'multipart/mixed') !== false && strpos($_SERVER['CONTENT_TYPE'],'boundary=') !== false) {
+		if (isset($GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'multipart/mixed') !== false && strpos($_SERVER['CONTENT_TYPE'], 'boundary=') !== false) {
 			// Ok looks swell, see what our boundry is..
-			$boundry = substr($_SERVER['CONTENT_TYPE'], strpos($_SERVER['CONTENT_TYPE'],'boundary=') + strlen('boundary='));
+			$boundry = substr($_SERVER['CONTENT_TYPE'], strpos($_SERVER['CONTENT_TYPE'], 'boundary=') + strlen('boundary='));
 			// Split up requests per boundry
 			$requests = explode($boundry, $GLOBALS['HTTP_RAW_POST_DATA']);
 			$responses = array();
 			foreach ($requests as $request) {
 				$request = trim($request);
-				if (!empty($request)) {
+				if (! empty($request)) {
 					// extractBatchRequest() does the magic parsing of the raw post data to a meaninful request array
 					$request = $this->extractBatchRequest($request);
 					$requestItem = new RestRequestItem();
 					$requestItem->createRequestItemWithRequest($request, $token);
-					$responses[] = array('request' => $requestItem, 'response' => $this->getResponseItem($requestItem));
+					$responses[] = array('request' => $requestItem, 
+							'response' => $this->getResponseItem($requestItem));
 				}
 			}
 		} else {
@@ -212,12 +215,12 @@
 		$request = '';
 		foreach ($requestLines as $line) {
 			if ($emptyFound) {
-				$request .= $line."\n";
+				$request .= $line . "\n";
 			} elseif (empty($line)) {
 				$emptyFound = true;
 			}
 		}
-		if (!$emptyFound) {
+		if (! $emptyFound) {
 			throw new Exception("Mallformed multipart structure");
 		}
 		// Now that we have the basic request in $request, split that up again & parse it into a meaningful representation
@@ -227,7 +230,7 @@
 		$request['headers'] = array();
 		$request['postData'] = '';
 		foreach ($requestLines as $line) {
-			if (!$firstFound) {
+			if (! $firstFound) {
 				$firstFound = true;
 				$parts = explode(' ', trim($line));
 				if (count($parts) != 2) {
@@ -236,18 +239,18 @@
 				$request['method'] = strtoupper(trim($parts[0]));
 				// cut it down to an actual meaningful url without the prefix/social/rest part right away 
 				$request['url'] = substr(trim($parts[1]), strlen(Config::get('web_prefix') . '/social/rest'));
-			} elseif (!$emptyFound && !empty($line)) {
+			} elseif (! $emptyFound && ! empty($line)) {
 				// convert the key to the PHP 'CONTENT_TYPE' style naming convention.. it's ugly but consitent
 				$key = str_replace('-', '_', strtoupper(trim(substr($line, 0, strpos($line, ':')))));
 				$val = trim(substr($line, strpos($line, ':') + 1));
 				$request['headers'][$key] = $val;
-			} elseif (!$emptyFound && empty($line)) {
+			} elseif (! $emptyFound && empty($line)) {
 				$emptyFound = true;
 			} else {
 				if (get_magic_quotes_gpc()) {
 					$line = stripslashes($line);
 				}
-				$request['postData'] .= $line."\n";
+				$request['postData'] .= $line . "\n";
 			}
 		}
 		if (empty($request['method']) || empty($request['url'])) {
@@ -265,7 +268,7 @@
 		}
 		return $request;
 	}
-	
+
 	private function getResponseItem(RestRequestItem $requestItem)
 	{
 		$path = $this->getRouteFromParameter($requestItem->getUrl());
@@ -292,13 +295,13 @@
 			$class = new $class(null);
 			$response = $class->handleMethod($requestItem);
 		}
-		if ($response->getError() != null && !$this->isJsonBatchUrl() && !$this->isBatchProxyUrl()) {
+		if ($response->getError() != null && ! $this->isJsonBatchUrl() && ! $this->isBatchProxyUrl()) {
 			// Can't use http error codes in batch mode, instead we return the error code in the response item
 			$this->outputError($response);
 		}
 		return $response;
 	}
-	
+
 	private function decodeRequests($requestParam, $requestType, $format = 'json')
 	{
 		if (empty($requestParam)) {
@@ -410,7 +413,7 @@
 
 	private function getOutputFormat()
 	{
-		$output = !empty($_POST['format']) ? $_POST['format'] : (!empty($_GET['format']) ? $_GET['format'] : 'json');
+		$output = ! empty($_POST['format']) ? $_POST['format'] : (! empty($_GET['format']) ? $_GET['format'] : 'json');
 		return strtolower(trim($output));
 	}
 
@@ -424,7 +427,7 @@
 		$restParams = explode('/', $uri);
 		return $restParams;
 	}
-	
+
 	private function getRequestFormat()
 	{
 		if (isset($_SERVER['CONTENT_TYPE'])) {

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Address.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Address.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Address.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Address.php Mon Aug  4 15:12:56 2008
@@ -34,117 +34,117 @@
 	public $streetAddress;
 	public $type;
 	public $unstructuredAddress;
-	
+
 	public function __construct($unstructuredAddress)
 	{
 		$this->unstructuredAddress = $unstructuredAddress;
 	}
-	
+
 	public function getCountry()
 	{
 		return $this->country;
 	}
-	
+
 	public function setCountry($country)
 	{
 		$this->country = $country;
 	}
-	
+
 	public function getExtendedAddress()
 	{
 		return $this->extendedAddress;
 	}
-	
+
 	public function setExtendedAddress($extendedAddress)
 	{
 		$this->extendedAddress = $extendedAddress;
 	}
-	
+
 	public function getLatitude()
 	{
 		return $this->latitude;
 	}
-	
+
 	public function setLatitude($latitude)
 	{
 		$this->latitude = $latitude;
 	}
-	
+
 	public function getLocality()
 	{
 		return $this->locality;
 	}
-	
+
 	public function setLocality($locality)
 	{
 		$this->locality = $locality;
 	}
-	
+
 	public function getLongitude()
 	{
 		return $this->longitude;
 	}
-	
+
 	public function setLongitude($longitude)
 	{
 		$this->longitude = $longitude;
 	}
-	
+
 	public function getPoBox()
 	{
 		return $this->poBox;
 	}
-	
+
 	public function setPoBox($poBox)
 	{
 		$this->poBox = $poBox;
 	}
-	
+
 	public function getPostalCode()
 	{
 		return $this->postalCode;
 	}
-	
+
 	public function setPostalCode($postalCode)
 	{
 		$this->postalCode = $postalCode;
 	}
-	
+
 	public function getRegion()
 	{
 		return $this->region;
 	}
-	
+
 	public function setRegion($region)
 	{
 		$this->region = $region;
 	}
-	
+
 	public function getStreetAddress()
 	{
 		return $this->streetAddress;
 	}
-	
+
 	public function setStreetAddress($streetAddress)
 	{
 		$this->streetAddress = $streetAddress;
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;
 	}
-	
+
 	public function setType($type)
 	{
 		$this->type = $type;
 	}
-	
+
 	public function getUnstructuredAddress()
 	{
 		return $this->unstructuredAddress;
 	}
-	
+
 	public function setUnstructuredAddress($unstructuredAddress)
 	{
 		$this->unstructuredAddress = $unstructuredAddress;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/ApiCollection.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/ApiCollection.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/ApiCollection.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/ApiCollection.php Mon Aug  4 15:12:56 2008
@@ -25,39 +25,39 @@
 	public $items = array();
 	public $offset;
 	public $totalSize;
-	
+
 	public function __construct($items, $offset = false, $totalSize = false)
 	{
 		$this->items = $items;
 		$this->offset = $offset;
 		$this->totalSize = $totalSize;
 	}
-	
+
 	public function getItems()
 	{
 		return $this->items;
 	}
-	
+
 	public function setItems($items)
 	{
 		$this->items = $items;
 	}
-	
+
 	public function getOffset()
 	{
 		return $this->offset;
 	}
-	
+
 	public function setOffset($offset)
 	{
 		$this->offset = $offset;
 	}
-	
+
 	public function getTotalSize()
 	{
 		return $this->totalSize;
 	}
-	
+
 	public function setTotalSize($totalSize)
 	{
 		$this->totalSize = $totalSize;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/BodyType.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/BodyType.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/BodyType.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/BodyType.php Mon Aug  4 15:12:56 2008
@@ -28,52 +28,52 @@
 	public $hairColor;
 	public $height;
 	public $weight;
-	
+
 	public function getBuild()
 	{
 		return $this->build;
 	}
-	
+
 	public function setBuild($build)
 	{
 		$this->build = $build;
 	}
-	
+
 	public function getEyeColor()
 	{
 		return $this->eyeColor;
 	}
-	
+
 	public function setEyeColor($eyeColor)
 	{
 		$this->eyeColor = $eyeColor;
 	}
-	
+
 	public function getHairColor()
 	{
 		return $this->hairColor;
 	}
-	
+
 	public function setHairColor($hairColor)
 	{
 		$this->hairColor = $hairColor;
 	}
-	
+
 	public function getHeight()
 	{
 		return $this->height;
 	}
-	
+
 	public function setHeight($height)
 	{
 		$this->height = $height;
 	}
-	
+
 	public function getWeight()
 	{
 		return $this->weight;
 	}
-	
+
 	public function setWeight($weight)
 	{
 		$this->weight = $weight;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Email.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Email.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Email.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Email.php Mon Aug  4 15:12:56 2008
@@ -25,28 +25,28 @@
 class Email {
 	public $address;
 	public $type;
-	
+
 	public function __construct($address, $type)
 	{
 		$this->address = $address;
 		$this->type = $type;
 	}
-	
+
 	public function getAddress()
 	{
 		return $this->address;
 	}
-	
+
 	public function setAddress($address)
 	{
 		$this->address = $address;
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;
 	}
-	
+
 	public function setType($type)
 	{
 		$this->type = $type;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Enum.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Enum.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Enum.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Enum.php Mon Aug  4 15:12:56 2008
@@ -27,90 +27,66 @@
  */
 
 abstract class Enum {
-  public $displayValue;
-  public $key;
-  public $values = array();
-  
-  public function __construct($key, $displayValue = '')
-  {
-  	//FIXME should add enum restriction checking to this
-  	if (!isset($this->values[$key])) {
-  		throw new Exception("Invalid Enum key");
-  	}
-  	$this->key = $key;
-  	$this->displayValue = !empty($displayValue) ? $displayValue : $this->values[$key];
-  	unset($this->values);
-  }
-  
-  public function getDisplayValue()
-  {
-	return $this->displayValue;
-  }
-  
-  public function setDisplayValue($displayValue)
-  {
-  	$this->displayValue = $displayValue;
-  }
-  
-  public function toString()
-  {
-  	return $this->jsonString;
-  }
+	public $displayValue;
+	public $key;
+	public $values = array();
+
+	public function __construct($key, $displayValue = '')
+	{
+		//FIXME should add enum restriction checking to this
+		if (! isset($this->values[$key])) {
+			throw new Exception("Invalid Enum key");
+		}
+		$this->key = $key;
+		$this->displayValue = ! empty($displayValue) ? $displayValue : $this->values[$key];
+		unset($this->values);
+	}
+
+	public function getDisplayValue()
+	{
+		return $this->displayValue;
+	}
+
+	public function setDisplayValue($displayValue)
+	{
+		$this->displayValue = $displayValue;
+	}
+
+	public function toString()
+	{
+		return $this->jsonString;
+	}
 }
 
-
 /**
  * public Enum for opensocial.Enum.Drinker
  */
 class EnumDrinker extends Enum {
-  public $values = array (
-    'HEAVILY' => "Heavily",
-    'NO' => "No",
-    'OCCASIONALLY' => "Occasionally",
-    'QUIT' => "Quit",
-    'QUITTING' => "Quitting",
-    'REGULARLY' => "Regularly",
-    'SOCIALLY' => "Socially",
-    'YES' => "Yes"
-  );
+	public $values = array('HEAVILY' => "Heavily", 'NO' => "No", 'OCCASIONALLY' => "Occasionally", 
+			'QUIT' => "Quit", 'QUITTING' => "Quitting", 'REGULARLY' => "Regularly", 
+			'SOCIALLY' => "Socially", 'YES' => "Yes");
 }
 
 /**
  * public Enum for opensocial.Enum.Gender
  */
 class EnumGender extends Enum {
-	public $values = array (
-    	'FEMALE' => "Female",
-    	'MALE' => "Male"
-	);
+	public $values = array('FEMALE' => "Female", 'MALE' => "Male");
 }
 
 /**
  * public Enum for opensocial.Enum.Smoker
  */
 class EnumSmoker extends Enum {
-	public $values = array(
-    'HEAVILY' => "Heavily",
-    'NO' => "No",
-    'OCCASIONALLY' => "Ocasionally",
-    'QUIT' => "Quit",
-    'QUITTING' => "Quitting",
-    'REGULARLY' => "Regularly",
-    'SOCIALLY' => "Socially",
-	'YES' => "Yes"
-	);
+	public $values = array('HEAVILY' => "Heavily", 'NO' => "No", 'OCCASIONALLY' => "Ocasionally", 
+			'QUIT' => "Quit", 'QUITTING' => "Quitting", 'REGULARLY' => "Regularly", 
+			'SOCIALLY' => "Socially", 'YES' => "Yes");
 }
 
 /**
  * public Enum for opensocial.Enum.Presence
  */
 class EnumPresence extends Enum {
-	public $values = array(
-    'AWAY' => "Away",
-    'CHAT' => "Chat",
-    'DND' => "Do Not Disturb",
-    'OFFLINE' => "Offline",
-    'ONLINE' => "Online",
-    'XA' => "Extended Away"
-    );
+	public $values = array('AWAY' => "Away", 'CHAT' => "Chat", 'DND' => "Do Not Disturb", 
+			'OFFLINE' => "Offline", 'ONLINE' => "Online", 'XA' => "Extended Away");
 }

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/IdSpec.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/IdSpec.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/IdSpec.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/IdSpec.php Mon Aug  4 15:12:56 2008
@@ -33,7 +33,7 @@
 	{
 		if (! empty($jsonIdSpec) && in_array((string)$jsonIdSpec, idSpec::$types)) {
 			$idSpecEnum = (string)$jsonIdSpec;
-		} elseif (!empty($jsonIdSpec)) {
+		} elseif (! empty($jsonIdSpec)) {
 			$idSpecEnum = 'USER_IDS';
 		} else {
 			throw new Exception("The json request had a bad idSpec");
@@ -49,7 +49,7 @@
 	public function fetchUserIds()
 	{
 		$userIdArray = $this->jsonSpec;
-		if (!is_array($userIdArray)) {
+		if (! is_array($userIdArray)) {
 			$userIdArray = array($userIdArray);
 		}
 		$userIds = array();

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Message.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Message.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Message.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Message.php Mon Aug  4 15:12:56 2008
@@ -37,16 +37,15 @@
 	    /* A message to a specific user that can be seen only by that user */
 	    'PRIVATE_MESSAGE',
 	    /* A message to a specific user that can be seen by more than that user */
-	    'PUBLIC_MESSAGE'
-	);
-	
+	    'PUBLIC_MESSAGE');
+
 	public function __construct($initBody, $initTitle, $initType)
 	{
 		$this->setBody($initBody);
 		$this->setTitle($initTitle);
 		$this->setType($initType);
 	}
-	
+
 	/**
 	 * Gets the main text of the message.
 	 * @return the main text of the message
@@ -55,7 +54,7 @@
 	{
 		return $this->body;
 	}
-	
+
 	/**
 	 * Sets the main text of the message.
 	 * HTML attributes are allowed and are sanitized by the container
@@ -65,7 +64,7 @@
 	{
 		$this->body = $newBody;
 	}
-	
+
 	/**
 	 * Gets the title of the message
 	 * @return the title of the message
@@ -74,7 +73,7 @@
 	{
 		return $this->title;
 	}
-	
+
 	/**
 	 * Sets the title of the message
 	 * HTML attributes are allowed and are sanitized by the container.
@@ -84,7 +83,7 @@
 	{
 		$this->title = $newTitle;
 	}
-	
+
 	/**
 	 * Gets the type of the message, as specified by opensocial.Message.Type
 	 * @return the type of message (enum Message.Type)
@@ -93,7 +92,7 @@
 	{
 		return $this->type;
 	}
-	
+
 	/**
 	 * Sets the type of the message, as specified by opensocial.Message.Type
 	 * @param newType the type of message (enum Message.Type)
@@ -105,7 +104,7 @@
 		}
 		$this->type = $newType;
 	}
-	
+
 	/**
 	 * TODO implement either a standard 'sanitizing' facility or
 	 * define an interface that can be set on this class so

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Name.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Name.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Name.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Name.php Mon Aug  4 15:12:56 2008
@@ -29,67 +29,67 @@
 	public $honorificPrefix;
 	public $honorificSuffix;
 	public $unstructured;
-	
+
 	public function __construct($unstructured)
 	{
 		$this->unstructured = $unstructured;
 	}
-	
+
 	public function getUnstructured()
 	{
 		return $this->unstructured;
 	}
-	
+
 	public function setUnstructured($unstructured)
 	{
 		$this->unstructured = $unstructured;
 	}
-	
+
 	public function getAdditionalName()
 	{
 		return $this->additionalName;
 	}
-	
+
 	public function setAdditionalName($additionalName)
 	{
 		$this->additionalName = $additionalName;
 	}
-	
+
 	public function getFamilyName()
 	{
 		return $this->familyName;
 	}
-	
+
 	public function setFamilyName($familyName)
 	{
 		$this->familyName = $familyName;
 	}
-	
+
 	public function getGivenName()
 	{
 		return $this->givenName;
 	}
-	
+
 	public function setGivenName($givenName)
 	{
 		$this->givenName = $givenName;
 	}
-	
+
 	public function getHonorificPrefix()
 	{
 		return $this->honorificPrefix;
 	}
-	
+
 	public function setHonorificPrefix($honorificPrefix)
 	{
 		$this->honorificPrefix = $honorificPrefix;
 	}
-	
+
 	public function getHonorificSuffix()
 	{
 		return $this->honorificSuffix;
 	}
-	
+
 	public function setHonorificSuffix($honorificSuffix)
 	{
 		$this->honorificSuffix = $honorificSuffix;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Organization.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Organization.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Organization.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Organization.php Mon Aug  4 15:12:56 2008
@@ -33,102 +33,102 @@
 	public $subField;
 	public $title;
 	public $webpage;
-	
+
 	public function getAddress()
 	{
 		return $this->address;
 	}
-	
+
 	public function setAddress($address)
 	{
 		$this->address = $address;
 	}
-	
+
 	public function getDescription()
 	{
 		return $this->description;
 	}
-	
+
 	public function setDescription($description)
 	{
 		$this->description = $description;
 	}
-	
+
 	public function getEndDate()
 	{
 		return $this->endDate;
 	}
-	
+
 	public function setEndDate($endDate)
 	{
 		$this->endDate = $endDate;
 	}
-	
+
 	public function getField()
 	{
 		return $this->field;
 	}
-	
+
 	public function setField($field)
 	{
 		$this->field = $field;
 	}
-	
+
 	public function getName()
 	{
 		return $this->name;
 	}
-	
+
 	public function setName($name)
 	{
 		$this->name = $name;
 	}
-	
+
 	public function getSalary()
 	{
 		return $this->salary;
 	}
-	
+
 	public function setSalary($salary)
 	{
 		$this->salary = $salary;
 	}
-	
+
 	public function getStartDate()
 	{
 		return $this->startDate;
 	}
-	
+
 	public function setStartDate($startDate)
 	{
 		$this->startDate = $startDate;
 	}
-	
+
 	public function getSubField()
 	{
 		return $this->subField;
 	}
-	
+
 	public function setSubField($subField)
 	{
 		$this->subField = $subField;
 	}
-	
+
 	public function getTitle()
 	{
 		return $this->title;
 	}
-	
+
 	public function setTitle($title)
 	{
 		$this->title = $title;
 	}
-	
+
 	public function getWebpage()
 	{
 		return $this->webpage;
 	}
-	
+
 	public function setWebpage($webpage)
 	{
 		$this->webpage = $webpage;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Person.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Person.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Person.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Person.php Mon Aug  4 15:12:56 2008
@@ -82,198 +82,198 @@
 	// Note: Not in the opensocial js person object directly
 	public $isOwner = false;
 	public $isViewer = false;
-	
+
 	public function __construct($id, $name)
 	{
 		$this->id = $id;
 		$this->name = $name;
 	}
-	
+
 	public function getAboutMe()
 	{
 		return $this->aboutMe;
 	}
-	
+
 	public function setAboutMe($aboutMe)
 	{
 		$this->aboutMe = $aboutMe;
 	}
-	
+
 	public function getActivities()
 	{
 		return $this->activities;
 	}
-	
+
 	public function setActivities($activities)
 	{
 		$this->activities = $activities;
 	}
-	
+
 	public function getAddresses()
 	{
 		return $this->addresses;
 	}
-	
+
 	public function setAddresses($addresses)
 	{
 		$this->addresses = $addresses;
 	}
-	
+
 	public function getAge()
 	{
 		return $this->age;
 	}
-	
+
 	public function setAge($age)
 	{
 		$this->age = $age;
 	}
-	
+
 	public function getBodyType()
 	{
 		return $this->bodyType;
 	}
-	
+
 	public function setBodyType($bodyType)
 	{
 		$this->bodyType = $bodyType;
 	}
-	
+
 	public function getBooks()
 	{
 		return $this->books;
 	}
-	
+
 	public function setBooks($books)
 	{
 		$this->books = $books;
 	}
-	
+
 	public function getCars()
 	{
 		return $this->cars;
 	}
-	
+
 	public function setCars($cars)
 	{
 		$this->cars = $cars;
 	}
-	
+
 	public function getChildren()
 	{
 		return $this->children;
 	}
-	
+
 	public function setChildren($children)
 	{
 		$this->children = $children;
 	}
-	
+
 	public function getCurrentLocation()
 	{
 		return $this->currentLocation;
 	}
-	
+
 	public function setCurrentLocation($currentLocation)
 	{
 		$this->currentLocation = $currentLocation;
 	}
-	
+
 	public function getDateOfBirth()
 	{
 		return $this->dateOfBirth;
 	}
-	
+
 	public function setDateOfBirth($dateOfBirth)
 	{
 		$this->dateOfBirth = $dateOfBirth;
 	}
-	
+
 	public function getDrinker()
 	{
 		return $this->drinker;
 	}
-	
+
 	public function setDrinker($newDrinker)
 	{
 		$this->drinker = new EnumDrinker($newDrinker);
 	}
-	
+
 	public function getEmails()
 	{
 		return $this->emails;
 	}
-	
+
 	public function setEmails($emails)
 	{
 		$this->emails = $emails;
 	}
-	
+
 	public function getEthnicity()
 	{
 		return $this->ethnicity;
 	}
-	
+
 	public function setEthnicity($ethnicity)
 	{
 		$this->ethnicity = $ethnicity;
 	}
-	
+
 	public function getFashion()
 	{
 		return $this->fashion;
 	}
-	
+
 	public function setFashion($fashion)
 	{
 		$this->fashion = $fashion;
 	}
-	
+
 	public function getFood()
 	{
 		return $this->food;
 	}
-	
+
 	public function setFood($food)
 	{
 		$this->food = $food;
 	}
-	
+
 	public function getGender()
 	{
 		return $this->gender;
 	}
-	
+
 	public function setGender($newGender)
 	{
 		$this->gender = new EnumGender($newGender);
 	}
-	
+
 	public function getHappiestWhen()
 	{
 		return $this->happiestWhen;
 	}
-	
+
 	public function setHappiestWhen($happiestWhen)
 	{
 		$this->happiestWhen = $happiestWhen;
 	}
-	
+
 	public function getHeroes()
 	{
 		return $this->heroes;
 	}
-	
+
 	public function setHeroes($heroes)
 	{
 		$this->heroes = $heroes;
 	}
-	
+
 	public function getHasApp()
 	{
 		return $this->hasApp;
 	}
-	
+
 	public function setHasApp($hasApp)
 	{
 		$this->hasApp = $hasApp;
@@ -283,117 +283,117 @@
 	{
 		return $this->humor;
 	}
-	
+
 	public function setHumor($humor)
 	{
 		$this->humor = $humor;
 	}
-	
+
 	public function getId()
 	{
 		return $this->id;
 	}
-	
+
 	public function setId($id)
 	{
 		$this->id = $id;
 	}
-	
+
 	public function getInterests()
 	{
 		return $this->interests;
 	}
-	
+
 	public function setInterests($interests)
 	{
 		$this->interests = $interests;
 	}
-	
+
 	public function getJobInterests()
 	{
 		return $this->jobInterests;
 	}
-	
+
 	public function setJobInterests($jobInterests)
 	{
 		$this->jobInterests = $jobInterests;
 	}
-	
+
 	public function getJobs()
 	{
 		return $this->jobs;
 	}
-	
+
 	public function setJobs($jobs)
 	{
 		$this->jobs = $jobs;
 	}
-	
+
 	public function getLanguagesSpoken()
 	{
 		return $this->languagesSpoken;
 	}
-	
+
 	public function setLanguagesSpoken($languagesSpoken)
 	{
 		$this->languagesSpoken = $languagesSpoken;
 	}
-	
+
 	public function getLivingArrangement()
 	{
 		return $this->livingArrangement;
 	}
-	
+
 	public function setLivingArrangement($livingArrangement)
 	{
 		$this->livingArrangement = $livingArrangement;
 	}
-	
+
 	public function getLookingFor()
 	{
 		return $this->lookingFor;
 	}
-	
+
 	public function setLookingFor($lookingFor)
 	{
 		$this->lookingFor = $lookingFor;
 	}
-	
+
 	public function getMovies()
 	{
 		return $this->movies;
 	}
-	
+
 	public function setMovies($movies)
 	{
 		$this->movies = $movies;
 	}
-	
+
 	public function getMusic()
 	{
 		return $this->music;
 	}
-	
+
 	public function setMusic($music)
 	{
 		$this->music = $music;
 	}
-	
+
 	public function getName()
 	{
 		return $this->name;
 	}
-	
+
 	public function setName($name)
 	{
 		$this->name = $name;
 	}
-	
+
 	public function getNetworkPresence()
 	{
 		return $this->networkPresence;
 	}
-	
+
 	public function setNetworkPresence($networkPresence)
 	{
 		$this->networkPresence = new EnumPresence($networkPresence);
@@ -403,258 +403,257 @@
 	{
 		return $this->nickname;
 	}
-	
+
 	public function setNickname($nickname)
 	{
 		$this->nickname = $nickname;
 	}
-	
+
 	public function getPets()
 	{
 		return $this->pets;
 	}
-	
+
 	public function setPets($pets)
 	{
 		$this->pets = $pets;
 	}
-	
+
 	public function getPhoneNumbers()
 	{
 		return $this->phoneNumbers;
 	}
-	
+
 	public function setPhoneNumbers($phoneNumbers)
 	{
 		$this->phoneNumbers = $phoneNumbers;
 	}
-	
+
 	public function getPoliticalViews()
 	{
 		return $this->politicalViews;
 	}
-	
+
 	public function setPoliticalViews($politicalViews)
 	{
 		$this->politicalViews = $politicalViews;
 	}
-	
+
 	public function getProfileSong()
 	{
 		return $this->profileSong;
 	}
-	
+
 	public function setProfileSong($profileSong)
 	{
 		$this->profileSong = $profileSong;
 	}
-	
+
 	public function getProfileUrl()
 	{
 		return $this->profileUrl;
 	}
-	
+
 	public function setProfileUrl($profileUrl)
 	{
 		$this->profileUrl = $profileUrl;
 	}
-	
+
 	public function getProfileVideo()
 	{
 		return $this->profileVideo;
 	}
-	
+
 	public function setProfileVideo($profileVideo)
 	{
 		$this->profileVideo = $profileVideo;
 	}
-	
+
 	public function getQuotes()
 	{
 		return $this->quotes;
 	}
-	
+
 	public function setQuotes($quotes)
 	{
 		$this->quotes = $quotes;
 	}
-	
+
 	public function getRelationshipStatus()
 	{
 		return $this->relationshipStatus;
 	}
-	
+
 	public function setRelationshipStatus($relationshipStatus)
 	{
 		$this->relationshipStatus = $relationshipStatus;
 	}
-	
+
 	public function getReligion()
 	{
 		return $this->religion;
 	}
-	
+
 	public function setReligion($religion)
 	{
 		$this->religion = $religion;
 	}
-	
+
 	public function getRomance()
 	{
 		return $this->romance;
 	}
-	
+
 	public function setRomance($romance)
 	{
 		$this->romance = $romance;
 	}
-	
+
 	public function getScaredOf()
 	{
 		return $this->scaredOf;
 	}
-	
+
 	public function setScaredOf($scaredOf)
 	{
 		$this->scaredOf = $scaredOf;
 	}
-	
+
 	public function getSchools()
 	{
 		return $this->schools;
 	}
-	
+
 	public function setSchools($schools)
 	{
 		$this->schools = $schools;
 	}
-	
+
 	public function getSexualOrientation()
 	{
 		return $this->sexualOrientation;
 	}
-	
+
 	public function setSexualOrientation($sexualOrientation)
 	{
 		$this->sexualOrientation = $sexualOrientation;
 	}
-	
+
 	public function getSmoker()
 	{
 		return $this->smoker;
 	}
-	
+
 	public function setSmoker($newSmoker)
 	{
 		$this->smoker = new EnumSmoker($newSmoker);
 	}
-	
+
 	public function getSports()
 	{
 		return $this->sports;
 	}
-	
+
 	public function setSports($sports)
 	{
 		$this->sports = $sports;
 	}
-	
+
 	public function getStatus()
 	{
 		return $this->status;
 	}
-	
+
 	public function setStatus($status)
 	{
 		$this->status = $status;
 	}
-	
+
 	public function getTags()
 	{
 		return $this->tags;
 	}
-	
+
 	public function setTags($tags)
 	{
 		$this->tags = $tags;
 	}
-	
+
 	public function getThumbnailUrl()
 	{
 		return $this->thumbnailUrl;
 	}
-	
+
 	public function setThumbnailUrl($thumbnailUrl)
 	{
 		$this->thumbnailUrl = $thumbnailUrl;
 	}
-	
+
 	public function getTimeZone()
 	{
 		return $this->timeZone;
 	}
-	
+
 	public function setTimeZone($timeZone)
 	{
 		$this->timeZone = $timeZone;
 	}
-	
+
 	public function getTurnOffs()
 	{
 		return $this->turnOffs;
 	}
-	
+
 	public function setTurnOffs($turnOffs)
 	{
 		$this->turnOffs = $turnOffs;
 	}
-	
+
 	public function getTurnOns()
 	{
 		return $this->turnOns;
 	}
-	
+
 	public function setTurnOns($turnOns)
 	{
 		$this->turnOns = $turnOns;
 	}
-	
+
 	public function getTvShows()
 	{
 		return $this->tvShows;
 	}
-	
+
 	public function setTvShows($tvShows)
 	{
 		$this->tvShows = $tvShows;
 	}
-	
+
 	public function getUrls()
 	{
 		return $this->urls;
 	}
-	
+
 	public function setUrls($urls)
 	{
 		$this->urls = $urls;
 	}
-	
-	
+
 	public function getIsOwner()
 	{
 		return $this->isOwner;
 	}
-	
+
 	public function setIsOwner($isOwner)
 	{
 		$this->isOwner = $isOwner;
 	}
-	
+
 	public function getIsViewer()
 	{
 		return $this->isViewer;
 	}
-	
+
 	public function setIsViewer($isViewer)
 	{
 		$this->isViewer = $isViewer;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Phone.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Phone.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Phone.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Phone.php Mon Aug  4 15:12:56 2008
@@ -25,28 +25,28 @@
 class Phone {
 	public $number;
 	public $type;
-	
+
 	public function __construct($number, $type)
 	{
 		$this->number = $number;
 		$this->type = $type;
 	}
-	
+
 	public function getNumber()
 	{
 		return $this->number;
 	}
-	
+
 	public function setNumber($number)
 	{
 		$this->number = $number;
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;
 	}
-	
+
 	public function setType($type)
 	{
 		$this->type = $type;

Modified: incubator/shindig/trunk/php/src/social-api/opensocial/model/Url.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Url.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Url.php (original)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Url.php Mon Aug  4 15:12:56 2008
@@ -25,39 +25,39 @@
 	public $address;
 	public $linkText;
 	public $type;
-	
+
 	public function __construct($address, $linkText, $type)
 	{
 		$this->address = $address;
 		$this->linkText = $linkText;
 		$this->type = $type;
 	}
-	
+
 	public function getAddress()
 	{
 		return $this->address;
 	}
-	
+
 	public function setAddress($address)
 	{
 		$this->address = $address;
 	}
-	
+
 	public function getLinkText()
 	{
 		return $this->linkText;
 	}
-	
+
 	public function setLinkText($linkText)
 	{
 		$this->linkText = $linkText;
 	}
-	
+
 	public function getType()
 	{
 		return $this->type;
 	}
-	
+
 	public function setType($type)
 	{
 		$this->type = $type;

Modified: incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicActivitiesService.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicActivitiesService.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicActivitiesService.php (original)
+++ incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicActivitiesService.php Mon Aug  4 15:12:56 2008
@@ -33,7 +33,7 @@
 		}
 		return new ResponseItem(NOT_FOUND, "Activity not found", null);
 	}
-	
+
 	public function getActivities(UserId $userId, $groupId, $first, $max, SecurityToken $token)
 	{
 		$ids = array();
@@ -41,16 +41,16 @@
 		switch ($type) {
 			case 'all':
 			case 'friends':
-        		$friendIds = XmlStateFileFetcher::get()->getFriendIds();
-        		$friendIds = isset($friendIds[$userId->getUserId($token)]) ? $friendIds[$userId->getUserId($token)] : null;
+				$friendIds = XmlStateFileFetcher::get()->getFriendIds();
+				$friendIds = isset($friendIds[$userId->getUserId($token)]) ? $friendIds[$userId->getUserId($token)] : null;
 				if ($friendIds != null) {
 					$ids = $friendIds;
 				}
 				break;
 			case 'self':
-        		$ids[] = $userId->getUserId($token);
-        		break;
-    	}
+				$ids[] = $userId->getUserId($token);
+				break;
+		}
 		$allActivities = XmlStateFileFetcher::get()->getActivities();
 		$activities = array();
 		foreach ($ids as $id) {

Modified: incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicAppDataService.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicAppDataService.php?rev=682527&r1=682526&r2=682527&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicAppDataService.php (original)
+++ incubator/shindig/trunk/php/src/social-api/samplecontainer/BasicAppDataService.php Mon Aug  4 15:12:56 2008
@@ -19,7 +19,6 @@
 
 class BasicAppDataService extends AppDataService {
 
-	
 	public function deletePersonData(UserId $userId, GroupId $groupId, $fields, $appId, SecurityToken $token)
 	{
 		foreach ($fields as $key) {
@@ -27,25 +26,25 @@
 				return new ResponseItem(BAD_REQUEST, "The person app data key had invalid characters", null);
 			}
 		}
-		switch($groupId->getType()) {
+		switch ($groupId->getType()) {
 			case 'self':
 				foreach ($fields as $key) {
-					XmlStateFileFetcher::get()->deleteAppData($userId->getUserId($token), $key);	
+					XmlStateFileFetcher::get()->deleteAppData($userId->getUserId($token), $key);
 				}
 				break;
 			default:
-				return new ResponseItem(NOT_IMPLEMENTED, "We don't support deleting data in batches yet", null);		
+				return new ResponseItem(NOT_IMPLEMENTED, "We don't support deleting data in batches yet", null);
 				break;
 		}
 		return new ResponseItem(null, null, array());
 	}
-	
+
 	public function getPersonData(UserId $userId, GroupId $groupId, $fields, $appId, SecurityToken $token)
 	{
 		$allData = XmlStateFileFetcher::get()->getAppData();
 		$data = array();
 		$ids = array();
-		switch($groupId->getType()) {
+		switch ($groupId->getType()) {
 			case 'self':
 				$ids[] = $userId->getUserId($token);
 				break;
@@ -57,7 +56,7 @@
 				}
 				break;
 			default:
-				return new ResponseItem(NOT_IMPLEMENTED, "We don't support fetching data in batches yet", null);		
+				return new ResponseItem(NOT_IMPLEMENTED, "We don't support fetching data in batches yet", null);
 				break;
 		}
 		foreach ($ids as $id) {
@@ -80,17 +79,17 @@
 		foreach ($fields as $key) {
 			if (! BasicAppDataService::isValidKey($key)) {
 				return new ResponseItem(BAD_REQUEST, "The person app data key had invalid characters", null);
-			}			
+			}
 		}
-		switch($groupId->getType()) {
+		switch ($groupId->getType()) {
 			case 'self':
 				foreach ($fields as $key) {
 					$value = isset($values[$key]) ? @$values[$key] : null;
-					XmlStateFileFetcher::get()->setAppData($userId->getUserId($token), $key, $value);	
+					XmlStateFileFetcher::get()->setAppData($userId->getUserId($token), $key, $value);
 				}
 				break;
 			default:
-				return new ResponseItem(NOT_IMPLEMENTED, "We don't support updating data in batches yet", null);		
+				return new ResponseItem(NOT_IMPLEMENTED, "We don't support updating data in batches yet", null);
 				break;
 		}
 		return new ResponseItem(null, null, array());