Yii Framework Forum: Twitter Connection problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Twitter Connection problem Rate Topic: -----

#1 User is offline   keiyuasa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-July 12

Posted 12 August 2012 - 08:27 PM

I want to implement Twitter connection in my app and followed

http://www.yiiframew...itter-from-yii/

When I tried to access to views/site/twitter.php, Yii::app()->twitter->isAuthorized was executed, and caused an error (CException).

Alias "pogostick.components.twitter.CPSTwitterApi" is invalid. Make sure it points to an existing PHP file.

I installed the pogostick Yii Extensions library under protected/extensions. There exists a file protected/extensions/pogostick/components/twitter/CPSTwitterApi.php

What's wrong?
0

#2 User is offline   dominus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 14-June 12

Posted 13 August 2012 - 03:15 PM

I was getting the same error, maybe this is an old post but it can help somebody that is facing the same problem.

I solve this by putting "ext." before "pogostick.components.twitter.CPSTwitterApi" like this: ext.pogostick.components.twitter.CPSTwitterApi in the main.php at config when you declare the class for the component. It should be like this:

//  Twitter API
'twitter' => array(
    'class' => 'ext.pogostick.components.twitter.CPSTwitterApi',
    'apiKey' => 'your_consumer_key',
    'apiSecretKey' => 'your_consumer_secret',
    'apiBaseUrl' => 'http://twitter.com',
    'callbackUrl' => 'your_callback_url',
    'format' => 'array',
),

0

#3 User is offline   keiyuasa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-July 12

Posted 13 August 2012 - 09:21 PM

Thank you Dominus,

CPSTwitterApi is found. But I had another error:

include(CPSOAuthComponent.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

CPSOAuthComponent is a super class of CPSTwitterApi. autoload in YiiBase.php generates this error. Alias is set in config/main.php as follows:

Yii::setPathOfAlias('pogostick','protected/extensions/pogostick');
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users