Update dependencies

This commit is contained in:
Frédéric Guillot 2015-01-02 11:54:40 -05:00
parent 6bc9c481c7
commit ab23ca816e
6 changed files with 125 additions and 105 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e::getLoader();
return ComposerAutoloaderInitc13b90f3b2e13ad59b988101eac1fc97::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e
class ComposerAutoloaderInitc13b90f3b2e13ad59b988101eac1fc97
{
private static $loader;
@ -19,9 +19,9 @@ class ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc13b90f3b2e13ad59b988101eac1fc97', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc13b90f3b2e13ad59b988101eac1fc97', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -42,14 +42,14 @@ class ComposerAutoloaderInitdeb23075faf85ef9ce52dd731739836e
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequiredeb23075faf85ef9ce52dd731739836e($file);
composerRequirec13b90f3b2e13ad59b988101eac1fc97($file);
}
return $loader;
}
}
function composerRequiredeb23075faf85ef9ce52dd731739836e($file)
function composerRequirec13b90f3b2e13ad59b988101eac1fc97($file)
{
require $file;
}

View File

@ -77,84 +77,6 @@
"description": "A simple Json-RPC client/server library that just works",
"homepage": "https://github.com/fguillot/JsonRPC"
},
{
"name": "fguillot/picofeed",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "26a0824e3e0b4986f19facc961f21c8a70876b90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/26a0824e3e0b4986f19facc961f21c8a70876b90",
"reference": "26a0824e3e0b4986f19facc961f21c8a70876b90",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2014-12-26 15:54:33",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Unlicense"
],
"authors": [
{
"name": "Frédéric Guillot",
"homepage": "http://fredericguillot.com"
}
],
"description": "Modern library to write or read feeds (RSS/Atom)",
"homepage": "http://fguillot.github.io/picoFeed"
},
{
"name": "fguillot/picodb",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoDb.git",
"reference": "5d1d8d6e898975fc30a241614d9bf06d5728db7d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoDb/zipball/5d1d8d6e898975fc30a241614d9bf06d5728db7d",
"reference": "5d1d8d6e898975fc30a241614d9bf06d5728db7d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2014-12-26 17:10:34",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoDb": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"WTFPL"
],
"authors": [
{
"name": "Frédéric Guillot",
"homepage": "http://fredericguillot.com"
}
],
"description": "Minimalist database query builder",
"homepage": "https://github.com/fguillot/picoDb"
},
{
"name": "fguillot/picofarad",
"version": "dev-master",
@ -193,5 +115,83 @@
],
"description": "Minimalist micro-framework",
"homepage": "https://github.com/fguillot/picoFarad"
},
{
"name": "fguillot/picofeed",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "8722d562f1f5446c5595d8854f2a3260fdf1a5b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/8722d562f1f5446c5595d8854f2a3260fdf1a5b2",
"reference": "8722d562f1f5446c5595d8854f2a3260fdf1a5b2",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2015-01-02 16:39:51",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Unlicense"
],
"authors": [
{
"name": "Frédéric Guillot",
"homepage": "http://fredericguillot.com"
}
],
"description": "Modern library to write or read feeds (RSS/Atom)",
"homepage": "http://fguillot.github.io/picoFeed"
},
{
"name": "fguillot/picodb",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoDb.git",
"reference": "8116698f9471f6c3f9b3c1334ee358c9b73d9864"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoDb/zipball/8116698f9471f6c3f9b3c1334ee358c9b73d9864",
"reference": "8116698f9471f6c3f9b3c1334ee358c9b73d9864",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2015-01-02 16:42:20",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoDb": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"WTFPL"
],
"authors": [
{
"name": "Frédéric Guillot",
"homepage": "http://fredericguillot.com"
}
],
"description": "Minimalist database query builder",
"homepage": "https://github.com/fguillot/picoDb"
}
]

View File

@ -37,6 +37,22 @@ class Database
*/
private $pdo;
/**
* Flag to calculate query time
*
* @access public
* @var boolean
*/
public $stopwatch = false;
/**
* Flag to log generated SQL queries
*
* @access public
* @var boolean
*/
public $log_queries = false;
/**
* Constructor, iniatlize a PDO driver
*
@ -189,9 +205,21 @@ class Database
{
try {
$this->setLogMessage($sql);
if ($this->log_queries) {
$this->setLogMessage($sql);
}
if ($this->stopwatch) {
$start = microtime(true);
}
$rq = $this->pdo->prepare($sql);
$rq->execute($values);
if ($this->stopwatch) {
$this->setLogMessage('DURATION='.(microtime(true) - $start));
}
return $rq;
}
catch (PDOException $e) {

View File

@ -236,13 +236,19 @@ class Grabber
*/
public function download()
{
$client = Client::getInstance();
$client->setConfig($this->config);
$client->execute($this->url);
try {
$this->url = $client->getUrl();
$this->html = $client->getContent();
$this->encoding = $client->getEncoding();
$client = Client::getInstance();
$client->setConfig($this->config);
$client->execute($this->url);
$this->url = $client->getUrl();
$this->html = $client->getContent();
$this->encoding = $client->getEncoding();
}
catch (ClientException $e) {
Logger::setMessage(get_called_class().': '.$e->getMessage());
}
return $this->html;
}

View File

@ -136,19 +136,5 @@ class ReaderTest extends PHPUnit_Framework_TestCase
$reader = new Reader;
$this->assertInstanceOf('PicoFeed\Parser\Rss20', $reader->getParser('http://blah', file_get_contents('tests/fixtures/grotte_barbu.xml'), 'utf-8'));
$reader = new Reader;
$client = $reader->download('http://www.groovehq.com/blog/feed');
$parser = $reader->getParser($client->getUrl(), $client->getContent(), $client->getEncoding());
$this->assertInstanceOf('PicoFeed\Parser\Atom', $parser);
$feed = $parser->execute();
$this->assertEquals('https://www.groovehq.com/blog/feed', $client->getUrl());
$this->assertEquals('http://www.groovehq.com/blog/feed', $feed->getFeedUrl());
$this->assertNotEquals('http://www.groovehq.com/blog/feed', $feed->items[0]->getUrl());
$this->assertTrue(strpos($feed->items[0]->getUrl(), 'http://') === 0);
$this->assertTrue(strpos($feed->items[0]->getUrl(), 'feed') === false);
}
}