Skip to content

Instantly share code, notes, and snippets.

@fitzagard
Created July 6, 2012 01:44
Show Gist options
  • Save fitzagard/3057526 to your computer and use it in GitHub Desktop.
Save fitzagard/3057526 to your computer and use it in GitHub Desktop.
Curl using Li3
<?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