Created
July 6, 2012 01:44
-
-
Save fitzagard/3057526 to your computer and use it in GitHub Desktop.
Curl using Li3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\controllers; | |
use lithium\net\socket\curl; | |
class FeedsController extends \lithium\action\Controller { | |
protected $_li3 = array( | |
'scheme' => 'https', | |
'host' => 'api.github.com/repos/fitzagard/li3_sublime/commits', | |
'port' => 80, | |
'timeout' => 2 | |
); | |
public function read() { | |
$stream = new Curl($this->_li3); | |
$stream->open(); | |
$stream->encoding('UTF-8'); | |
$data = $stream->read(); | |
$stream->close(); | |
die(var_dump($data)); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment