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:22 UTC
[17/45] incubator-usergrid git commit: Had to move the
enable_oauth2_plugin check in to the RegisterUsergrid function left note as
to why
Had to move the enable_oauth2_plugin check in to the RegisterUsergrid function left note as to why
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/83ca146a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/83ca146a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/83ca146a
Branch: refs/heads/master
Commit: 83ca146a992c80881d8d10b6859c919dcd1fb9ed
Parents: 143a025
Author: Apps4u <ja...@apps4u.com.au>
Authored: Mon Oct 27 12:37:38 2014 +1000
Committer: Apps4u <ja...@apps4u.com.au>
Committed: Mon Oct 27 12:37:38 2014 +1000
----------------------------------------------------------------------
.../Laravel/ApacheUsergridServiceProvider.php | 29 +++++++++++++++-----
1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/83ca146a/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 d24ad40..2e6bda4 100644
--- a/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
+++ b/sdks/php5/apache-usergrid/src/Laravel/ApacheUsergridServiceProvider.php
@@ -15,6 +15,7 @@
*/
namespace Apache\Usergrid\Laravel;
+
use Apache\Usergrid\Api\Usergrid;
use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\ClientCredentials;
use Apache\Usergrid\Guzzle\Plugin\Oauth2\GrantType\PasswordCredentials;
@@ -52,13 +53,6 @@ class ApacheUsergridServiceProvider extends ServiceProvider
*/
public function register()
{
- $enable_oauth2_plugin = $this->app['config']->get('apache/usergrid::usergrid.enable_oauth2_plugin');
-
- //check if user managed oauth auth flow
- if($enable_oauth2_plugin){
- // Create the Oauth2 Guzzle Plugin.
- $this->createGuzzleOauth2Plugin();
- }
// register Usergrid
$this->registerUsergrid();
@@ -68,6 +62,27 @@ class ApacheUsergridServiceProvider extends ServiceProvider
$this->app['usergrid'] = $this->app->share(function ($app) {
+ /** Note: I had to move this to here from the register function as the below config values would not get set and would be null
+ * unless I has this with the package namespace missing but doing that would mean that it would not find the enable_oauth2_plugin
+ * value .. This has been driving me crazy as I tried to read the config values from a rout and they would not show up
+ * then I did . Also this would not find the config values if the boot function did not have the package method called with
+ * all 3 args
+ $enable_oauth2_plugin = $this->app['config']->get('usergrid.enable_oauth2_plugin');
+
+ //check if user managed oauth auth flow
+ if($enable_oauth2_plugin){
+ // Create the Oauth2 Guzzle Plugin.
+ $this->createGuzzleOauth2Plugin();
+ }
+ */
+ $enable_oauth2_plugin = $app['config']->get('apache/usergrid::usergrid.enable_oauth2_plugin');
+
+ //check if user managed oauth auth flow
+ if($enable_oauth2_plugin){
+ // Create the Oauth2 Guzzle Plugin.
+ $this->createGuzzleOauth2Plugin();
+ }
+
$baseUrl = $app['config']->get('apache/usergrid::usergrid.url');
$orgName = $app['config']->get('apache/usergrid::usergrid.orgName');