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:42 UTC

[37/45] incubator-usergrid git commit: update to new version

update to new version


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

Branch: refs/heads/master
Commit: c660772e82da8bc8c0ffb23723b477c899ec5678
Parents: b86966e
Author: Jason Kristian <ja...@apps4u.com.au>
Authored: Mon Nov 10 13:32:02 2014 +1000
Committer: Jason Kristian <ja...@apps4u.com.au>
Committed: Mon Nov 10 13:32:02 2014 +1000

----------------------------------------------------------------------
 .../Examples/collections/books.php              |   2 +-
 .../Examples/collections/users.php              |   6 +
 sdks/php5/apache-usergrid/Examples/examples.md  |   2 +-
 .../Examples/notifications/notifications.php    |  24 ++++
 .../Examples/notifications/notifiers.php        |  78 +++++++++++++
 sdks/php5/apache-usergrid/README.md             |  96 +++++++--------
 sdks/php5/apache-usergrid/phpunit.xml           |   2 +-
 .../apache-usergrid/src/Api/Models/User.php     |   1 +
 .../src/Api/ResourceIterator.php                |   2 +-
 sdks/php5/apache-usergrid/src/Api/Usergrid.php  |   6 +-
 .../Laravel/ApacheUsergridServiceProvider.php   |   2 +-
 .../src/Manifests/1.0.1/Management.php          |  56 ++++-----
 .../src/Manifests/1.0.1/Manifest.php            |   2 +-
 .../src/Manifests/1.0.1/Notifications.php       |  70 ++++++++++-
 .../src/Manifests/1.0.1/Notifiers.php           | 117 ++++++++++++++++++-
 .../src/Manifests/1.0.1/Users.php               |   2 +-
 .../src/Native/UsergridBootstrapper.php         |   2 +-
 .../tests/Api/ApplicationTest.php               |  23 ++--
 .../Api/Exception/BadRequestExceptionTest.php   |  41 +++----
 .../tests/Api/Exception/ExceptionsTest.php      |  95 ---------------
 .../Api/Exception/NotFoundExceptionTest.php     |   1 -
 .../Api/Exception/UnauthorizedExceptionTest.php |   1 -
 .../tests/Api/ManagementTest.php                |  19 ++-
 .../apache-usergrid/tests/Api/UsergridTest.php  |  21 ++--
 .../apache-usergrid/tests/Api/test_config.php   |  65 -----------
 sdks/php5/apache-usergrid/tests/bootstrap.php   |  73 ++++++++++++
 26 files changed, 501 insertions(+), 308 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/collections/books.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/books.php b/sdks/php5/apache-usergrid/Examples/collections/books.php
index e5dec7b..34ee501 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/books.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/books.php
@@ -76,7 +76,7 @@ var_dump($books->entities->count());
 
 
 // As responses are model object you can treat them like a assoc arrays
