how to use Zend 2 Oauth package -
thanx reading, first time try use zend 2 oauth, following answer in link did said using composer don't know how check if it's installed. how can check if it's installed? , how use it? tried in index controller call examples in zend page
$config = array( 'callbackurl' => 'http://example.com/callback.php', 'siteurl' => 'http://twitter.com/oauth', 'consumerkey' => 'gg3dsftw9ou9ewpnbupzq', 'consumersecret' => 'tfb0fywlsmf74lkeu9ftyohxcazowpbrajtcck48a' ); $consumer = new zendoauth\consumer($config);
but returns:
fatal error: class 'application\controller\zendoauth\consumer' not found
and tried include @ top using use
command can't find package named oauth. can 1 me this? idea or appreciated.
you're within application\controller
namespace, when new zendoauth\consumer
, php assumes mean new application\controller\zendoauth\consumer
unless tell otherwise.
to fix error, need do:
$consumer = new \zendoauth\consumer($config);
however, may have trouble getting working, i'm 80% sure zend oauth package supports oauth 1 (it's it's port of zf1 package), not oauth 2.
Comments
Post a Comment