Most of the code is from Phil Sturgeon CodeIgniter.
Usage ¶
Just extract the 2 files into ext.components.
cURL Component example
$curl = new CURL();
$html = $curl->simple_get('http://www.google.com/');
RESTClient example
$rest = new RESTClient();
$rest->initialize(array('server' => 'http://twitter.com/'));
$tweet = $rest->get('statuses/user_timeline/'.$username.'.xml');
Resources ¶
Original Libraries:
Incorrect license
Not to be a stickler, but the license for the original libs published by Phil, is the DBAD license (not New BSD). Humorous, yes, but still it's licensed already.
As a result, you should change the licensing to reflect "Other Open Source license", and reference this link for the proper license:
http://philsturgeon.co.uk/code/dbad-license
Make sure it's intact in your code as well, if not already so.
The license doesn't actually matter to me, but I know there are quite a few users in the Yii community that do and don't use contributed code, based on the license.
Additionally, the incorrect licensing may matter to Phil.
Really it'd be nice to see both extensions released separately (instead of combined), so someone can install just the curl ext if desired, but you've filled a nice gap in the Yii code base regardless.
Cheers
Thanks, I'll feedback to Phil about this
:)) Actually, after reading your comments, I read the license at the link as well.
:)) Never thought there could be such a license! :))
I'll notify Phil about this porting as well.
License Updated
I have inform Phil about the porting of his code.
Also, change the header to keep the original header as well. :)
restclient error
Hi,
Thank you for this extension. It is what Im needing.
CURL component works fine, but restclient is dropping an error whenever i try to use your example:
$rest = new RESTClient();
array_key_exists() expects parameter 2 to be array, null given
/public_html/protected/extensions/RESTClient.php(256)
May be im missing something
Thank you again
more info needed
Hi guys,
How can I get this working correctly?
May be a little more info how to use it.
In my controller I tried:
$rest = new RESTClient();
or
$rest = Yii::app()->RESTClient();
but get the following message.
even when I add the path in my config/main.php
// application components 'components'=>array( 'RESTClient' => array( 'class' => 'application.extensions.RESTClient', ),
I found it:
make sure that the extensions directory is included in the import array
// autoloading model and component classes 'import'=>array( .... 'application.extensions.*' ),
restclient error
Hi
try adding line 46 in the RESTClient.php
private $_headers = array();
private variables/methods
Hi,
Thanks for your efforts. I really like the RESTClient but I needed some customized methods and thus had to completely rewrite the whole class because every variable/method is defined as private. Phil doesn't do that in his code (he uses protected instead) so I wasn't sure about your intentions. Maybe there is a reason behind that. If not I would recommend making things more flexible with protected/public where possible.
Anyway, thanks for your extension
PR available for bug reported by Thim (#5953)
I created a PR from your bugfix, thank you for reporting it!
Version of library
Author, please versioning you library.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.