Laravel 4, Composer and hybridauth - How to load additional providers

痞子三分冷 提交于 2019-12-05 05:39:04

I had this problem with Instagram and was able to use the wrapper syntax, which is documented here http://hybridauth.sourceforge.net/userguide/tuts/specific-provider-wrapper.html

The code below got the Instagram adapter working for me.

           "Instagram" => array ( 
                "enabled" => true,
                "keys"    => array ( 
                    "id" => xxxx, 
                    "secret" => xxxx,
                ),
                "wrapper" => array(
                    'class'=>'Hybrid_Providers_Instagram',
                    'path' => $_SERVER['DOCUMENT_ROOT'].'/../vendor/hybridauth/hybridauth/additional-providers/hybridauth-instagram/Providers/Instagram.php'
                )
            ),

If you read the source at hybridauth/Hybrid/Provider_Adapter.php line 69, you'll see it checks for this before doing require_once with the standard path.

I searched and searched for this as well. All I can think of is that it was made for use without frameworks, then was ported to be used with Composer, however the "additional providers" folder isn't loaded, or something. It kinda sucks.

I just copied the file into the other directory, and everything works now.

This maybe handy for you...

http://blog.elliothesp.co.uk/coding/laravel-4-and-hybrid-auth/

Part regarding this:

Copy the Steam.php file, located at:
laravel/vendor/hybridauth/hybridauth/additional-providers/hybridauth-steam/Providers/Steam.php

Over to:

laravel/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Providers/

I've no idea why the library has them separated, doesn't make any sense to me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!