cakephp-opauth icon indicating copy to clipboard operation
cakephp-opauth copied to clipboard

.gitignore on Strategy

Open davidsteinsland opened this issue 12 years ago • 5 comments

Why on earth? If I pull down the repo, I can't add submodules to the Strategy/ folder because of the .gitignore file.

Also, is it possible to add the Google Strategy as a submodule instead, as you have done with Vendor? It would really simplify build process..

Thanks!

davidsteinsland avatar Jul 29 '13 07:07 davidsteinsland

You can still place files in Strategy/ despite of the .gitignore. You're not supposed to have nested git repos anyway.

Do try loading of opauth, cakephp-opauth and google strategy via Composer. That would be much simpler.

uzyn avatar Jul 29 '13 14:07 uzyn

No, it wouldn't. When doing so using Composer, CakePHP complains that it cannot find the strategies. of course, because the strategies are not placed within Cakephp-opauth/Strategy. So If I add a custom installer path:

"Plugin/Opauth/Strategy/Google": ["opauth/google"],
"Plugin/Opauth/Strategy/OpenID": ["opauth/openid"],

then this should solve the problem. But not when .gitignore is effectively ignoring all files

davidsteinsland avatar Sep 14 '13 13:09 davidsteinsland

Also: Installing CakePHP-opauth with opauth-google and opauth-openid, with no other requirements or configuration, I end up the following structure:

- Plugin
 + Opauth
    + Strategy
       - empty directory
- vendor
 + opauth
   + opauth
   + google
   + openid

If I set vendor-dir to Plugin, the same structure appears, only that the folders in vendor is now in Plugin. In conclusion, Strategies are not placed under Opauth as your documentation states. Please fix this issue, as it makes it a pain to maintain a proper composer.json file.

davidsteinsland avatar Sep 14 '13 13:09 davidsteinsland

When loading via Composer, the strategies do not have to be in strategy_dir as Composer's autoloader automatically handles it.

All you have to do is simply:

"require": {
    "uzyn/cakephp-opauth": "1.*",
    "opauth/facebook": "*",
    "opauth/twitter": "*"
}

(There's not even a need to require opauth/opauth, but no harm if you explicitly require it)

And to load, you simple have to add this line to your app's bootstrap.php:

<?php
CakePlugin::load('Opauth', array('routes' => true, 'bootstrap' => true));

uzyn avatar Sep 15 '13 13:09 uzyn

if this resolves your issue @davidsteinsland please let us know to close this issue

angelxmoreno avatar Aug 12 '14 05:08 angelxmoreno