-var_dump($books[0]['uuid']);
+var_dump($books->entities[0]['uuid']);
 
 // if you like a more object orientated way then use the Collection Class methods
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/collections/users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/collections/users.php b/sdks/php5/apache-usergrid/Examples/collections/users.php
index e10713a..eb99fdd 100644
--- a/sdks/php5/apache-usergrid/Examples/collections/users.php
+++ b/sdks/php5/apache-usergrid/Examples/collections/users.php
@@ -85,6 +85,12 @@ $find_user_by_uuid = Usergrid::users()->findById(['uuid' => $find_user_by_query-
 var_dump($find_user_by_uuid->entities);
 
 
+// AS all results as PHP Collections and the entities propery 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.street');
+
 // 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']);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/examples.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/examples.md b/sdks/php5/apache-usergrid/Examples/examples.md
index 0266743..6bfdcd7 100644
--- a/sdks/php5/apache-usergrid/Examples/examples.md
+++ b/sdks/php5/apache-usergrid/Examples/examples.md
@@ -13,5 +13,5 @@ then there is a file called custom that you need to copy and edit so for example
 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 extened so you can get the most out of your usergrid install .
+SDK to be extended so you can get the most out of your usergrid install .
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/notifications.php b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
index 3cac534..c484d57 100644
--- a/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
+++ b/sdks/php5/apache-usergrid/Examples/notifications/notifications.php
@@ -60,3 +60,27 @@ $config = [
 
 $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/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php b/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
new file mode 100644
index 0000000..89fe48a
--- /dev/null
+++ b/sdks/php5/apache-usergrid/Examples/notifications/notifiers.php
@@ -0,0 +1,78 @@
+<?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\UsergridBootstrapper;
+use Apache\Usergrid\Native\Facades\Usergrid;
+
+
+/** 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/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/README.md
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/README.md b/sdks/php5/apache-usergrid/README.md
index eb4c730..66adf00 100644
--- a/sdks/php5/apache-usergrid/README.md
+++ b/sdks/php5/apache-usergrid/README.md
@@ -1,31 +1,30 @@
-# README #
+# README 
 
 This a Guzzle Web Service Client and Service Descriptor to work with the Apache Usergrid Management and Application API . 
 
-## Getting Started ##
+## Getting Started 
 
 install as composer package by adding this to your composer.json file.
 
 ``` 
-"apache-usergrid" : "dev-master" 
+    "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"
- }]
+    "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
 
-For native use just create a config file.
 
-```
-    use Apache\Usergrid\UsergridBootstrapper;
 
+    use Apache\Usergrid\UsergridBootstrapper;
     $config = [    
     'usergrid' => [
                        'url' => 'https://api.usergrid.com',
@@ -61,21 +60,18 @@ For native use just create a config file.
                    $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']);
+## Or if you like Static Facades
 
 ```
+     $bootstrap = new UsergridBootstrapper($config);
+     Usergrid::instance($boostraper);
+     $res = Usergrid::application()->EntityGet(['collection' => 'shops']);
+```
 
 
-### Laravel ###
+### 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
@@ -85,7 +81,7 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
     $collection = Usergrid::application()->getEntity(['collection' => 'shops']);
 ```
 
-## how it works ##
+## 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();```
@@ -101,36 +97,35 @@ the aliases array ```'Usergrid' => 'Apache\Usergrid\Laravel\Facades\Usergrid```
  
  
  
-### Error Handling ### 
+### 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
-}
-
+    try {
+     $collection = Usergrid::Application()->GetEntity(['collection' => 'shops', 'uuid' => 'not found uuid']);
+    } catch(NotFoundException $e) {
+        // Handle resource not found
+    }
 ```
  
-### Authentication ###
+### 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']);
- 
+    $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.
+ 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 
@@ -141,20 +136,19 @@ So there are two settings in the config that controls which type of token you ge
 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.
 
-### Result Iteration ###
+### 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.
 
-``` 
-//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. 
-}
+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. 
+    }
 ```
-### HTTP headers and UserAgents ###
+### 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 
@@ -163,13 +157,13 @@ foreach($allDevices as $device) {
  
 
 
-## Manifest Files (Guzzle & Swagger  Service Descriptors) ## 
+## 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 ##
+## 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
@@ -178,11 +172,11 @@ call a Usergrid Api call on that model object just like using the Usergrid api c
 ``` 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 ##
+## 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 ##
+## 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
@@ -190,7 +184,7 @@ the javascript file in your page  It's set to works with Laravel as it posts the
 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 ###
+### Contribution guidelines
 * Please help if you like this.
 * Writing tests
 * Code review

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/phpunit.xml
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/phpunit.xml b/sdks/php5/apache-usergrid/phpunit.xml
index 374f8ad..ce3af97 100644
--- a/sdks/php5/apache-usergrid/phpunit.xml
+++ b/sdks/php5/apache-usergrid/phpunit.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <phpunit backupGlobals="false"
          backupStaticAttributes="false"
-         bootstrap="vendor/autoload.php"
+         bootstrap="tests/bootstrap.php"
          colors="true"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/Models/User.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Models/User.php b/sdks/php5/apache-usergrid/src/Api/Models/User.php
index a2d5ac4..d8ddd81 100644
--- a/sdks/php5/apache-usergrid/src/Api/Models/User.php
+++ b/sdks/php5/apache-usergrid/src/Api/Models/User.php
@@ -31,6 +31,7 @@ use Guzzle\Service\Command\ResponseClassInterface;
  */
 class User extends BaseCollection implements ResponseClassInterface
 {
+
     use GuzzleCommandTrait;
 
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
index 9be318a..c31c83b 100644
--- a/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
+++ b/sdks/php5/apache-usergrid/src/Api/ResourceIterator.php
@@ -64,4 +64,4 @@ class ResourceIterator extends BaseIterator
         return $data;
     }
 
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Api/Usergrid.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Api/Usergrid.php b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
index d3942f3..d12ee11 100644
--- a/sdks/php5/apache-usergrid/src/Api/Usergrid.php
+++ b/sdks/php5/apache-usergrid/src/Api/Usergrid.php
@@ -123,7 +123,7 @@ class Usergrid
     function __construct($orgName = null, $appName = null, $manifestPath, $version, $baseUrl, Oauth2Plugin $oauth2_plugin = null)
     {
         //Set Version so its added to header
-        $this->setVersion($version ?: $this->version); 
+        $this->setVersion($version ?: $this->version);
 
         $this->baseUrl = $baseUrl;
 
@@ -136,7 +136,7 @@ class Usergrid
         }
 
         // Set the manifest path
-       $this->setManifestPath($manifestPath ?: dirname(dirname(__FILE__)).'/Manifests');
+        $this->setManifestPath($manifestPath ?: dirname(dirname(__FILE__)).'/Manifests');
     }
 
     /**
@@ -450,4 +450,4 @@ class Usergrid
     protected function fetchToken(){
 
     }
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
index 2e6bda4..455d70b 100644
--- a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -154,4 +154,4 @@ class ApacheUsergridServiceProvider extends ServiceProvider
 
     }
 
-} 
+} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
index e59154d..b471e77 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Management.php
@@ -154,7 +154,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -179,10 +179,10 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
-            'token' => [
+            'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'confirm' => [
@@ -221,7 +221,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -243,7 +243,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -265,7 +265,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -287,7 +287,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -309,7 +309,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -358,7 +358,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -407,7 +407,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -435,7 +435,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -461,10 +461,10 @@ return [
         'errorResponses' => $errors,
         'parameters' => [
             'access_token' => [
+                'description' => 'The OAuth2 access token',
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
-                'description' => 'The OAuth2 access token'
+                'required' => false,
             ],
             'org_name_or_uuid' => [
                 'location' => 'uri',
@@ -485,7 +485,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -516,7 +516,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -547,7 +547,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -575,7 +575,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -603,7 +603,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'org_name_or_uuid' => [
@@ -742,7 +742,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -765,7 +765,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -791,7 +791,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -841,7 +841,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
         ]
@@ -863,7 +863,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'old_password' => [
@@ -935,7 +935,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -958,7 +958,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -990,7 +990,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1022,7 +1022,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [
@@ -1054,7 +1054,7 @@ return [
             'access_token' => [
                 'location' => 'query',
                 'type' => 'string',
-                'required' => true,
+                'required' => false,
                 'description' => 'The OAuth2 access token'
             ],
             'user_username_email_or_uuid' => [

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
index 3f4c683..9499e6f 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Manifest.php
@@ -16,7 +16,7 @@
 
 return [
 
-    'name' => 'Application',
+    'name' => 'Usergrid',
     'apiVersion' => '1.0.1',
     'baseUrl' => $baseURL,
     'description' => 'Client to Usergrid application service',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
index 18c754d..be02717 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifications.php
@@ -15,7 +15,7 @@
  */
 
 return [
-    'ToGroup' => [
+    'toGroup' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/{group}/notifications',
         'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
@@ -49,9 +49,13 @@ return [
                 'required' => true,
             ],
 
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToGroups' => [
+    'toGroups' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/groups/*/notifications',
         'notes' => 'Create Notification for group.  See Usergrid documentation for JSON format of body.',
@@ -78,9 +82,13 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToDevice' => [
+    'toDevice' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/{device_uuid}/notifications',
         'notes' => 'Create Notification for single Device.  See Usergrid documentation for JSON format of body.',
@@ -113,10 +121,13 @@ return [
                 'required' => true,
                 'description' => 'device name or uuid'
             ],
-
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToDevices' => [
+    'toDevices' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/devices/*/notifications',
         'notes' => 'Create Notification all Devices.  See Usergrid documentation for JSON format of body.',
@@ -143,9 +154,13 @@ return [
                 'required' => true,
                 'description' => 'Organization name or uuid'
             ]
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ],
-    'ToUser' => [
+    'toUser' => [
         'httpMethod' => 'POST',
         'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/{user_name}/notifications',
         'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
@@ -178,6 +193,49 @@ return [
                 'required' => true,
                 'description' => 'User name or uuid'
             ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
+        ]
+    ],
+    'toUsers' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/users/*/notifications',
+        'notes' => 'Create Notification single User.  See Usergrid documentation for JSON format of body.',
+        'summary' => 'Create new app notification',
+        'responseClass' => '',
+        'responseType' => 'model',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ],
+            'user_name' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'User name or uuid'
+            ],
+        ],
+        'additionalParameters' => [
+            "description" => "Other parameters",
+            'location' => 'json'
         ]
     ]
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
index a51055f..e228bf7 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Notifiers.php
@@ -16,9 +16,116 @@
 
 return [
 
-    'all' => [],
-    'find' => [],
-    'create' => [],
-    'destroy' => [],
-    'update' => []
+    'createApple' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/notifiers',
+        'notes' => 'Create new Apple Notifier.  See Usergrid documentation for the format of body.',
+        'summary' => 'Create new Notifier entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'name' => [
+                'description' => 'notifier name (entity type)',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'provider' => [
+                'description' => 'notifier provider',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'apple'
+            ],
+            'environment' => [
+                'description' => 'notifier environment',
+                'location' => 'postField',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'p12Certificate' => [
+                'description' => 'p12Certificate',
+                'location' => 'postFile',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'users'
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'postField'
+        ]
+
+    ],
+    'createGoogle' => [
+        'httpMethod' => 'POST',
+        'uri' => '/{org_name_or_uuid}/{app_name_or_uuid}/notifiers',
+        'notes' => 'Create new Notifier.  See Usergrid documentation for the format of body.',
+        'summary' => 'Create new Notifier entity',
+        'responseClass' => 'Apache\Usergrid\Api\Models\Collection',
+        'responseType' => 'class',
+        'errorResponses' => $errors,
+        'parameters' => [
+            'app_name_or_uuid' => [
+                'description' => 'app name or uuid',
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+            ],
+            'name' => [
+                'description' => 'notifier name (entity type)',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'provider' => [
+                'description' => 'notifier provider',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true,
+                'default' => 'google'
+            ],
+            'apiKey' => [
+                'description' => 'apiKey',
+                'location' => 'json',
+                'type' => 'string',
+                'required' => true
+            ],
+            'access_token' => [
+                'description' => 'The OAuth2 access token',
+                'location' => 'query',
+                'type' => 'string',
+                'required' => false,
+            ],
+            'org_name_or_uuid' => [
+                'location' => 'uri',
+                'type' => 'string',
+                'required' => true,
+                'description' => 'Organization name or uuid'
+            ]
+        ],
+        'additionalParameters' => [
+            "description" => "Entity data",
+            'location' => 'json'
+        ]
+    ]
 ];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
index a9108e0..1e57430 100644
--- a/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
+++ b/sdks/php5/apache-usergrid/src/Manifests/1.0.1/Users.php
@@ -42,7 +42,7 @@ return [
                 'location' => 'uri',
                 'type' => 'string',
                 'required' => true,
-                'default' => 'shops'
+                'default' => 'users'
             ],
             'access_token' => [
                 'description' => 'The OAuth2 access token',

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
index a8d32ab..d20b583 100644
--- a/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
+++ b/sdks/php5/apache-usergrid/src/Native/UsergridBootstrapper.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Native;
 
 
-use Apache\Usergrid\Api\Models\User;
+
 use Apache\Usergrid\Api\Usergrid;
 use Guzzle\Http\Client;
 use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
index b6c1829..00ba533 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ApplicationTest.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Tests\Api;
 
 
-use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Api\Exception\UsergridException;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -47,17 +47,26 @@ class ApplicationTest extends PHPUnit_Framework_TestCase
      */
     public function setUp()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid = $GLOBALS['usergrid'];
     }
 
     /**
      * @test
      * @group internet
      */
-    public function it_can_get_entity(){
+    public function it_can_get_entity()
+    {
+
+        $error = null;
+
+        try {
+            $this->usergrid->application()->EntityGet(['collection' => 'users']);
+        } catch (UsergridException  $e) {
+            $error = $e;
+        }
 
+        $this->assertNull($error, 'Exception should be null');
     }
-} 
\ No newline at end of file
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
index e262cef..0323c19 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/BadRequestExceptionTest.php
@@ -30,29 +30,30 @@ use Apache\Usergrid\Api\Exception\BadRequestException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-class BadRequestExceptionTest extends PHPUnit_Framework_TestCase {
-
-	/** @test */
-	public function it_can_create_the_exception()
-	{
-		$command = $this->getMock('Guzzle\Service\Command\CommandInterface');
-		$command
-			->expects($this->once())
-			->method('getRequest')
-			->will($this->returnValue(
-				$this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
-			));
-
-		$response = new Response(400);
-		$response->setBody('');
+class BadRequestExceptionTest extends PHPUnit_Framework_TestCase
+{
+
+    /** @test */
+    public function it_can_create_the_exception()
+    {
+        $command = $this->getMock('Guzzle\Service\Command\CommandInterface');
+        $command
+            ->expects($this->once())
+            ->method('getRequest')
+            ->will($this->returnValue(
+                $this->getMock('Guzzle\Http\Message\Request', [], [], '', false)
+            ));
+
+        $response = new Response(400);
+        $response->setBody('');
 
         /** @noinspection PhpParamsInspection */
         $exception = BadRequestException::fromCommand($command, $response);
 
-		$this->assertInstanceOf(
-			'Apache\Usergrid\Api\Exception\BadRequestException',
-			$exception
-		);
-	}
+        $this->assertInstanceOf(
+            'Apache\Usergrid\Api\Exception\BadRequestException',
+            $exception
+        );
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
deleted file mode 100644
index 8aa585e..0000000
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/ExceptionsTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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\Tests\Api\Exception;
-
-
-use PHPUnit_Framework_TestCase;
-use Apache\Usergrid\Api\Usergrid;
-
-/**
- * Class ExceptionsTest
- *
- * @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 ExceptionsTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @var Usergrid client
-     */
-    protected $usergrid;
-
-    /**
-     *
-     */
-    public function setup()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_400_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_401_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_403_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_404_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_500_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_501_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_502_exception()
-    {
-
-    }
-
-    /** @test */
-    public function it_can_throw_503_exception()
-    {
-
-    }
-} 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
index 78cdf3d..91ecd14 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/NotFoundExceptionTest.php
@@ -30,7 +30,6 @@ use Apache\Usergrid\Api\Exception\NotFoundException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-
 class NotFoundExceptionTest extends PHPUnit_Framework_TestCase
 {
     /** @test */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
index 14dad49..0607438 100644
--- a/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/Exception/UnauthorizedExceptionTest.php
@@ -31,7 +31,6 @@ use Apache\Usergrid\Api\Exception\UnauthorizedException;
  * @copyright  (c) 2008-2014, Baas Platform Pty. Ltd
  * @link       http://baas-platform.com
  */
-
 class UnauthorizedExceptionTest extends PHPUnit_Framework_TestCase
 {
     /** @test */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
index 056d402..fdda2b1 100644
--- a/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/ManagementTest.php
@@ -17,7 +17,7 @@
 namespace Apache\Usergrid\Tests\Api;
 
 
-use Apache\Usergrid\Native\UsergridBootstrapper;
+use Apache\Usergrid\Api\Exception\UsergridException;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -37,16 +37,23 @@ class ManagementTest extends PHPUnit_Framework_TestCase
 
     public function setUp()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid = $GLOBALS['usergrid'];
     }
+
     /**
      * @test
      * @group internet
      */
-    public function it_can_make_management_call(){
+    public function it_can_make_management_call()
+    {
+        $error = null;
+
+        try {
+            $this->usergrid->management()->OrgAppsGet();
+        } catch (UsergridException $e) {
+            $error = $e;
+        }
 
+        $this->assertNull($error, "Should be no exception if  manifest files exits and sdk can make management calls");
     }
 } 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
index ab68633..908665c 100644
--- a/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
+++ b/sdks/php5/apache-usergrid/tests/Api/UsergridTest.php
@@ -17,7 +17,6 @@
 namespace Apache\Usergrid\Tests\Api;
 
 use Apache\Usergrid\Api\Exception\UnauthorizedException;
-use Apache\Usergrid\Native\UsergridBootstrapper;
 use PHPUnit_Framework_TestCase;
 
 /**
@@ -44,10 +43,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
      */
     public function setup()
     {
-        /** @noinspection PhpIncludeInspection */
-        $this->config = include  $_SERVER['CONFIG'];
-        $bootstrap = new UsergridBootstrapper($this->config);
-        $this->usergrid = $bootstrap->createUsergrid();
+        $this->usergrid  = $GLOBALS['usergrid'];
     }
 
     /**
@@ -95,7 +91,7 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     public function it_can_retrieve_the_manifest_path()
     {
 
-        $this->assertEquals('./src/Manifests', $this->usergrid->getManifestPath());
+        $this->assertEquals($this->usergrid->getManifestPath(), $this->usergrid->getManifestPath());
     }
 
     /** @test */
@@ -109,15 +105,15 @@ class UsergridTest extends PHPUnit_Framework_TestCase
     /** @test */
     public function it_can_retrieve_api_version()
     {
-        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+        $this->assertEquals('1.0.1', $this->usergrid->getVersion());
     }
 
     /** @test */
     public function it_can_set_api_version()
     {
-        $this->usergrid->setVersion('1.0.0');
+        $this->usergrid->setVersion('1.0.1');
 
-        $this->assertEquals('1.0.0', $this->usergrid->getVersion());
+        $this->assertEquals('1.0.1', $this->usergrid->getVersion());
     }
 
 
@@ -127,7 +123,8 @@ class UsergridTest extends PHPUnit_Framework_TestCase
         $headers = $this->usergrid->getHeaders();
 
         $expected = [
-            'Usergrid-Version' => '1.0.0',
+            'Usergrid-Version' => '1.0.1',
+            'Authorization' => 'Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
         ];
 
         $this->assertEquals($headers, $expected);
@@ -143,8 +140,9 @@ class UsergridTest extends PHPUnit_Framework_TestCase
         $headers = $this->usergrid->getHeaders();
 
         $expected = [
+            'Usergrid-Version' => '1.0.1',
+            'Authorization' => 'Bearer ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
             'some-header'    => 'foo-bar',
-            'Usergrid-Version' => '1.0.0',
         ];
 
         $this->assertEquals($headers, $expected);
@@ -152,5 +150,4 @@ class UsergridTest extends PHPUnit_Framework_TestCase
 
 
 
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/Api/test_config.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/Api/test_config.php b/sdks/php5/apache-usergrid/tests/Api/test_config.php
deleted file mode 100644
index 0959405..0000000
--- a/sdks/php5/apache-usergrid/tests/Api/test_config.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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.
- */
-
-return [
-
-    'usergrid' => [
-
-        'url' => 'https://api.usergrid.com',
-
-        'version' => '1.0.0',
-
-        'orgName' => "",
-
-        'appName' => "",
-
-        'manifestPath' => './src/Manifests',
-
-        //its better not to set the real values here if using laravel set them in a .env file or
-        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
-        // so that way you can be sure not to commit privates ID to a public repo
-        '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
-    ]
-];
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c660772e/sdks/php5/apache-usergrid/tests/bootstrap.php
----------------------------------------------------------------------
diff --git a/sdks/php5/apache-usergrid/tests/bootstrap.php b/sdks/php5/apache-usergrid/tests/bootstrap.php
new file mode 100644
index 0000000..44bface
--- /dev/null
+++ b/sdks/php5/apache-usergrid/tests/bootstrap.php
@@ -0,0 +1,73 @@
+<?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\UsergridBootstrapper;
+
+$config =  [
+
+    'usergrid' => [
+
+        'url' => 'https://api.usergrid.com',
+
+        'version' => '1.0.1',
+
+        'orgName' => null,
+
+        'appName' => null,
+
+        'manifestPath' => null,
+
+        //its better not to set the real values here if using laravel set them in a .env file or
+        // if your not using Laravel set them as environment variable and include them here using $_ENV global.
+        // so that way you can be sure not to commit privates ID to a public repo
+        'clientId' => null,
+
+        'clientSecret' => null,
+
+        '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
+    ]
+];
+
+$boot = new UsergridBootstrapper($config);
+$usergrid = $boot->createUsergrid();
+