You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by ro...@apache.org on 2014/11/12 02:15:15 UTC

[10/45] incubator-usergrid git commit: First commit to ApacheUsergrid for new PHP5 sdks.

First commit to ApacheUsergrid for new PHP5 sdks.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/1f8a4920
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/1f8a4920
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/1f8a4920

Branch: refs/heads/master
Commit: 1f8a49207df7007fac8016a4898ab38c41ed4d1f
Parents: 7131c5a
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Fri Oct 24 18:45:13 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Fri Oct 24 18:45:13 2014 +1000

----------------------------------------------------------------------
 sdks/php5/apache-usergrid/.gitignore            |   12 +
 sdks/php5/apache-usergrid/LICENSE               |  202 +
 sdks/php5/apache-usergrid/README.md             |  162 +
 sdks/php5/apache-usergrid/TODO.md               |    2 +
 sdks/php5/apache-usergrid/composer.json         |   40 +
 sdks/php5/apache-usergrid/composer.lock         | 1116 +++++
 sdks/php5/apache-usergrid/phpunit.xml           |   29 +
 .../src/Api/Exception/BadRequestException.php   |   33 +
 .../src/Api/Exception/InvalidIdException.php    |   33 +
 .../src/Api/Exception/NotFoundException.php     |   32 +
 .../src/Api/Exception/ServerErrorException.php  |   32 +
 .../src/Api/Exception/UnauthorizedException.php |   33 +
 .../src/Api/Exception/UsergridException.php     |  155 +
 .../apache-usergrid/src/Api/Filters/Boolean.php |   44 +
 .../apache-usergrid/src/Api/Filters/Date.php    |   44 +
 .../apache-usergrid/src/Api/Filters/Number.php  |   48 +
 .../apache-usergrid/src/Api/GuzzleClient.php    |   64 +
 .../src/Api/Models/Application.php              |   35 +
 .../src/Api/Models/BaseCollection.php           |  100 +
 .../src/Api/Models/Collection.php               |   37 +
 .../apache-usergrid/src/Api/Models/Entity.php   |   36 +
 .../apache-usergrid/src/Api/Models/Event.php    |   35 +
 .../src/Api/Models/GuzzleCommandTrait.php       |   50 +
 .../src/Api/Models/Organization.php             |   60 +
 .../apache-usergrid/src/Api/Models/User.php     |   36 +
 .../apache-usergrid/src/Api/QueryAggregator.php |   61 +
 .../src/Api/ResourceIterator.php                |   69 +
 sdks/php5/apache-usergrid/src/Api/Usergrid.php  |  453 ++
 .../Oauth2/GrantType/AuthorizationCode.php      |   77 +
 .../Oauth2/GrantType/ClientCredentials.php      |   74 +
 .../Oauth2/GrantType/GrantTypeInterface.php     |   41 +
 .../GrantType/HWIOAuthBundleRefreshToken.php    |   62 +
 .../Oauth2/GrantType/PasswordCredentials.php    |   74 +
 .../Plugin/Oauth2/GrantType/RefreshToken.php    |   75 +
 .../src/Guzzle/Plugin/Oauth2/Oauth2Plugin.php   |  204 +
 .../Laravel/ApacheUsergridServiceProvider.php   |  142 +
 .../src/Laravel/Facades/Usergrid.php            |   42 +
 .../src/Manifests/1.0.0/Application.php         |  979 ++++
 .../src/Manifests/1.0.0/Errors.php              |   60 +
 .../src/Manifests/1.0.0/Management.php          | 1076 ++++
 .../src/Manifests/1.0.0/Manifest.php            |   25 +
 .../src/Manifests/1.0.0/Notification.php        |  154 +
 .../src/Manifests/1.0.1/Application.php         | 1000 ++++
 .../src/Manifests/1.0.1/Errors.php              |   50 +
 .../src/Manifests/1.0.1/Management.php          |  319 ++
 .../src/Manifests/1.0.1/Manifest.php            |   24 +
 .../src/Manifests/1.0.1/Notification.php        |  154 +
 .../src/Manifests/Application.php               |  985 ++++
 .../src/Manifests/Management.php                | 1381 ++++++
 .../apache-usergrid/src/Manifests/Manifest.php  |   23 +
 .../apache-usergrid/src/Manifests/Usergrid.php  | 4689 ++++++++++++++++++
 .../src/Manifests/applications.json             | 1262 +++++
 .../src/Manifests/management.json               | 1905 +++++++
 .../src/Manifests/resources.json                |   15 +
 .../src/Native/ConfigRepository.php             |  102 +
 .../src/Native/Facades/Usergrid.php             |  119 +
 .../src/Native/UsergridBootstrapper.php         |  151 +
 sdks/php5/apache-usergrid/src/config/config.php |   65 +
 .../tests/Api/ApplicationTest.php               |   86 +
 .../tests/Api/Exception/ExceptionsTest.php      |   95 +
 .../tests/Api/Filters/BooleanTest.php           |   45 +
 .../tests/Api/Filters/DateTest.php              |   41 +
 .../tests/Api/ManagementTest.php                |   77 +
 .../tests/Api/QueryAggregatorTest.php           |   42 +
 .../apache-usergrid/tests/Api/UsergridTest.php  |  180 +
 .../tests/Laravel/Facades/UsergridTest.php      |   53 +
 66 files changed, 19001 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/.gitignore
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/.gitignore b/sdks/php5/apache-usergrid/.gitignore
new file mode 100644
index 0000000..61ba991
--- /dev/null
+++ b/sdks/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/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/LICENSE
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/LICENSE b/sdks/php5/apache-usergrid/LICENSE
new file mode 100644
index 0000000..e06d208
--- /dev/null
+++ b/sdks/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/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
new file mode 100644
index 0000000..fe436e2
--- /dev/null
+++ b/sdks/php5/apache-usergrid/README.md
@@ -0,0 +1,162 @@
+# 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
+
+For 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
+
+```
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+$bootstrap = new UsergridBootstrapper($config);
+Usergrid::instance($boostraper);
+$res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+
+```
+
+
+### Laravel ###
+In Laravel 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 and setup the service provider to app/config 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()->getEntity(['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->getApps();``` or ```Usergrid::Application->getEntity();```
+ 
+ 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()->getEntity() ```  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.
+ 
+### 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 to 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 and then set the token on the usergrid instance
+  by default this will manage Oauth2 for you but if you want to do it your self set the config setting to false and then do some like this.
+  
+```
+ $res  =  Usergrid::management()->authPasswordGet($array);
+ $token = $res->get('access_token');
+ Usergrid::setToken($token);
+ 
+```
+ 
+ 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 each resource
+ 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 users 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_id & client_secret or username & password
+
+
+## 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 yor 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::Mangement->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
+
+
+## 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 you page but It only works with Laravel as it posts the token to a route bu it would not be hard to use else where 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 and Ajax calls using the one login token.
+
+
+### Contribution guidelines ###
+* Please help if you like this.
+* Writing tests
+* Code review
+* Code
+* Manifest files
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/TODO.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/TODO.md b/sdks/php5/apache-usergrid/TODO.md
new file mode 100644
index 0000000..9038491
--- /dev/null
+++ b/sdks/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/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/composer.json
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/composer.json b/sdks/php5/apache-usergrid/composer.json
new file mode 100644
index 0000000..afa4756
--- /dev/null
+++ b/sdks/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": "dev",
+    "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"
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/composer.lock
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/composer.lock b/sdks/php5/apache-usergrid/composer.lock
new file mode 100644
index 0000000..1dd33b1
--- /dev/null
+++ b/sdks/php5/apache-usergrid/composer.lock
@@ -0,0 +1,1116 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "This file is @generated automatically"
+    ],
+    "hash": "b5596d79dd2dd146c428d2e33431ed20",
+    "packages": [
+        {
+            "name": "guzzle/guzzle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/guzzle/guzzle3.git",
+                "reference": "3c0ca2255751631f1dd64eb16bbe3b9440258297"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/3c0ca2255751631f1dd64eb16bbe3b9440258297",
+                "reference": "3c0ca2255751631f1dd64eb16bbe3b9440258297",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
+                "php": ">=5.3.3",
+                "symfony/event-dispatcher": "~2.1"
+            },
+            "replace": {
+                "guzzle/batch": "self.version",
+                "guzzle/cache": "self.version",
+                "guzzle/common": "self.version",
+                "guzzle/http": "self.version",
+                "guzzle/inflection": "self.version",
+                "guzzle/iterator": "self.version",
+                "guzzle/log": "self.version",
+                "guzzle/parser": "self.version",
+                "guzzle/plugin": "self.version",
+                "guzzle/plugin-async": "self.version",
+                "guzzle/plugin-backoff": "self.version",
+                "guzzle/plugin-cache": "self.version",
+                "guzzle/plugin-cookie": "self.version",
+                "guzzle/plugin-curlauth": "self.version",
+                "guzzle/plugin-error-response": "self.version",
+                "guzzle/plugin-history": "self.version",
+                "guzzle/plugin-log": "self.version",
+                "guzzle/plugin-md5": "self.version",
+                "guzzle/plugin-mock": "self.version",
+                "guzzle/plugin-oauth": "self.version",
+                "guzzle/service": "self.version",
+                "guzzle/stream": "self.version"
+            },
+            "require-dev": {
+                "doctrine/cache": "~1.3",
+                "monolog/monolog": "~1.0",
+                "phpunit/phpunit": "3.7.*",
+                "psr/log": "~1.0",
+                "symfony/class-loader": "~2.1",
+                "zendframework/zend-cache": "2.*,<2.3",
+                "zendframework/zend-log": "2.*,<2.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.9-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Guzzle": "src/",
+                    "Guzzle\\Tests": "tests/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Guzzle Community",
+                    "homepage": "https://github.com/guzzle/guzzle/contributors"
+                }
+            ],
+            "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+            "homepage": "http://guzzlephp.org/",
+            "keywords": [
+                "client",
+                "curl",
+                "framework",
+                "http",
+                "http client",
+                "rest",
+                "web service"
+            ],
+            "time": "2014-10-15 19:36:56"
+        },
+        {
+            "name": "illuminate/support",
+            "version": "4.2.x-dev",
+            "target-dir": "Illuminate/Support",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/illuminate/support.git",
+                "reference": "4831699d6bcddd766e3cebbd8279976854d37027"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/illuminate/support/zipball/4831699d6bcddd766e3cebbd8279976854d37027",
+                "reference": "4831699d6bcddd766e3cebbd8279976854d37027",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "jeremeamia/superclosure": "~1.0.1",
+                "patchwork/utf8": "1.1.*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.2-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Illuminate\\Support": ""
+                },
+                "files": [
+                    "Illuminate/Support/helpers.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Taylor Otwell",
+                    "email": "taylorotwell@gmail.com"
+                }
+            ],
+            "time": "2014-09-27 01:17:10"
+        },
+        {
+            "name": "nesbot/carbon",
+            "version": "1.13.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/briannesbitt/Carbon.git",
+                "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/5cb6e71055f7b0b57956b73d324cc4de31278f42",
+                "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "Carbon": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Brian Nesbitt",
+                    "email": "brian@nesbot.com",
+                    "homepage": "http://nesbot.com"
+                }
+            ],
+            "description": "A simple API extension for DateTime.",
+            "homepage": "https://github.com/briannesbitt/Carbon",
+            "keywords": [
+                "date",
+                "datetime",
+                "time"
+            ],
+            "time": "2014-09-26 02:52:02"
+        },
+        {
+            "name": "symfony/event-dispatcher",
+            "version": "dev-master",
+            "target-dir": "Symfony/Component/EventDispatcher",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/EventDispatcher.git",
+                "reference": "e133748fd9165e24f8e9498ef5862f8bd37004e5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e133748fd9165e24f8e9498ef5862f8bd37004e5",
+                "reference": "e133748fd9165e24f8e9498ef5862f8bd37004e5",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "~2.0",
+                "symfony/dependency-injection": "~2.6",
+                "symfony/expression-language": "~2.6",
+                "symfony/stopwatch": "~2.2"
+            },
+            "suggest": {
+                "symfony/dependency-injection": "",
+                "symfony/http-kernel": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\EventDispatcher\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                },
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                }
+            ],
+            "description": "Symfony EventDispatcher Component",
+            "homepage": "http://symfony.com",
+            "time": "2014-10-04 06:08:58"
+        }
+    ],
+    "packages-dev": [
+        {
+            "name": "doctrine/instantiator",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/instantiator.git",
+                "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119",
+                "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3,<8.0-DEV"
+            },
+            "require-dev": {
+                "athletic/athletic": "~0.1.8",
+                "ext-pdo": "*",
+                "ext-phar": "*",
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "2.0.*@ALPHA"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Doctrine\\Instantiator\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "http://ocramius.github.com/"
+                }
+            ],
+            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+            "homepage": "https://github.com/doctrine/instantiator",
+            "keywords": [
+                "constructor",
+                "instantiate"
+            ],
+            "time": "2014-10-13 12:58:55"
+        },
+        {
+            "name": "mockery/mockery",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/padraic/mockery.git",
+                "reference": "8e567de2249a8f7eb8051a855b9d0a6472d38c8e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/padraic/mockery/zipball/8e567de2249a8f7eb8051a855b9d0a6472d38c8e",
+                "reference": "8e567de2249a8f7eb8051a855b9d0a6472d38c8e",
+                "shasum": ""
+            },
+            "require": {
+                "lib-pcre": ">=7.0",
+                "php": ">=5.3.2"
+            },
+            "require-dev": {
+                "hamcrest/hamcrest-php": "~1.1",
+                "phpunit/phpunit": "~4.0",
+                "satooshi/php-coveralls": "~0.7@dev"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "0.9.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Mockery": "library/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Pádraic Brady",
+                    "email": "padraic.brady@gmail.com",
+                    "homepage": "http://blog.astrumfutura.com"
+                },
+                {
+                    "name": "Dave Marshall",
+                    "email": "dave.marshall@atstsolutions.co.uk",
+                    "homepage": "http://davedevelopment.co.uk"
+                }
+            ],
+            "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
+            "homepage": "http://github.com/padraic/mockery",
+            "keywords": [
+                "BDD",
+                "TDD",
+                "library",
+                "mock",
+                "mock objects",
+                "mockery",
+                "stub",
+                "test",
+                "test double",
+                "testing"
+            ],
+            "time": "2014-10-16 09:15:15"
+        },
+        {
+            "name": "phpunit/php-code-coverage",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+                "reference": "28d21b57c189cb72829056353de603c4d4da55a0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/28d21b57c189cb72829056353de603c4d4da55a0",
+                "reference": "28d21b57c189cb72829056353de603c4d4da55a0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "phpunit/php-file-iterator": "~1.3",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-token-stream": "~1.3",
+                "sebastian/environment": "~1.0",
+                "sebastian/version": "~1.0"
+            },
+            "require-dev": {
+                "ext-xdebug": ">=2.1.4",
+                "phpunit/phpunit": "dev-master"
+            },
+            "suggest": {
+                "ext-dom": "*",
+                "ext-xdebug": ">=2.2.1",
+                "ext-xmlwriter": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+            "keywords": [
+                "coverage",
+                "testing",
+                "xunit"
+            ],
+            "time": "2014-10-05 10:46:54"
+        },
+        {
+            "name": "phpunit/php-file-iterator",
+            "version": "1.3.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "File/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+            "keywords": [
+                "filesystem",
+                "iterator"
+            ],
+            "time": "2013-10-10 15:34:57"
+        },
+        {
+            "name": "phpunit/php-text-template",
+            "version": "1.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-text-template.git",
+                "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+                "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "Text/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Simple template engine.",
+            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+            "keywords": [
+                "template"
+            ],
+            "time": "2014-01-30 17:20:04"
+        },
+        {
+            "name": "phpunit/php-timer",
+            "version": "1.0.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-timer.git",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "PHP/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "include-path": [
+                ""
+            ],
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Utility class for timing",
+            "homepage": "https://github.com/sebastianbergmann/php-timer/",
+            "keywords": [
+                "timer"
+            ],
+            "time": "2013-08-02 07:42:54"
+        },
+        {
+            "name": "phpunit/php-token-stream",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+                "reference": "f8d5d08c56de5cfd592b3340424a81733259a876"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876",
+                "reference": "f8d5d08c56de5cfd592b3340424a81733259a876",
+                "shasum": ""
+            },
+            "require": {
+                "ext-tokenizer": "*",
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.3-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Wrapper around PHP's tokenizer extension.",
+            "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+            "keywords": [
+                "tokenizer"
+            ],
+            "time": "2014-08-31 06:12:13"
+        },
+        {
+            "name": "phpunit/phpunit",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit.git",
+                "reference": "628bcfbbefa0e47dbb7d773021338590bd7586ee"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/628bcfbbefa0e47dbb7d773021338590bd7586ee",
+                "reference": "628bcfbbefa0e47dbb7d773021338590bd7586ee",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "ext-json": "*",
+                "ext-pcre": "*",
+                "ext-reflection": "*",
+                "ext-spl": "*",
+                "php": ">=5.3.3",
+                "phpunit/php-code-coverage": "3.0.*@dev",
+                "phpunit/php-file-iterator": "~1.3.2",
+                "phpunit/php-text-template": "~1.2",
+                "phpunit/php-timer": "~1.0.2",
+                "phpunit/phpunit-mock-objects": "2.4.*@dev",
+                "sebastian/comparator": "1.1.*@dev",
+                "sebastian/diff": "~1.1",
+                "sebastian/environment": "~1.2",
+                "sebastian/exporter": "~1.0",
+                "sebastian/global-state": "1.0.*@dev",
+                "sebastian/version": "~1.0",
+                "symfony/yaml": "~2.0"
+            },
+            "suggest": {
+                "phpunit/php-invoker": "~1.1"
+            },
+            "bin": [
+                "phpunit"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "4.5.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "The PHP Unit Testing framework.",
+            "homepage": "https://phpunit.de/",
+            "keywords": [
+                "phpunit",
+                "testing",
+                "xunit"
+            ],
+            "time": "2014-10-22 11:54:43"
+        },
+        {
+            "name": "phpunit/phpunit-mock-objects",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+                "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+                "reference": "96c5b81f9842f38fe6c73ad0020306cc4862a9e3",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/instantiator": "~1.0,>=1.0.2",
+                "php": ">=5.3.3",
+                "phpunit/php-text-template": "~1.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.4.*@dev"
+            },
+            "suggest": {
+                "ext-soap": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.4.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sb@sebastian-bergmann.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Mock Object library for PHPUnit",
+            "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+            "keywords": [
+                "mock",
+                "xunit"
+            ],
+            "time": "2014-10-04 10:04:20"
+        },
+        {
+            "name": "sebastian/comparator",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/comparator.git",
+                "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6f67d2ae044ba17ba30573941f4ac96c4777be97",
+                "reference": "6f67d2ae044ba17ba30573941f4ac96c4777be97",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "sebastian/diff": "~1.1",
+                "sebastian/exporter": "~1.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides the functionality to compare PHP values for equality",
+            "homepage": "http://www.github.com/sebastianbergmann/comparator",
+            "keywords": [
+                "comparator",
+                "compare",
+                "equality"
+            ],
+            "time": "2014-10-21 10:04:18"
+        },
+        {
+            "name": "sebastian/diff",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/diff.git",
+                "reference": "92d423df43b160006907ea4297b916fdf00415d8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/92d423df43b160006907ea4297b916fdf00415d8",
+                "reference": "92d423df43b160006907ea4297b916fdf00415d8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Kore Nordmann",
+                    "email": "mail@kore-nordmann.de"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Diff implementation",
+            "homepage": "http://www.github.com/sebastianbergmann/diff",
+            "keywords": [
+                "diff"
+            ],
+            "time": "2014-10-19 13:19:30"
+        },
+        {
+            "name": "sebastian/environment",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/environment.git",
+                "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0d9bf79554d2a999da194a60416c15cf461eb67d",
+                "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Provides functionality to handle HHVM/PHP environments",
+            "homepage": "http://www.github.com/sebastianbergmann/environment",
+            "keywords": [
+                "Xdebug",
+                "environment",
+                "hhvm"
+            ],
+            "time": "2014-10-22 06:38:05"
+        },
+        {
+            "name": "sebastian/exporter",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/exporter.git",
+                "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+                "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Jeff Welch",
+                    "email": "whatthejeff@gmail.com"
+                },
+                {
+                    "name": "Volker Dusch",
+                    "email": "github@wallbash.com"
+                },
+                {
+                    "name": "Bernhard Schussek",
+                    "email": "bschussek@2bepublished.at"
+                },
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                },
+                {
+                    "name": "Adam Harvey",
+                    "email": "aharvey@php.net"
+                }
+            ],
+            "description": "Provides the functionality to export PHP variables for visualization",
+            "homepage": "http://www.github.com/sebastianbergmann/exporter",
+            "keywords": [
+                "export",
+                "exporter"
+            ],
+            "time": "2014-09-10 00:51:36"
+        },
+        {
+            "name": "sebastian/global-state",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/global-state.git",
+                "reference": "231d48620efde984fd077ee92916099a3ece9a59"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/231d48620efde984fd077ee92916099a3ece9a59",
+                "reference": "231d48620efde984fd077ee92916099a3ece9a59",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.2"
+            },
+            "suggest": {
+                "ext-uopz": "*"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de"
+                }
+            ],
+            "description": "Snapshotting of global state",
+            "homepage": "http://www.github.com/sebastianbergmann/global-state",
+            "keywords": [
+                "global state"
+            ],
+            "time": "2014-10-06 09:49:11"
+        },
+        {
+            "name": "sebastian/version",
+            "version": "1.0.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/version.git",
+                "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+                "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43",
+                "shasum": ""
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "src/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Sebastian Bergmann",
+                    "email": "sebastian@phpunit.de",
+                    "role": "lead"
+                }
+            ],
+            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+            "homepage": "https://github.com/sebastianbergmann/version",
+            "time": "2014-03-07 15:35:33"
+        },
+        {
+            "name": "symfony/yaml",
+            "version": "dev-master",
+            "target-dir": "Symfony/Component/Yaml",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/Yaml.git",
+                "reference": "499f7d7aa96747ad97940089bd7a1fb24ad8182a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/Yaml/zipball/499f7d7aa96747ad97940089bd7a1fb24ad8182a",
+                "reference": "499f7d7aa96747ad97940089bd7a1fb24ad8182a",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "Symfony\\Component\\Yaml\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                },
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                }
+            ],
+            "description": "Symfony Yaml Component",
+            "homepage": "http://symfony.com",
+            "time": "2014-10-05 13:53:50"
+        }
+    ],
+    "aliases": [],
+    "minimum-stability": "dev",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "platform": [],
+    "platform-dev": []
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/phpunit.xml
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/phpunit.xml b/sdks/php5/apache-usergrid/phpunit.xml
new file mode 100644
index 0000000..374f8ad
--- /dev/null
+++ b/sdks/php5/apache-usergrid/phpunit.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         bootstrap="vendor/autoload.php"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         processIsolation="false"
+         stopOnFailure="false"
+         syntaxCheck="false"
+        >
+    <testsuites>
+        <testsuite name="Apache Usergrid PHP SDK Test Suite">
+            <directory>./tests</directory>
+        </testsuite>
+    </testsuites>
+    <filter>
+        <whitelist>
+            <directory suffix=".php">./src/</directory>
+            <exclude>
+                <file>./src/Laravel/ApacheUsergridServiceProvider.php</file>
+            </exclude>
+        </whitelist>
+    </filter>
+    <logging>
+        <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
+    </logging>
+</phpunit>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php b/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
new file mode 100644
index 0000000..c6a2453
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/BadRequestException.php
@@ -0,0 +1,33 @@
+<?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.
+ */
+
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class BadRequestException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class BadRequestException extends UsergridException{
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php b/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
new file mode 100644
index 0000000..c59a683
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/InvalidIdException.php
@@ -0,0 +1,33 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class InvalidIdException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class InvalidIdException extends UsergridException
+{
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php b/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
new file mode 100644
index 0000000..a13277b
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/NotFoundException.php
@@ -0,0 +1,32 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class NotFoundException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class NotFoundException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php b/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
new file mode 100644
index 0000000..2525e12
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/ServerErrorException.php
@@ -0,0 +1,32 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class ServerErrorException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class ServerErrorException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php b/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
new file mode 100644
index 0000000..d7d3694
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/UnauthorizedException.php
@@ -0,0 +1,33 @@
+<?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.
+ */
+
+
+namespace Apache\Usergrid\Api\Exception;
+
+
+/**
+ * Class UnauthorizedException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UnauthorizedException extends UsergridException {
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php b/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
new file mode 100644
index 0000000..4c6057f
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Exception/UsergridException.php
@@ -0,0 +1,155 @@
+<?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.
+ */
+namespace Apache\Usergrid\Api\Exception;
+
+
+use Exception;
+use Guzzle\Http\Message\Request;
+use Guzzle\Http\Message\Response;
+use Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface;
+use Guzzle\Service\Command\CommandInterface;
+
+/**
+ * Class UsergridException
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class UsergridException extends Exception implements ErrorResponseExceptionInterface
+{
+    /**
+     * The Guzzle request.
+     *
+     * @var \Guzzle\Http\Message\Request
+     */
+    protected $request;
+
+    /**
+     * The Guzzle response.
+     *
+     * @var \Guzzle\Http\Message\Response
+     */
+    protected $response;
+
+    /**
+     * The error type returned by Usergrid.
+     *
+     * @var string
+     */
+    protected $errorType;
+
+    /**
+     * {@inheritDoc}
+     */
+    public static function fromCommand(CommandInterface $command, Response $response)
+    {
+        $errors = json_decode($response->getBody(true), true);
+
+        $type = array_get($errors, 'error.type', null);
+
+        $code = array_get($errors, 'error.code', null);
+
+        $message = array_get($errors, 'error.message', null);
+
+        $class = '\\Apache\\Usergrid\\Api\\Exception\\'.studly_case($type).'Exception';
+
+        if (class_exists($class))
+        {
+            $exception = new $class($message, $response->getStatusCode());
+        }
+        else
+        {
+            $exception = new static($message, $response->getStatusCode());
+        }
+
+        $exception->setErrorType($type);
+
+        $exception->setResponse($response);
+
+        $exception->setRequest($command->getRequest());
+
+        return $exception;
+    }
+
+    /**
+     * Returns the Guzzle request.
+     *
+     * @return \Guzzle\Http\Message\Request
+     */
+    public function getRequest()
+    {
+        return $this->request;
+    }
+
+    /**
+     * Sets the Guzzle request.
+     *
+     * @param  \Guzzle\Http\Message\Request  $request
+     * @return void
+     */
+    public function setRequest(Request $request)
+    {
+        $this->request = $request;
+    }
+
+    /**
+     * Returns the Guzzle response.
+     *
+     * @return \Guzzle\Http\Message\Response
+     */
+    public function getResponse()
+    {
+        return $this->response;
+    }
+
+    /**
+     * Sets the Guzzle response.
+     *
+     * @param  \Guzzle\Http\Message\Response  $response
+     * @return void
+     */
+    public function setResponse(Response $response)
+    {
+        $this->response = $response;
+    }
+
+    /**
+     * Returns the error type returned by Usergrid.
+     *
+     * @return string
+     */
+    public function getErrorType()
+    {
+        return $this->errorType;
+    }
+
+    /**
+     * Sets the error type returned by Usergrid.
+     *
+     * @param  string  $errorType
+     * @return void
+     */
+    public function setErrorType($errorType)
+    {
+        $this->errorType = $errorType;
+    }
+
+
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php b/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
new file mode 100644
index 0000000..021f2fd
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Boolean.php
@@ -0,0 +1,44 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+
+/**
+ * Class Boolean
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Boolean
+{
+
+    /**
+     * Converts a boolean into its string representation.
+     *
+     * @param  bool $boolean
+     * @return string
+     */
+    public static function convert($boolean)
+    {
+        return $boolean ? 'true' : 'false';
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Date.php b/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
new file mode 100644
index 0000000..8b3c5c6
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Date.php
@@ -0,0 +1,44 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+use Carbon\Carbon;
+
+/**
+ * Class Date
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Date
+{
+
+    /**
+     * @param $date
+     * @return static
+     */
+    public static function convert($date)
+    {
+        $date2 = (int)($date / 1000);
+        $date_string = Carbon::createFromTimestampUTC($date2)->toDayDateTimeString();
+        return $date_string;
+    }
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1f8a4920/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Filters/Number.php b/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
new file mode 100644
index 0000000..41047d3
--- /dev/null
+++ b/sdks/php5/apache-usergrid/src/Api/Filters/Number.php
@@ -0,0 +1,48 @@
+<?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.
+ */
+
+namespace Apache\Usergrid\Api\Filters;
+
+
+/**
+ * Class Number
+ *
+ * @package    Apache/Usergrid
+ * @version    1.0.0
+ * @author     Jason Kristian <ja...@gmail.com>
+ * @license    Apache License, Version  2.0
+ * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
+ * @link       http://baas-platform.com
+ */
+class Number
+{
+
+    /**
+     * Converts a number into an integer.
+     *
+     * @param  mixed $number
+     * @return int
+     */
+    public static function convert($number)
+    {
+        if (is_string($number) || is_float($number)) {
+            return (int)($number * 100);
+        }
+
+        return $number;
+    }
+
+}