I want to take the HybridAuth library on sourceforge.net and turn it into a Yii extension. However, the library does not follow Yii standards. For example, a class named Hybrid_Auth is located in a file named Auth.php.
I really don't want to modify the source so it can easily be updated later. If I try to instantiate a Hybrid_Auth object, it will look for a file called HyBrid_Auth.php, which doesn't exist. How could I get Yii to look in the Auth.php file for the Hybrid_Auth class? Thanks.
Page 1 of 1
Question about creating an extension from an existing library. HybridAuth
#2
Posted 22 April 2012 - 04:49 PM
you can make it a component in yii
all you need to do is the insert it in your components array inside the config/main.php file
the most important array key is the "class" which it value will be the path to the auth.php file
now in your code (model, controllers) you can have this
all you need to do is the insert it in your components array inside the config/main.php file
the most important array key is the "class" which it value will be the path to the auth.php file
components=>array(
.............
'Auth' =>array (
'class'=>'..//Auth.php' #put the dir of your extension
//you can also define use variables inside this array
now in your code (model, controllers) you can have this
Yii::app()->Auth
#4
Posted 26 May 2012 - 06:34 PM
sbefort, on 22 April 2012 - 07:29 PM, said:
Awesome, thanks for the helpful reply.
Did you ever make it anywhere with this one? I've been following the HybridAuth library for a while...very interested in hearing what you ended up doing.
Also following this thread here: http://www.yiiframew...1020-hybridauth
Share this topic:
Page 1 of 1

Help












