J. King
5 years ago
25 changed files with 230 additions and 246 deletions
@ -1,41 +1,49 @@ |
|||||
General upgrade notes |
General upgrade notes |
||||
===================== |
===================== |
||||
|
|
||||
When upgrading between any two versions of The Arsse, the following are usually prudent: |
When upgrading between any two versions of The Arsse, the following are |
||||
|
usually prudent: |
||||
|
|
||||
- Back up your database |
- Back up your database |
||||
- Check for any changes to sample Web server configuration |
- Check for any changes to sample Web server configuration |
||||
- Check for any changes to sample systemd unit or other init files |
- Check for any changes to sample systemd unit or other init files |
||||
- If installing from source, update dependencies with `composer install -o --no-dev` |
- If installing from source, update dependencies with: |
||||
|
`composer install -o --no-dev` |
||||
|
|
||||
|
|
||||
Upgrading from 0.5.1 to 0.6.0 |
Upgrading from 0.5.1 to 0.6.0 |
||||
============================= |
============================= |
||||
|
|
||||
- The database schema has changed from rev3 to rev4; if upgrading the database manually, apply the 3.sql file |
- The database schema has changed from rev3 to rev4; if upgrading the database |
||||
|
manually, apply the 3.sql file |
||||
|
- Configuration is now validated for type and semantics: some previously |
||||
|
working configurations may no longer be accepted |
||||
|
|
||||
|
|
||||
Upgrading from 0.2.1 to 0.3.0 |
Upgrading from 0.2.1 to 0.3.0 |
||||
============================= |
============================= |
||||
|
|
||||
- The following Composer dependencies have been added: |
- The following Composer dependencies have been added: |
||||
- zendframework/zend-diactoros |
- zendframework/zend-diactoros |
||||
- psr/http-message |
- psr/http-message |
||||
|
|
||||
|
|
||||
Upgrading from 0.2.0 to 0.2.1 |
Upgrading from 0.2.0 to 0.2.1 |
||||
============================= |
============================= |
||||
|
|
||||
- The database schema has changed from rev2 to rev3; if upgrading the database manually, apply the 2.sql file |
- The database schema has changed from rev2 to rev3; if upgrading the database |
||||
|
manually, apply the 2.sql file |
||||
|
|
||||
|
|
||||
Upgrading from 0.1.x to 0.2.0 |
Upgrading from 0.1.x to 0.2.0 |
||||
============================= |
============================= |
||||
|
|
||||
- The database schema has changed from rev1 to rev2; if upgrading the database manually, apply the 1.sql file |
- The database schema has changed from rev1 to rev2; if upgrading the database |
||||
- Web server configuration has changed to accommodate Tiny Tiny RSS; the following URL paths are affected: |
manually, apply the 1.sql file |
||||
- /tt-rss/api/ |
- Web server configuration has changed to accommodate Tiny Tiny RSS; the |
||||
- /tt-rss/feed-icons/ |
following URL paths are affected: |
||||
- /tt-rss/images/ |
- /tt-rss/api/ |
||||
|
- /tt-rss/feed-icons/ |
||||
|
- /tt-rss/images/ |
||||
- The following Composer dependencies have been added: |
- The following Composer dependencies have been added: |
||||
- jkingweb/druuid |
- jkingweb/druuid |
||||
|
@ -1,77 +0,0 @@ |
|||||
<?php |
|
||||
/** @license MIT |
|
||||
* Copyright 2017 J. King, Dustin Wilson et al. |
|
||||
* See LICENSE and AUTHORS files for details */ |
|
||||
|
|
||||
declare(strict_types=1); |
|
||||
namespace JKingWeb\Arsse\Service\Curl; |
|
||||
|
|
||||
use JKingWeb\Arsse\Arsse; |
|
||||
|
|
||||
class Driver implements \JKingWeb\Arsse\Service\Driver { |
|
||||
protected $options = []; |
|
||||
protected $queue; |
|
||||
protected $handles = []; |
|
||||
|
|
||||
public static function driverName(): string { |
|
||||
return Arsse::$lang->msg("Driver.Service.Curl.Name"); |
|
||||
} |
|
||||
|
|
||||
public static function requirementsMet(): bool { |
|
||||
return extension_loaded("curl"); |
|
||||
} |
|
||||
|
|
||||
public function __construct() { |
|
||||
//default curl options for individual requests |
|
||||
$this->options = [ |
|
||||
\CURLOPT_URL => Arsse::$serviceCurlBase."index.php/apps/news/api/v1-2/feeds/update", |
|
||||
\CURLOPT_CUSTOMREQUEST => "GET", |
|
||||
\CURLOPT_FAILONERROR => false, |
|
||||
\CURLOPT_FOLLOWLOCATION => false, |
|
||||
\CURLOPT_FORBID_REUSE => false, |
|
||||
\CURLOPT_CONNECTTIMEOUT => 20, |
|
||||
\CURLOPT_DNS_CACHE_TIMEOUT => 360, // FIXME: this should probably be twice the update-check interval so that the DNS cache is always in memory |
|
||||
\CURLOPT_PROTOCOLS => \CURLPROTO_HTTP | \CURLPROTO_HTTPS, |
|
||||
\CURLOPT_DEFAULT_PROTOCOL => "https", |
|
||||
\CURLOPT_USERAGENT => Arsse::$conf->fetchUserAgentString, |
|
||||
\CURLMOPT_MAX_HOST_CONNECTIONS => Arsse::$conf->serviceQueueWidth, |
|
||||
\CURLOPT_HTTPHEADER => [ |
|
||||
'Accept: application/json', |
|
||||
'Content-Type: application/json', |
|
||||
], |
|
||||
\CURLOPT_HEADER => false, |
|
||||
]; |
|
||||
// start an async session |
|
||||
$this->queue = curl_multi_init(); |
|
||||
// enable pipelining |
|
||||
curl_multi_setopt($this->queue, \CURLMOPT_PIPELINING, 1); |
|
||||
} |
|
||||
|
|
||||
public function queue(int ...$feeds): int { |
|
||||
foreach ($feeds as $id) { |
|
||||
$h = curl_init(); |
|
||||
curl_setopt($h, \CURLOPT_POSTFIELDS, json_encode(['userId' => "", 'feedId' => $id])); |
|
||||
$this->handles[] = $h; |
|
||||
curl_multi_add_handle($this->queue, $h); |
|
||||
} |
|
||||
return sizeof($this->handles); |
|
||||
} |
|
||||
|
|
||||
public function exec(): int { |
|
||||
$active = 0; |
|
||||
do { |
|
||||
curl_multi_exec($this->queue, $active); |
|
||||
curl_multi_select($this->queue); |
|
||||
} while ($active > 0); |
|
||||
return Arsse::$conf->serviceQueueWidth - $active; |
|
||||
} |
|
||||
|
|
||||
public function clean(): bool { |
|
||||
foreach ($this->handles as $h) { |
|
||||
curl_multi_remove_handle($this->queue, $h); |
|
||||
curl_close($h); |
|
||||
} |
|
||||
$this->handles = []; |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue