You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2016/10/24 13:06:09 UTC

[24/83] [abbrv] usergrid git commit: Moving older SDKs to a difference location and updating main README to link to new SDK locations.

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php/lib/vendor/Apache/Usergrid/Notification.php
----------------------------------------------------------------------
diff --git a/sdks/other/php/lib/vendor/Apache/Usergrid/Notification.php b/sdks/other/php/lib/vendor/Apache/Usergrid/Notification.php
new file mode 100755
index 0000000..53bc506
--- /dev/null
+++ b/sdks/other/php/lib/vendor/Apache/Usergrid/Notification.php
@@ -0,0 +1,103 @@
+#!/usr/bin/env php
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Notification - a data structure to hold all notification-related parameters
+ *
+ * @author Rod Simpson <ro...@apigee.com>
+ * @since 09-Mar-2013
+ */
+
+namespace Apache\Usergrid;
+
+define('DEVICES', 'DEVICES');
+define('GROUPS', 'GROUPS');
+define('USERS', 'USERS');
+
+class Notification extends Response {
+  private $message = '';
+  private $notifier_name;
+  private $delivery_time = 0;
+  private $recipients_list = array();
+  private $recipient_type = DEVICES;
+  private $errors = array();
+
+  public function __construct($message = '', $notifier_name = '', $delivery_time = 0, $recipients_list = array(), $recipient_type = DEVICES) {
+    $this->message = $message;
+    $this->notifier_name = $notifier_name;
+    $this->delivery_time = $delivery_time;
+    $this->recipients_list = $recipients_list;
+    $this->recipient_type = $recipient_type;
+  }
+
+  public function set_message($in) {
+    $this->message = $in;
+  }
+
+  public function get_message() {
+    return $this->message;
+  }
+
+  public function set_notifier_name($in) {
+    $this->notifier_name = $in;
+  }
+
+  public function get_notifier_name() {
+    return $this->notifier_name;
+  }
+
+  public function set_delivery_time($in) {
+    $this->delivery_time = $in;
+  }
+
+  public function get_delivery_time() {
+    return $this->delivery_time;
+  }
+
+  public function set_recipients_list($in) {
+    $this->recipients_list = $in;
+  }
+
+  public function get_recipients_list() {
+    return $this->recipients_list;
+  }
+
+  public function set_recipient_type($in) {
+    $this->recipient_type = $in;
+  }
+
+  public function get_recipient_type() {
+    return $this->recipient_type;
+  }
+
+  public function log_error($in) {
+    $this->errors[] = $in;
+  }
+
+  public function errors() {
+    return (count($this->errors) > 0);
+  }
+
+  public function get_error_array() {
+    return $this->errors;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php/lib/vendor/Apache/Usergrid/Request.php
----------------------------------------------------------------------
diff --git a/sdks/other/php/lib/vendor/Apache/Usergrid/Request.php b/sdks/other/php/lib/vendor/Apache/Usergrid/Request.php
new file mode 100755
index 0000000..85890e6
--- /dev/null
+++ b/sdks/other/php/lib/vendor/Apache/Usergrid/Request.php
@@ -0,0 +1,174 @@
+#!/usr/bin/env php
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+* @file
+* Request - a data structure to hold all request-related parameters
+*
+* @author Rod Simpson <ro...@apigee.com>
+* @since 26-Apr-2013
+*/
+
+namespace Apache\Usergrid;
+
+require_once (dirname(__FILE__) . '/Exceptions.php');
+
+
+class Request {
+  /**
+   * @var string
+   */
+  private $method;
+  /**
+   * @var string
+   */
+  private $endpoint;
+  /**
+   * @var array
+   */
+  private $query_string_array; //an array of key value pairs to be appended as the query string
+  /**
+   * @var array
+   */
+  private $body;
+  /**
+   * @var bool
+   */
+  private $management_query;
+
+  /**
+   * Constructor for Request object
+   *
+   * @param string $method
+   * @param string $endpoint
+   * @param array $query_string_array
+   * @param array $body
+   * @param bool $management_query
+   */
+  public function __construct($method = 'GET', $endpoint = '', $query_string_array = array(), $body = array(), $management_query=FALSE) {
+		$this->method = $method;
+		$this->endpoint = $endpoint;
+		$this->query_string_array = $query_string_array;
+		$this->body = $body;
+		$this->management_query = $management_query;
+  }
+
+  /**
+   * Sets (and validates) the HTTP method.
+   *
+   * @param string $http_method
+   * @throws UGException
+   */
+  public function set_method($http_method){
+    if ($http_method !== 'GET' && $http_method !== 'POST' && $http_method !== 'PUT' && $http_method !== 'DELETE') {
+      throw new UGException("Unknown HTTP method type $http_method");
+    }
+    $this->method = $http_method;
+  }
+
+  /**
+   * Gets the HTTP method (GET, POST, PUT or DELETE)
+   *
+   * @return string
+   */
+  public function get_method(){
+    return $this->method;
+  }
+
+  /**
+   * Sets the endpoint base URL.
+   *
+   * @param $endpoint
+   */
+  public function set_endpoint($endpoint){
+    $this->endpoint = $endpoint;
+  }
+  /**
+   * Returns the endpoint base URL.
+   *
+   * @return string
+   */
+  public function get_endpoint(){
+    return $this->endpoint;
+  }
+
+  /**
+   * Sets the query-string array. This should be an associative key-value hash.
+   *
+   * @param array $in
+   */
+  public function set_query_string_array($key_value_pairs) {
+    if (!is_array($key_value_pairs)) {
+      throw new UGException('Request->query_string_array must be an array.');
+    }
+    $this->query_string_array = $key_value_pairs;
+  }
+  /**
+   * Returns the key-value associative array of query string values.
+   *
+   * @return array
+   */
+  public function get_query_string_array(){
+    return $this->query_string_array;
+  }
+
+  /**
+   * Sets the body array. This should be an array structure representing
+   * parameters sent via PUT/POST.
+   *
+   * @param array $body
+   */
+  public function set_body($body){
+    if (!is_array($body)) {
+      throw new UGException('Request->body must be an array.');
+    }
+    $this->body = $body;
+  }
+
+  /**
+   * Returns the body array.
+   *
+   * @return array
+   */
+  public function get_body(){
+    return $this->body;
+  }
+
+  /**
+   * Sets the boolean flag indicating whether this is a "management query" or
+   * not.
+   *
+   * @param bool $in
+   */
+  public function set_management_query($in){
+    //ensure we have a bool
+    $this->management_query = (bool)$in;
+  }
+
+  /**
+   * Returns flag indicating whether this is a "management query".
+   *
+   * @return bool
+   */
+  public function get_management_query(){
+    return $this->management_query;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php/lib/vendor/Apache/Usergrid/Response.php
----------------------------------------------------------------------
diff --git a/sdks/other/php/lib/vendor/Apache/Usergrid/Response.php b/sdks/other/php/lib/vendor/Apache/Usergrid/Response.php
new file mode 100755
index 0000000..39467b7
--- /dev/null
+++ b/sdks/other/php/lib/vendor/Apache/Usergrid/Response.php
@@ -0,0 +1,90 @@
+#!/usr/bin/env php
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file
+ * Response - a data structure to hold all response-related parameters
+ *
+ * @author Rod Simpson <ro...@apigee.com>
+ * @since 26-Apr-2013
+ */
+
+namespace Apache\Usergrid;
+
+
+class Response extends Request{
+  private $data = array();
+  private $json = '';
+  private $curl_meta = array();
+  private $error = FALSE;
+  private $error_code = '';
+  private $error_message = '';
+
+  public function __construct($data = array(), $curl_meta = array(), $error = FALSE, $error_code = '', $error_message = '', $json = '') {
+		$this->data = $data;
+		$this->json = $json;
+		$this->curl_meta = $curl_meta;
+		$this->error = $error;
+		$this->set_error_code = $error_code;
+		$this->error_message = $error_message;
+  }
+
+  public function set_data($in){
+    $this->data = $in;
+  }
+  public function get_data(){
+    return $this->data;
+  }
+
+  public function set_json($in){
+    $this->json = $in;
+  }
+  public function get_json(){
+    return $this->json;
+  }
+
+  public function set_curl_meta($in){
+    $this->curl_meta = $in;
+  }
+  public function get_curl_meta(){
+    return $this->curl_meta;
+  }
+
+  public function set_error($in){
+    $this->error = $in;
+  }
+  public function get_error(){
+    return $this->error;
+  }
+
+  public function set_error_code($in){
+    $this->error_code = $in;
+  }
+  public function get_error_code(){
+    return $this->error_code;
+  }
+
+  public function set_error_message($in){
+    $this->error_message = $in;
+  }
+  public function get_error_message(){
+    return $this->error_message;
+  }
+}

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php/tests/autoloader.inc.php
----------------------------------------------------------------------
diff --git a/sdks/other/php/tests/autoloader.inc.php b/sdks/other/php/tests/autoloader.inc.php
new file mode 100644
index 0000000..3793355
--- /dev/null
+++ b/sdks/other/php/tests/autoloader.inc.php
@@ -0,0 +1,36 @@
+#!/usr/bin/env php
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+function usergrid_autoload($class) {
+
+
+  if (strpos($class, '\\') !== FALSE) {
+    $path_parts = explode('\\', $class);
+    if ($path_parts[0] == 'Apache') {
+      $lib_path = realpath(dirname(__FILE__) . '/../lib/vendor');
+      $class_path = $lib_path . '/' . join('/', $path_parts) . '.php';
+      if (file_exists($class_path)) {
+        require_once($class_path);
+      }
+    }
+  }
+}
+
+spl_autoload_register('usergrid_autoload');

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/.gitignore
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/.gitignore b/sdks/other/php5/apache-usergrid/.gitignore
new file mode 100644
index 0000000..61ba991
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/.gitignore
@@ -0,0 +1,12 @@
+# Created by .gitignore support plugin (hsz.mobi)
+### Composer template
+composer.phar
+vendor/
+
+# dot env files
+.env.php
+.evn.*.php
+
+# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+# composer.lock

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/attrubites/attributes.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/attrubites/attributes.php b/sdks/other/php5/apache-usergrid/Examples/attrubites/attributes.php
new file mode 100644
index 0000000..0f4f180
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/attrubites/attributes.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+/**
+ * Attributes are a new feature that make getting related models easy as accessing a property on a model object
+ * The way relationships work before this feature it required you to call the getRelationship method on the application
+ * service which is still available, so for example you would first get the user then once you had the user you create a
+ * array that contained the uuid of the user the related collection name and the relationship name then call the api passing in the
+ * array but for the default relationships we already have the data that we need to make the api call so that is what
+ * I've done.
+ * <pre>
+ * <?php
+ *  $user = Usergrid::users()->findById(['uuid' => '1234abcd']) ;
+ *  $device = $user->device;
+ * ?>
+ * </pre>
+ *  That's all you need to do to get a device for the user this only works when you have one user in your user collection
+ *  if you call this with more then one user in your user collection it will return the device for the first user in the
+ *  collection.
+ *
+ */
+
+$user = Usergrid::users()->findById(['uuid' => '1234abcd']);
+
+echo "device" . PHP_EOL;
+var_dump($user->device);
+var_dump('=================================================================');
+
+echo "roles" . PHP_EOL;
+var_dump($user->roles);
+var_dump('=================================================================');
+
+echo "groups" . PHP_EOL;
+var_dump($user->groups);
+var_dump('=================================================================');
+
+echo "connections" . PHP_EOL;
+var_dump($user->connections);
+var_dump('=================================================================');
+
+
+var_dump('=================================================================');
+echo "GROUPS" . PHP_EOL;
+var_dump('=================================================================');
+
+
+$group = Usergrid::groups()->findById(['uuid' => '121212']);
+
+
+echo "roles" . PHP_EOL;
+var_dump($group->roles);
+var_dump('=================================================================');
+
+echo "groups" . PHP_EOL;
+var_dump($group->users);
+var_dump('=================================================================');
+
+echo "connections" . PHP_EOL;
+var_dump($group->connections);
+var_dump('=================================================================');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/collections/books.php b/sdks/other/php5/apache-usergrid/Examples/collections/books.php
new file mode 100644
index 0000000..034046e
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/collections/books.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Api\Filters\Date;
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+foreach ($books_data as $book) {
+    Usergrid::application()->EntityJsonPost($book);
+}
+
+
+$books = Usergrid::application()->EntityGet(['collection' => 'books', 'limit' => 25]);
+
+
+// get result count just call the Illuminate\Support\Collection  count method
+var_dump($books->entities->count());
+
+
+// As responses are model object you can treat them like a assoc arrays
+var_dump($books->entities[0]['uuid']);
+
+// if you like a more object orientated way then use the Collection Class methods
+
+// get all uuid
+var_dump($books->entities->fetch('uuid'));
+
+//get first uuid
+var_dump($books->entities->fetch('uuid')->first());
+
+// get first item in collection -- this is the first item in my response php collection not the Usergrid Collection (table).
+var_dump($books->entities->first());
+
+// get last item in collection -- this is the last item in my response php collection not the Usergrid Collection (table).
+var_dump($books->entities->last());
+
+// convert created date to string
+var_dump(Date::convert($books->entities->fetch('created')->first()));
+
+// Illuminate\Support\Collection class support all advanced collection methods
+
+// pop last item off collection
+$book = $books->entities->pop();
+
+// Converting methods
+$json_ = $books->entities->toJson();
+
+//Convert the object into something JSON serializable.
+$books->entities->jsonSerialize();
+
+// Get an iterator for the items in collection
+$iterator = $books->entities->getIterator();
+
+//Get a CachingIterator instance
+$caching_iterator = $books->entities->getCachingIterator();
+
+/// Here are some more Methods that you can call on your responses .. To get the most out of this SDK please look at the Illuminate\Support\Collection class
+/// which is the supper class of Apache/Usergrid/Api/Models/BaseCollection class
+/**
+ * $books->unique();
+ * $books->transform();
+ * $books->take();
+ * $books->splice();
+ * $books->sum($callback );
+ * $books->values();
+ * $books->sortByDesc($callback);
+ * $books->sortBy();
+ * $books->shuffle();
+ * $books->chunk();
+ */
+

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/collections/data.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/collections/data.php b/sdks/other/php5/apache-usergrid/Examples/collections/data.php
new file mode 100644
index 0000000..e9ca805
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/collections/data.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$books_data = [
+    ['collection' => 'books', 'title' => 'book one', 'name' => 'book_one', 'author' => 'author 1'],
+    ['collection' => 'books', 'title' => 'book two', 'name' => 'book_two', 'author' => 'author 2'],
+    ['collection' => 'books', 'title' => 'book three', 'name' => 'book_three', 'author' => 'author 3'],
+    ['collection' => 'books', 'title' => 'book four', 'name' => 'book_four', 'author' => 'author 4'],
+    ['collection' => 'books', 'title' => 'book five', 'name' => 'book_five', 'author' => 'author 5'],
+    ['collection' => 'books', 'title' => 'book six', 'name' => 'book_six', 'author' => 'author 6'],
+    ['collection' => 'books', 'title' => 'book seven', 'name' => 'book_seven', 'author' => 'author 7'],
+    ['collection' => 'books', 'title' => 'book eight', 'name' => 'book_eight', 'author' => 'author 8'],
+    ['collection' => 'books', 'title' => 'book nine', 'name' => 'book_nine', 'author' => 'author 9'],
+    ['collection' => 'books', 'title' => 'book ten', 'name' => 'book_ten', 'author' => 'author 10'],
+    ['collection' => 'books', 'title' => 'book eleven', 'name' => 'book_eleven', 'author' => 'author 11'],
+    ['collection' => 'books', 'title' => 'book twelve', 'name' => 'book_twelve', 'author' => 'author 12'],
+    ['collection' => 'books', 'title' => 'book thirteen', 'name' => 'book_thirteen', 'author' => 'author 13'],
+    ['collection' => 'books', 'title' => 'book fourteen', 'name' => 'book_fourteen', 'author' => 'author 14'],
+    ['collection' => 'books', 'title' => 'book fifteen', 'name' => 'book_fifteen', 'author' => 'author 15'],
+    ['collection' => 'books', 'title' => 'book sixteen', 'name' => 'book_sixteen', 'author' => 'author 16'],
+    ['collection' => 'books', 'title' => 'book seventeen', 'name' => 'book_seventeen', 'author' => 'author 17'],
+    ['collection' => 'books', 'title' => 'book eighteen', 'name' => 'book_eighteen', 'author' => 'author 18'],
+    ['collection' => 'books', 'title' => 'book nineteen', 'name' => 'book_nineteen', 'author' => 'author 19'],
+    ['collection' => 'books', 'title' => 'book twenty', 'name' => 'book_twenty', 'author' => 'author 20'],
+];

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/collections/users.php b/sdks/other/php5/apache-usergrid/Examples/collections/users.php
new file mode 100644
index 0000000..da67ac3
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/collections/users.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/** The PHP SDK returns all responses as Illuminate\Support\Collection subclasses so the word collection below is php collection class not usergrid collection */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+// call user by page size 20
+$users_paged = Usergrid::users()->all();
+var_dump(get_class($users_paged->entities));
+
+//// get user 50 page size
+$users_paged_50 = Usergrid::users()->all(['limit' => 50]);
+var_dump($users_paged_50->entities);
+
+// get all users
+$all_users = Usergrid::usersIterator();
+foreach ($all_users as $user) {
+//    var_dump($user['uuid']); // as array
+}
+
+// find user by query
+$find_user_by_query = Usergrid::users()->find(['ql' => "select * where email='jason@apps4u.com.au'"]);
+var_dump($find_user_by_query->entities->fetch('uuid'));
+
+$find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query->entities->fetch('uuid')->first()]);
+var_dump($find_user_by_uuid->entities);
+
+
+// AS all results as PHP Collections and the entities property is always returned as a PHP Collection you can fetch nested records
+$user_addr = Usergrid::users()->findById(['uuid' => 'Jason']);
+echo $user_addr->entities->fetch('adr.addr1');
+//or
+echo $user_addr->entities->fetch('adr.city');
+
+// get users device URL -- nested fetch on php collection
+$users_nested = Usergrid::users()->all();
+var_dump($users_nested->entities->fetch('metadata.collections.devices')->first());
+
+// The response that is returned is a PHP collection that has a Zero indexed $item property.
+// but as its a collection class it has some methods that can help you find what you need and one
+// of my fav feature is changing the Zero indexed collection to be indexed by the entity uuid or name or any other property.
+$users_by = Usergrid::users()->all();
+
+$users_by_uuid = $users_by->entities->keyBy('uuid');
+var_dump($users_by_uuid->get('add uuid of user'));
+
+$users_by_name = $users_by->entities->keyBy('username');
+var_dump($users_by_name->get('jasonk'));
+
+$users_by_email = $users_by->entities->keyBy('email');
+var_dump($users_by_email->get('jasonk@apps4u.com.au'));
+
+// sort by key
+$sorted_by_email = $users_by->sortBy('username');
+var_dump($sorted_by_email);
+
+
+// add user to group
+//$user_to_group = Usergrid::groups()->addUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
+
+//$user_remove_group = Usergrid::groups()->removeUser(['entity_name_or_uuid' => 'group_name_or_uuid', 'user_name_or_uuid' => 'user name or uuid']);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/examples.md
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/examples.md b/sdks/other/php5/apache-usergrid/Examples/examples.md
new file mode 100644
index 0000000..6bfdcd7
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/examples.md
@@ -0,0 +1,17 @@
+## Examples Read Me ##
+
+I don't show every method that you can call in the examples but I show you the most common api calls you will make but to get the most out of this api 
+you really should spend around 10 to 15 minutes to read all the guzzle web service descriptors files in the Manifest folders that are versioned the most 
+up to date version is 1.0.1 folder.
+
+### Manifest files ###
+Guzzle web service descriptors.
+
+You can use the files included with the sdk but you are able to create your own , so you can pass the path the the manifest folder in the config to the sdk. 
+The reason you might create you own is to support you own custom collections. So the way to do that is to copy the manifest folder to the location you want
+then there is a file called custom that you need to copy and edit so for example if I had a custom Collection called Books and I want to be able to call
+the sdk like ```Usergrid::books()->findById(['uuid'=> '12121']); ``` . All I have to do is copy the manifest file called custom and name it books and then 
+in the file replace the ```$custom``` with the word ```'books'``` .
+From that point on I can make api calls to my custom collection just like any of the default collection usergrid give you its a easy as that Ive designed this
+SDK to be extended so you can get the most out of your usergrid install .
+

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/examples.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/examples.php b/sdks/other/php5/apache-usergrid/Examples/examples.php
new file mode 100644
index 0000000..0348610
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/examples.php
@@ -0,0 +1,245 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+include('vendor/autoload.php');
+
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => './src/Manifests', //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'application',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'password',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+/** Usergrid Facades Off */
+
+//call the bootstrap class that will create the api client then get the usergrid instance from the bootstrapper
+$bootstrapper = new UsergridBootstrapper($config);
+$usergrid = $bootstrapper->createUsergrid();
+
+/** Note: I'm using Users for the first lot of example's but you could do the same for all default collections eg: groups, devices, roles, notification etc*/
+
+// All responses are model objects that subclass the baseCollection class so all collection methods are available eg: first(), map(), fetch(), hasValue(), hasKey() etc.
+
+//find users with query
+$user = $usergrid->users()->find(['ql' => 'select * where activated=true']);
+
+//var_dump($user->entities->first());
+
+//request that throw exception in this case 404 not found
+try {
+
+    $user2 = $usergrid->users()->findById(['uuid' => 'uuid-number']);
+//    var_dump($user2->get('entities'));
+} catch (Apache\Usergrid\Api\Exception\NotFoundException $e) {
+
+//    var_dump($e->getResponse());
+}
+/**
+ * There a errors for all Usergrid response errors and http errors so you can create a catch all error class or plug it into your fav php frameworks error handling.
+ * Apache\Usergrid\Api\Exception\BadRequestException = http 400
+ * Apache\Usergrid\Api\Exception\UnauthorizedException = http 401
+ * Apache\Usergrid\Api\Exception\RequestFailedException = http 402
+ * Apache\Usergrid\Api\Exception\NotFoundException = http 404
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 500
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 502
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 503
+ * Apache\Usergrid\Api\Exception\ServerErrorException = http 504
+ */
+
+// collection Iterators no need to keep calling request with a cursor to get all entities in a collection
+// UserIterator(), DeviceIterator() GroupsIterator() , RolesIterator() etc.
+$user_iterator = $usergrid->usersIterator();
+
+foreach ($user_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$new_user = ['name' => 'jasonk', 'username' => 'JasonK', 'email' => 'jason@example.com', 'password' => 'some_password'];
+//$created_user = $usergrid->users()->create($new_user);
+//var_dump($created_user->entities);
+
+//Update Users by name or uuid
+$new_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$updated_user = $usergrid->users()->update($new_email);
+//var_dump($updated_user->entities);
+
+// delete a user
+//$deleted_user = $usergrid->users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($deleted_user);
+
+//get custom collection
+$custom_collection = $usergrid->application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->entities->get('name'));
+
+//get custom collection with query
+$custom_collection_query = $usergrid->application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('entities'));
+
+// Post custom collection as JSON data
+$custom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+//$created_entity = $usergrid->application()->EntityJsonPost($custom_entity);
+//var_dump($created_entity->entities);
+
+// update custom Entity
+$custom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => '918a044a-618a-11e4-8c11-253e9c3723a9',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$edited_entity = $usergrid->application()->EntityPut($custom_entity_edit);
+
+
+/** Usergrid Facades On */
+
+//create a bootstrap instance and then call the static instance method on the Usergrid facade
+$bootstrapper2 = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper2);
+
+
+// find users with query
+$fUser = Usergrid::users()->find(['ql' => 'select * where activated=true']);
+
+$fUser_iterator = Usergrid::usersIterator();
+
+foreach ($fUser_iterator as $iUser) {
+    var_dump($iUser);
+    var_dump("---------------------------------------------------------------------------------");
+}
+
+// create new user
+$fNew_user = [
+    'name' => 'jasonk',
+    'username' => 'JasonK2',
+    'email' => 'jaso2n@example.com',
+    'password' => 'some_password'
+];
+$fCreated_user = Usergrid::users()->create($fNew_user);
+//var_dump($fCreated_user->entities);
+
+//Update Users by name or uuid
+$fNew_email = ['email' => 'jason@example', 'entity_name_or_uuid' => 'benn'];
+$fUpdated_user = Usergrid::users()->update($fNew_email);
+//var_dump($fUpdated_user->entities);
+
+// delete a user
+$fDeleted_user = Usergrid::users()->delete(['entity_name_or_uuid' => 'benn']);
+//var_dump($fDeleted_user->entities);
+
+//get custom collection
+$fCustom_collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
+//var_dump($custom_collection->get('entities'));
+
+//get custom collection with query
+$fCustom_collection_query = Usergrid::application()->EntityGet([
+    'collection' => 'shops',
+    'ql' => "select * where country='aus'"
+]);
+//var_dump($custom_collection_query->get('name'));
+
+// Post custom collection as JSON data
+$fCustom_entity = [
+    'collection' => 'shops',
+    'name' => 'shop_name3',
+    'adr' => ['street' => '1 main st', 'location' => 'sydney', 'post_code' => '2323'],
+    'type' => 'pet_shop'
+];
+$fCreated_entity = Usergrid::applictions()->EntityJsonPost($custom_entity);
+//var_dump($fCreated_entity->entities);
+
+// update entity
+$fCustom_entity_edit = [
+    'collection' => 'shops',
+    'entity_name_or_uuid' => 'shop_name2',
+    ['adr' => ['street' => '3 main st', 'location' => 'act', 'post_code' => '3323']]
+];
+$fEdited_entity = Usergrid::applications()->EntityPut($fCustom_entity_edit);
+//var_dump($fEdited_entity->entities);
+
+
+/** Relationships */
+$related_data = [
+    'collection' => 'required',
+    'entity_id' => 'required',
+    'relationship' => 'required',
+    'ql' => 'optional'
+];
+$get_relationship = Usergrid::application()->GetRelationship($related_data);
+
+
+$create_relationship_data = [
+    'collection' => 'required',
+    'first_entity_id' => 'required',
+    'relationship' => 'required',
+    'second_entity_id' => 'required'
+];
+$new_relationship = Usergrid::application()->CreateRelationship($create_relationship_data);
+
+
+/** Groups  */
+
+//add user to group
+$fAdd_user_to_group_data = [
+    'entity_name_or_uuid' => 'group_name',
+    'user_name_or_uuid' => 'username'
+];
+$fAdded_user_to_group = Usergrid::groups()->addUser($fAdd_user_to_group_data);
+
+//delete user from group
+$fDeleted_user_from_group = Usergrid::groups()->deleteUser($fAdd_user_to_group_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/management/management.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/management/management.php b/sdks/other/php5/apache-usergrid/Examples/management/management.php
new file mode 100644
index 0000000..cfc5d61
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/management/management.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+/**
+ * When working with the management api any calls that require a application to target will use the default app name set in the config but some times you may want to
+ * make a api call to a different application which is possible when the url requires a application name it taken from the config but if you pass in a different application
+ * name in the method arguments it will override the default application name just for that api call so If I wanted to add a user to two application I could make the same call
+ * twice but pass in a application name only for the 2nd call.
+ */
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+// Get organization activity
+$activity_feed = Usergrid::management()->OrgFeedGet();
+
+// get org details
+$organization_details = Usergrid::management()->OrgGet();
+
+//get organizations application
+$organization_applications = Usergrid::management()->OrgAppsGet();
+
+//create application
+$app = ['name' => 'app name -- required'];
+$new_application = Usergrid::management()->OrgAppsJsonPost($app);
+
+// delete application
+$deleted_application = Usergrid::management()->OrgAppDelete($app);
+
+//get irg admin users
+$organization_admin_users = Usergrid::management()->OrgUsersGet();
+
+/** There are many more api calls just look at the management manifest file to get the method name's and arguments to pass .
+ * The management manifest file is a copy of the swagger file for usergrid so you can also run the swagger UI tool on your usergrid install as well.
+ */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/messages/data.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/messages/data.php b/sdks/other/php5/apache-usergrid/Examples/messages/data.php
new file mode 100644
index 0000000..5d00ec4
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/messages/data.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$message = [];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/messages/messages.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/messages/messages.php b/sdks/other/php5/apache-usergrid/Examples/messages/messages.php
new file mode 100644
index 0000000..0eded4a
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/messages/messages.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/notifications/data.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/notifications/data.php b/sdks/other/php5/apache-usergrid/Examples/notifications/data.php
new file mode 100644
index 0000000..0efdf85
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/notifications/data.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+$notification = [];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/notifications/notifications.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/notifications/notifications.php b/sdks/other/php5/apache-usergrid/Examples/notifications/notifications.php
new file mode 100644
index 0000000..1a76ef8
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/notifications/notifications.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+
+include('data.php');
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1', // set manifest version
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => null, //leave as default or change to your own custom folder
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => '',
+        'password' => '',
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+
+// to user
+$to_user = Usergrid::notifications()->toUser();
+
+
+//to users
+$to_users = Usergrid::notifications()->toUsers();
+
+
+//to group
+$to_group = Usergrid::notifications()->toGroup();
+
+
+// to groups
+$to_groups = Usergrid::notifications()->toGroups();
+
+
+// to device
+$to_device = Usergrid::notifications()->toDevice();
+
+
+// to devices
+$to_devices = Usergrid::notifications()->toDevices();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/Examples/notifications/notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/Examples/notifications/notifiers.php b/sdks/other/php5/apache-usergrid/Examples/notifications/notifiers.php
new file mode 100644
index 0000000..e32f6f4
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/Examples/notifications/notifiers.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Copyright 2010-2014 baas-platform.com, Pty Ltd. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+include('vendor/autoload.php');
+include('data.php');
+
+use Apache\Usergrid\Native\Facades\Usergrid;
+use Apache\Usergrid\Native\UsergridBootstrapper;
+
+
+/** Source your config from file I'm using array here just for ease of use.
+ * When using Laravel Framework publish the package config file when using with
+ * other modern PHP frameworks just use their default config system .
+ */
+$config = [
+    'usergrid' => [
+        'url' => 'https://api.usergrid.com',
+        'version' => '1.0.1',
+        'orgName' => '',
+        'appName' => '',
+        'manifestPath' => './src/Manifests',
+        'clientId' => '',
+        'clientSecret' => '',
+        'username' => null,
+        'password' => null,
+        /**
+         * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+         * Token from.  You have two options here one is 'application' the other is 'organization'
+         *
+         *  organization will get the the token from http://example.com/management using  client_credentials or password grant type
+         *  application will get the token from http://example.com/managment/org_name/app_name using client_credentials or password grant type
+         */
+        'auth_type' => 'organization',
+        /** The Grant Type to use
+         *
+         * This has to be set to one of the 2 grant types that Apache Usergrid
+         * supports which at the moment is client_credentials or password but at
+         * 2 level organization or application
+         */
+        'grant_type' => 'client_credentials',
+        /**
+         * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+         * */
+        'enable_oauth2_plugin' => true
+    ]
+];
+
+// You need to add a push cert to this folder and pass the path in the apple_notifier_data array
+
+$bootstrapper = new UsergridBootstrapper($config);
+Usergrid::instance($bootstrapper);
+
+//create Apple Notifier
+$apple_notifier_data = [
+    'name' => 'apple_test',
+    'environment' => 'development',
+    'p12Certificate' => @'pushtest_dev.p12'
+];
+$apple_notifier = Usergrid::notifiers()->createApple($apple_notifier_data);
+
+// create Google Notifier
+$google_notifier_data = [
+    'name' => 'google_test',
+    'apiKey' => 'AIzaSyCIH_7WC0mOqBGMOXyQnFgrBpOePgHvQJM',
+    'provider' => 'google'
+];
+$google_notifier = Usergrid::notifiers()->createGoogle($google_notifier_data);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/LICENSE
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/LICENSE b/sdks/other/php5/apache-usergrid/LICENSE
new file mode 100644
index 0000000..e06d208
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/LICENSE
@@ -0,0 +1,202 @@
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/README.md b/sdks/other/php5/apache-usergrid/README.md
new file mode 100644
index 0000000..567f3f1
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/README.md
@@ -0,0 +1,219 @@
+# README 
+
+This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
+
+## Getting Started 
+
+install as composer package by adding this to your composer.json file.
+
+``` 
+    "apache-usergrid" : "dev-master" 
+```
+
+and add the URL to the repositories section within your composer.json file.
+
+```
+    "repositories": [{
+        "type" : "vcs",
+        "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+    }]
+```
+
+import the classes ``` include autoload.php ``` then create a new instance of the class with a path to you config file
+or native use just create a config file
+
+
+
+    use Apache\Usergrid\UsergridBootstrapper;
+    $config = [    
+    'usergrid' => [
+                       'url' => 'https://api.usergrid.com',
+                       'version' => '1.0.0',
+                       'orgName' => '',
+                       'appName' => '',
+                       'manifestPath' => './src/Manifests',
+                       'clientId' => '',
+                       'clientSecret' => '',
+                       'username' => '',
+                       'password' => '',
+                       /**
+                        * The Auth Type setting is the Oauth 2 end point you want to get the OAuth 2
+                        * Token from.  You have two options here one is 'application' the other is 'organization'
+                        *
+                        *  organization will get the the token from http://example.com/management/token using  client_credentials or password grant type
+                        *  application will get the token from http://example.com/org_name/app_name/token using client_credentials or password grant type
+                        */
+                       'auth_type' => 'application',
+                       /** The Grant Type to use
+                        *
+                        * This has to be set to one of the 2 grant types that Apache Usergrid
+                        * supports which at the moment is client_credentials or password.
+                        */
+                       'grant_type' => 'client_credentials'
+                        /**
+                        * if you want to manage your own auth flow by calling the token api and setting the token your self just set this to false
+                        * */
+                       'enable_oauth2_plugin' => true
+                   ]
+             ];
+                   
+                   $bootstrap = new UsergridBootstrapper($config);
+                   $usergrid = $bootstrap->createUsergrid();
+                   $collection =$usergrid->application()->getEntity(['collection' => 'shops']);
+
+
+## Or if you like Static Facades
+
+```
+     $bootstrap = new UsergridBootstrapper($config);
+     Usergrid::instance($bootstrap);
+     $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+```
+
+
+### Laravel
+
+In Laravel once you have install the composer package you then publish the config file like ```php artisan config:publish apache/usergrid ``` which will publish the config file to the app/config/packages/apache/usergrid/config.php 
+then add your client_id and secret to the config file the set the service provider in the app/config.php providers array ```Apache\Usergrid\Laravel\ApacheUsergridServiceProvider``` and add the alias to
+the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid``` to be able to access class via a Facade. Example for Laravel
+
+```
+    $collection = Usergrid::application()->EntityGet(['collection' => 'shops']);
+```
+
+## how it works
+
+ You have one main client called Usergrid so if I wanted to call the Management Api and I have Facades enabled then
+ I would call like this ```Usergrid::Management->OrgAppsGet();``` or ```Usergrid::Application->EntityGet();```
+ 
+ There is one top level manifest file called Manifest.php and contain only top level Guzzle service descriptor properties and a empty operations array so 
+ when calling ```php Usergrid::Management()->OrgAppsGet() ```  the Main Manifest file has the operation array filled in by the Management Manifest files operations array
+ and they are cached by the Usergrid web service client. Calls on the Usergrid client are like magic method in the sense that ```php Usergrid::Management()-> method``` call is not
+ backed by a Management class or method its the Manifest that it being selected . Also by using Facades all method are like static method and fit in with newer PHP frameworks just like using the
+ AWS PHP SDK when calling enableFacades() on the AWS factory method.
+ 
+ All responses are subclasses of Illuminate\Support\Collection class so all collection methods are available to call on your response model eg: first(), get(), map(), fetch(), hasKey(), hasValue(), etc.
+ this is not to mistake this with a Usergrid collection which is like your DB table they too are collection object but if you get a response of a single entity then its a Collection with a count of 1.
+ 
+ 
+ 
+### Error Handling 
+
+All HTTP and Server error returned by the Usergrid API have error classes attached to the services descriptors so to handle error's that you want too, Just catch the correct exception eg. resource not found.
+
+```
+    try {
+     $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
+    } catch(NotFoundException $e) {
+        // Handle resource not found
+    }
+```
+ 
+### Authentication
+
+  You can manage your own Oauth 2 flow by setting the enable_oauth2_plugin config setting to false then you need to call the Token api or get the token from elsewhere and then set the token on the usergrid instance.
+  By default this will manage Oauth2 flow for you and I recommend that you leave it set to true. But if you want to do it yourself set the config setting to false and then do something like this.
+  
+```
+    $res  =  Usergrid::management()->authPasswordGet($array);
+    $token = $res->get('access_token');
+    Usergrid::setToken($token)->users()->findById(['uuid' => '1234']);
+```
+ 
+ Authentication for Apache Usergrid uses OAuth-2 protocol and has 4 levels of authentication.
+ 
+* Organization Token  Top level organization access the token is for the organization.
+* Organization Admin Token Top level Admin user this token is the organizations admin users.
+* Application Token  Per Application token that is for the application.
+*  Application User Token User level access this token is for a logged in user.
+ 
+ The Organization and Application token's when using client_credentials should only be used in a server side application as it has full access to all resources.
+ The Organization Token can access all applications and edit Organization details. The Application token has full access to all application 
+ resources. The Admin user token is the organization admin user so it too has access to all Applications and Organizations and the last level which is a User
+ Token that is a per application user and will have access to all resources that roles attached to that user can access.
+ 
+So there are two settings in the config that controls which type of token you get.
+the ```'auth_type' => 'application' ``` controls the level you get Organization or Application and the ``` 'grant_type' => 'client_credentials'``` controls
+which type of credentials you use which can be either `client_credentials` or `password` using client_id & client_secret or username & password.
+
+### Result Iteration
+Apache Usergrid has a default paging size of 10 records so if you ask for a collection that has more then 10 result (entities) then it will return 
+a Cursor so you can pass it to the next request to get then next lot of 10 results so Ive made this easier. Using manifest version 1.0.1 and above you can now use a resource iterator  
+that will return all entities for you in one request. So again let the SDK do the hard work for you. Resource Iterators as lazy loaded so they only make the api call if the data is needed 
+for example when you first make the call no data is requested from the network but as soon as you dereference the data then the first page is requested and the 2nd page is not requested till
+you request the data for example if I used it in a foreach loop it will make a network request for the next page of data only after the loop has gone through the current page count and if you cancel the 
+foreach loop then it wont request any more data the default page size is 20 for resource iterators.
+
+The SDK will check each response to see if their is a cursor and if there is it will get the next set till all entities are returned.
+```
+    $allDevices = Usergrid::DevicesIterator();
+    foreach($allDevices as $device) {
+    // this will have all devices. 
+    }
+```
+# NEW feature - Attributes
+### Attributes (relationships) 
+The Usergrid PHP SDK has api call on the application service to get a related models but it requires that you make two api calls one to get the entity then a 2nd to get the relationship eg:
+
+```
+$users = Usergrid::users()->all(['limit' => 1]);
+$user_uuid = $users-entities->fetch('uuid');
+$data = [ 'collection' => 'users', 'entity_id' => $user_uuid, 'relationship' => 'devices'];
+$device = Usergrid::application()->GetRelationship($data);
+```
+
+Now the data we require for you to make the relationship api call is already in the SDK we should not force you to make a 2nd api call and give us data we already have. so now you don't need to any more. Just access the default relationships as a property on your response Model.
+
+```
+    $users = Usergrid::users()->all();
+    $user = $users->entities->get(0);
+    $device = $user->device;
+```
+
+that's it, So the take away point is let the SDK do the work for you and if you create custom service descriptors and model classes for your custom collection then look at the User response
+model class at it's deviceAttribute method to see how you can either add it to your custom collections or add custom relationship attributes to the default collections. Remember the SDK is designed
+for you to be able to extend the Guzzle service descriptors (manifest files).
+
+
+### HTTP headers and UserAgents
+
+ When working with http clients & server system you may want to sett additional HTTP Headers. Ive have made this easy as well on the Usergrid class you 
+ can set any http headers or access token or user agent when calling the set method it will append new headers or replace headers already set so if you 
+ have some customer analytics set up on your version of usergrid server then just pass the headers you like in a fluent way eg:
+ ``` Usergrid::setHeaders(['BAAS-PLATFORM-ANALYTICS' => 'user001'])->users()->findById(['uuid' => '12343']); ```
+ 
+
+
+## Manifest Files (Guzzle & Swagger  Service Descriptors)
+
+All the files in the manifest folder are just temp file the final Service Descriptors are versioned so
+the real files are in the manifest/1.0.0 folder so as usergrid is updated new versions can be added like 1.1.0 etc.
+Ill leave the other manifest file there for now but will cleanup when Apache Usergrid accepts this library.
+
+## designs guidelines
+
+The design of this is to make it easy to add to existing project and be able to map Model objects in your project 
+to response models for example in my project I have a organization object that is saved in a mysql database and I can
+call a Usergrid Api call on that model object just like using the Usergrid api class eg:
+``` Usergrid::Management->putOrganization($data_array) ``` is the same as
+``` Organization::put($data_array) ``` how to do this is beyond the scope of the SDK but its not hard to create 
+Gateway Objects using php Traits
+
+## PHPUnit Tests
+Some unit tests require a internet connection and a usergrid install so they have been marked with a phpunit @group annotation so to run the tests without a usergrid install just pass the ```--exclude-group internet``` as a option on the command line or IDE setting
+that will exclude the few tests that require access to usergrid which I've limited to only a few unit tests like testing if it can get a oauth2 access_token. 
+
+## Javascript
+
+There is a javascript api to go with this for example I have a site that uses the javascript sdk to login to Apache Usergrid then it send the token server side 
+to be used in api calls on behalf of the logged in user. You can find this javascript sdk in my public git repo it requires one extra config setting and then you include
+the javascript file in your page  It's set to works with Laravel as it posts the token to a route but it would not be hard to use else where just create uri it can post the token too. Its not part of this SDK so think
+of it as a helper as some times it good to have access to both world server side calls for long running or large result sets and Ajax calls to update UI using the one login token for both type of calls.
+
+
+### Contribution guidelines
+* Please help if you like this.
+* Writing tests
+* Code review
+* Code
+* Manifest files

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/TODO.md
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/TODO.md b/sdks/other/php5/apache-usergrid/TODO.md
new file mode 100644
index 0000000..9038491
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/TODO.md
@@ -0,0 +1,2 @@
+## To Do ##
+PHP unit tests , I need to create test for most API calls 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/usergrid/blob/867060fa/sdks/other/php5/apache-usergrid/composer.json
----------------------------------------------------------------------
diff --git a/sdks/other/php5/apache-usergrid/composer.json b/sdks/other/php5/apache-usergrid/composer.json
new file mode 100644
index 0000000..14341a9
--- /dev/null
+++ b/sdks/other/php5/apache-usergrid/composer.json
@@ -0,0 +1,40 @@
+{
+    "name": "apache/usergrid",
+    "description": "Apache Usergrid PHP SDK guzzle web service client and service descriptor to interact with usergrid management and application api",
+    "minimum-stability": "stable",
+    "license": "Apache",
+    "authors": [
+        {
+            "name": "Jason Kristian",
+            "email": "jasonk@apps4u.com.au"
+        }
+    ],
+    "repositories": [
+        {
+            "type" : "vcs",
+            "url" : "https://apps4u@bitbucket.org/apps4u/apache-usergrid.git"
+        }
+    ],
+    "require": {
+        "guzzle/guzzle": "3.9.*",
+        "illuminate/support": "~4.2",
+        "nesbot/carbon": "~1.0"
+
+    },
+    "require-dev": {
+        "mockery/mockery": "~0.9",
+        "phpunit/phpunit": "~4.0"
+    },
+    "autoload": {
+        "classmap": [],
+        "psr-4": {
+            "Apache\\Usergrid\\": "src/"
+        }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "master"
+        }
+    }
+
+}