Browse Source

Merge branch 'master' of https://code.mensbeam.com/MensBeam/arsse

tags/0.8.2
J. King 1 week ago
parent
commit
5df89009e6
62 changed files with 858 additions and 746 deletions
  1. 2
    1
      CHANGELOG
  2. 2
    4
      README.md
  3. 11
    68
      RoboFile.php
  4. 6
    5
      composer.lock
  5. 1
    1
      docs/en/020_Getting_Started/040_Database_Setup/010_PostgreSQL.md
  6. 2
    2
      docs/en/020_Getting_Started/040_Database_Setup/020_MySQL.md
  7. 1
    1
      docs/en/020_Getting_Started/050_Configuration.md
  8. 1
    1
      docs/en/020_Getting_Started/index.md
  9. 1
    1
      docs/en/025_Using_The_Arsse/030_Keeping_Newsfeeds_Up_to_Date.md
  10. 1
    1
      docs/theme/arsse/arsse.css
  11. 1
    2
      docs/theme/arsse/config.json
  12. 0
    182
      docs/theme/arsse/daux.js
  13. 2
    0
      docs/theme/arsse/daux.min.js
  14. 0
    2
      docs/theme/arsse/highlight.pack.js
  15. 8
    8
      docs/theme/src/arsse.scss
  16. 1
    1
      lib/Arsse.php
  17. 2
    2
      lib/CLI.php
  18. 3
    0
      lib/Conf.php
  19. 0
    15
      lib/Database.php
  20. 16
    29
      lib/Db/AbstractStatement.php
  21. 2
    0
      lib/Db/SQLite3/AbstractPDODriver.php
  22. 4
    4
      lib/ImportExport/AbstractImportExport.php
  23. 24
    22
      lib/Misc/Query.php
  24. 1
    1
      lib/Misc/URL.php
  25. 11
    0
      lib/Misc/ValueInfo.php
  26. 2
    1
      lib/REST/Fever/API.php
  27. 4
    18
      lib/Service.php
  28. 1
    1
      lib/Service/Driver.php
  29. 3
    2
      lib/Service/Serial/Driver.php
  30. 9
    3
      lib/Service/Subprocess/Driver.php
  31. 0
    12
      lib/User.php
  32. 0
    7
      tests/cases/Database/SeriesMiscellany.php
  33. 1
    1
      tests/cases/Db/MySQL/TestCreation.php
  34. 0
    1
      tests/cases/Db/MySQL/TestDatabase.php
  35. 1
    1
      tests/cases/Db/MySQLPDO/TestCreation.php
  36. 0
    1
      tests/cases/Db/MySQLPDO/TestDatabase.php
  37. 1
    1
      tests/cases/Db/PostgreSQL/TestCreation.php
  38. 0
    1
      tests/cases/Db/PostgreSQL/TestDatabase.php
  39. 1
    1
      tests/cases/Db/PostgreSQLPDO/TestCreation.php
  40. 0
    1
      tests/cases/Db/PostgreSQLPDO/TestDatabase.php
  41. 0
    1
      tests/cases/Db/SQLite3/TestDatabase.php
  42. 0
    1
      tests/cases/Db/SQLite3PDO/TestDatabase.php
  43. 2
    0
      tests/cases/ImportExport/TestImportExport.php
  44. 0
    0
      tests/cases/Lang/TestComplex.php
  45. 115
    0
      tests/cases/Misc/TestQuery.php
  46. 17
    0
      tests/cases/Misc/TestURL.php
  47. 6
    0
      tests/cases/Misc/TestValueInfo.php
  48. 47
    0
      tests/cases/Service/TestSerial.php
  49. 41
    0
      tests/cases/Service/TestService.php
  50. 48
    0
      tests/cases/Service/TestSubprocess.php
  51. 50
    0
      tests/cases/TestArsse.php
  52. 0
    7
      tests/cases/User/TestUser.php
  53. 2
    2
      tests/lib/AbstractTest.php
  54. 5
    1
      tests/lib/Lang/Setup.php
  55. 0
    15
      tests/lib/Lang/TestLang.php
  56. 13
    0
      tests/lib/Service.php
  57. 4
    0
      tests/phpunit.dist.xml
  58. 116
    113
      vendor-bin/csfixer/composer.lock
  59. 1
    1
      vendor-bin/daux/composer.json
  60. 109
    41
      vendor-bin/daux/composer.lock
  61. 89
    92
      vendor-bin/phpunit/composer.lock
  62. 67
    67
      vendor-bin/robo/composer.lock

+ 2
- 1
CHANGELOG View File

@@ -1,8 +1,9 @@
Version 0.8.1 (2019-??-??)
Version 0.8.1 (2019-10-28)
==========================

Bug fixes:
- Don't crash updating feeds cached solely via ETag
- Don't fail importing new folders from OPML files
- Don't fail adding a feed which collides with another via redirection
- Don't fail on very long text-search queries containing question marks
when using PostgreSQL or MySQL

+ 2
- 4
README.md View File

@@ -6,7 +6,7 @@ Information on how to install and use the software can be found in [the manual](

# Installing from source

The main repository for The Arsse can be found at [code.mensbeam.com](https://code.mensbeam.com/MensBeam/arsse/), with a mirror also available [at GitHub](https://github.com/meansbeam/arsse/). The main repository is preferred, as the GitHub mirror can sometimes be out of date.
The main repository for The Arsse can be found at [code.mensbeam.com](https://code.mensbeam.com/MensBeam/arsse/), with a mirror also available [at GitHub](https://github.com/mensbeam/arsse/). The main repository is preferred, as the GitHub mirror can sometimes be out of date.

[Composer](https://getcomposer.org/) is required to manage PHP dependencies. After cloning the repository or downloading a source code tarball, running `composer install` will download all the required dependencies, and will advise if any PHP extensions need to be installed. If not installing as a programming environment, running `composer install --no-dev` is recommended.

@@ -88,7 +88,7 @@ There is also a `test:quick` Robo task which excludes slower tests, and a `test:

### Test coverage

Computing the coverage of tests can be done by running `./robo coverage`. Either [phpdbg](https://php.net/manual/en/book.phpdbg.php) or [Xdebug](https://xdebug.org) is required for this. An HTML-format coverage report will be written to `/tests/coverage/`.
Computing the coverage of tests can be done by running `./robo coverage`, after which an HTML-format coverage report will be written to `/tests/coverage/`. Either [Xdebug](https://xdebug.org) or [phpdbg](https://php.net/manual/en/book.phpdbg.php) is required for this. Xdebug is generally recommended as it is better maintained, though phpdbg is significantly faster. If using Xdebug, the extension need not be enabled globally; PHPUnit will enable it when needed.

## Enforcing coding style

@@ -105,8 +105,6 @@ The Arsse's user manual, made using [Daux](https://daux.io/), can be compiled by

The manual employs a custom theme derived from the standard Daux theme. If the standard Daux theme receives improvements, the custom theme can be rebuilt by running `./robo manual:theme`. This requires that [NodeJS](https://nodejs.org) and [Yarn](https://yarnpkg.com/) be installed, but JavaScript tools are not required to modify The Arsse itself, nor the content of the manual.

The Robo task `manual:css` will recompile the theme's stylesheet without rebuilding the entire theme.

## Packaging a release

Producing a release package is done by running `./robo package`. This performs the following operations:

+ 11
- 68
RoboFile.php View File

@@ -5,6 +5,7 @@ use Robo\Result;
const BASE = __DIR__.\DIRECTORY_SEPARATOR;
const BASE_TEST = BASE."tests".\DIRECTORY_SEPARATOR;
define("IS_WIN", defined("PHP_WINDOWS_VERSION_MAJOR"));
define("IS_MAC", php_uname("s") === "Darwin");

function norm(string $path): string {
$out = realpath($path);
@@ -92,12 +93,13 @@ class RoboFile extends \Robo\Tasks {
$dbg = dirname(\PHP_BINARY)."\\phpdbg.exe";
$dbg = file_exists($dbg) ? $dbg : "";
} else {
$dbg = trim(`which phpdbg`);
$dbg = trim(`which phpdbg 2>/dev/null`);
}
if ($dbg) {
return escapeshellarg($dbg)." -qrr";
} else {
return escapeshellarg(\PHP_BINARY);
$ext = IS_WIN ? "dll" : (IS_MAC ? "dylib" : "so");
return escapeshellarg(\PHP_BINARY)." -d zend_extension=xdebug.$ext";
}
}

@@ -196,6 +198,7 @@ class RoboFile extends \Robo\Tasks {
$execpath = escapeshellarg(norm(BASE."vendor/bin/daux"));
$t = $this->collectionBuilder();
$t->taskExec($execpath)->arg("generate")->option("-d", BASE."manual")->args($args);
$t->taskDeleteDir(BASE."manual/daux_libraries");
$t->taskDeleteDir(BASE."manual/theme");
$t->taskDeleteDir(BASE."manual/themes/src");
return $t->run();
@@ -213,80 +216,20 @@ class RoboFile extends \Robo\Tasks {
* Daux's theme changes
*/
public function manualTheme(array $args): Result {
$languages = ["php", "bash", "shell", "xml", "nginx", "apache"];
$postcss = escapeshellarg(norm(BASE."node_modules/.bin/postcss"));
$themesrc = norm(BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
$themeout = norm(BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
$dauxjs = norm(BASE."vendor-bin/daux/vendor/daux/daux.io/themes/daux/js/").\DIRECTORY_SEPARATOR;
// start a collection; this stops after the first failure
$t = $this->collectionBuilder();
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
// rebuild the stylesheet
$t->addCode([$this, "manualCss"]);
// copy JavaScript files from the Daux theme
foreach (glob($dauxjs."daux*") as $file) {
$t->taskFilesystemStack()->copy($file, $themeout.basename($file), true);
}
// download highlight.js
$t->addCode(function() use ($languages, $tmp, $themeout) {
// compile the list of desired language (enumerated above) into an application/x-www-form-urlencoded body
$post = http_build_query((function($langs) {
$out = [];
foreach ($langs as $l) {
$out[$l.".js"] = "on";
}
return $out;
})($languages));
// get the two cross-site request forgery tokens the Highlight.js Web site requires
$conn = @fopen("https://highlightjs.org/download/", "r");
if ($conn === false) {
throw new Exception("Unable to download Highlight.js");
}
foreach (stream_get_meta_data($conn)['wrapper_data'] as $field) {
if (preg_match("/^Set-Cookie: csrftoken=([^;]+)/i", $field, $cookie)) {
break;
}
}
$token = stream_get_contents($conn);
preg_match("/<input type='hidden' name='csrfmiddlewaretoken' value='([^']*)'/", $token, $token);
// add the form CSRF token to the POST body
$post = "csrfmiddlewaretoken={$token[1]}&$post";
// download a copy of Highlight.js with the desired languages to a temporary file
$hljs = @file_get_contents("https://highlightjs.org/download/", false, stream_context_create(['http' => [
'method' => "POST",
'content' => $post,
'header' => [
"Referer: https://highlightjs.org/download/",
"Cookie: csrftoken={$cookie[1]}",
"Content-Type: application/x-www-form-urlencoded",
],
]]));
if ($hljs === false) {
throw new Exception("Unable to download Highlight.js");
} else {
file_put_contents($tmp."highlightjs.zip", $hljs);
}
// extract the downloaded zip file and keep only the JS file
$this->taskExtract($tmp."highlightjs.zip")->to($tmp."hljs")->run();
$this->taskFilesystemStack()->copy($tmp."hljs".\DIRECTORY_SEPARATOR."highlight.pack.js", $themeout."highlight.pack.js")->run();
}, "downloadHighlightjs");
// execute the collection
return $t->run();
}

/** Rebuilds the manual theme's stylesheet only
*
* This requires Node and Yarn to be installed.
*/
public function manualCss(): Result {
// start a collection; this stops after the first failure
$t = $this->collectionBuilder();
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
// install dependencies via Yarn
$t->taskExec("yarn install");
// compile the stylesheet
$postcss = escapeshellarg(norm(BASE."node_modules/.bin/postcss"));
$themesrc = norm(BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
$themeout = norm(BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
$t->taskExec($postcss)->arg($themesrc."arsse.scss")->option("-o", $themeout."arsse.css");
// copy JavaScript files from the Daux theme
foreach (glob($dauxjs."daux*.js") as $file) {
$t->taskFilesystemStack()->copy($file, $themeout.basename($file), true);
}
// execute the collection
return $t->run();
}

+ 6
- 5
composer.lock View File

@@ -347,16 +347,16 @@
},
{
"name": "zendframework/zend-diactoros",
"version": "2.1.3",
"version": "2.1.5",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
"reference": "279723778c40164bcf984a2df12ff2c6ec5e61c1"
"reference": "6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/279723778c40164bcf984a2df12ff2c6ec5e61c1",
"reference": "279723778c40164bcf984a2df12ff2c6ec5e61c1",
"url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c",
"reference": "6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c",
"shasum": ""
},
"require": {
@@ -369,6 +369,7 @@
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"ext-curl": "*",
"ext-dom": "*",
"ext-libxml": "*",
"http-interop/http-factory-tests": "^0.5.0",
@@ -409,7 +410,7 @@
"psr",
"psr-7"
],
"time": "2019-07-10T16:13:25+00:00"
"time": "2019-10-10T17:38:20+00:00"
},
{
"name": "zendframework/zend-httphandlerrunner",

+ 1
- 1
docs/en/020_Getting_Started/040_Database_Setup/010_PostgreSQL.md View File

@@ -22,7 +22,7 @@ sudo -u postgres psql -c "CREATE USER arsseuser WITH PASSWORD 'super secret pass
sudo -u postgres psql -c "CREATE DATABASE arssedb WITH OWNER arsseuser"
```

Tha Arsse must then be configured to use the created database. A suitable [configuration file](/en/Getting_Started/Configuration) might look like this:
The Arsse must then be configured to use the created database. A suitable [configuration file](/en/Getting_Started/Configuration) might look like this:

```php
<?php

+ 2
- 2
docs/en/020_Getting_Started/040_Database_Setup/020_MySQL.md View File

@@ -15,7 +15,7 @@ While MySQL can be used as a database for The Arsse, this is **not recommended**

You are therefore strongly advised not to use MySQL. Though our MySQL test suite ensures functionally identical behaviour to SQLite and PostgreSQL for the supplied test data in a default MySQL configuration, there are [many other subtle ways in which it can fail](https://grimoire.ca/mysql/choose-something-else), and we do not have the manpower to account for most of these with certainty.

Also please note that as of this writing MariaDB cannot be used in place of MySQL as it lacks features of MySQL 8 which The Arsse requires. The awkwardly-named [_Percona Server for MySQL_](https://www.percona.com/software/mysql-database/percona-server), on the other hand, should work, though this has not been tested.
Also please note that as of this writing MariaDB cannot be used in place of MySQL as it lacks features of MySQL 8 which The Arsse requires. The awkwardly-named [_Percona Server for MySQL_](https://www.percona.com/software/mysql-database/percona-server), on the other hand, will work.

# Set-up

@@ -27,7 +27,7 @@ sudo mysql -e "CREATE DATABASE arssedb"
sudo mysql -e "GRANT ALL ON arssedb.* TO 'arsseuser'@'localhost'"
```

Tha Arsse must then be configured to use the created database. A suitable [configuration file](/en/Getting_Started/Configuration) might look like this:
The Arsse must then be configured to use the created database. A suitable [configuration file](/en/Getting_Started/Configuration) might look like this:

```php
<?php

+ 1
- 1
docs/en/020_Getting_Started/050_Configuration.md View File

@@ -321,7 +321,7 @@ It is also possible to specify the fully-qualified name of a class which impleme

The interval the newsfeed fetching service observes between checks for new articles. Note that requests to foreign servers are not necessarily made at this frequency: each newsfeed is assigned its own time at which to be next retrieved. This setting instead defines the length of time the fetching service will sleep between periods of activity.

Consult "[How Often Newsfeeds Are Fetched](/en/Using_The_Arsse/Keeping_Newsfeeds_Up_to_Date#page_Appendix-How-Often-Newsfeeds-Are-Fetched)" for details on how often newsfeeds are fetched.
Consult "[How Often Newsfeeds Are Fetched](/en/Using_The_Arsse/Keeping_Newsfeeds_Up_to_Date#page_Appendix-how-often-newsfeeds-are-fetched)" for details on how often newsfeeds are fetched.

### serviceQueueWidth


+ 1
- 1
docs/en/020_Getting_Started/index.md View File

@@ -1,3 +1,3 @@
Presently installing and setting up The Arsse is a manual process. We hope to have pre-configured installation packages available for various operating systems eventually, but for now the pages in this section should help get you up and running.

Though The Arsse itself makes no assumptions about the operating system which hosts it, we use and have the most experience with Debian; the instructions contained here therefore are for Debian systems will will probably either not work with other systems or not be consistent with their conventions. Nevertheless, they should still serve as a useful guide.
Though The Arsse itself makes no assumptions about the operating system which hosts it, we use and have the most experience with Debian; the instructions contained here therefore are for Debian systems and will probably either not work with other systems or not be consistent with their conventions. Nevertheless, they should still serve as a useful guide.

+ 1
- 1
docs/en/025_Using_The_Arsse/030_Keeping_Newsfeeds_Up_to_Date.md View File

@@ -32,7 +32,7 @@ sudo crontab -u www-data -e

And add a line such as this one:

```cron
```
*/2 * * * * /usr/bin/env php /usr/share/arsse/arsse.php refresh-all
```


+ 1
- 1
docs/theme/arsse/arsse.css
File diff suppressed because it is too large
View File


+ 1
- 2
docs/theme/arsse/config.json View File

@@ -1,8 +1,7 @@
{
"favicon": "<theme_url>favicon.png",
"js": [
"<theme_url>highlight.pack.js",
"<theme_url>daux.js"
"<theme_url>daux.min.js"
],
"css": [
"<theme_url>arsse.css"

+ 0
- 182
docs/theme/arsse/daux.js View File

@@ -1,182 +0,0 @@
/** global localStorage, hljs */

if (hljs) {
hljs.initHighlightingOnLoad();
}

(function() {
var codeBlocks = document.querySelectorAll(".s-content pre");
var toggleCodeSection = document.querySelector(".CodeToggler");
if (!toggleCodeSection) {
return;
} else if (!codeBlocks.length) {
toggleCodeSection.classList.add("Hidden");
return;
}

var toggleCodeBlockBtnList = toggleCodeSection.querySelectorAll(".CodeToggler__button");
var toggleCodeBlockBtnSet = toggleCodeSection.querySelector(".CodeToggler__button--main"); // available when floating is disabled
var toggleCodeBlockBtnHide = toggleCodeSection.querySelector(".CodeToggler__button--hide");
var toggleCodeBlockBtnBelow = toggleCodeSection.querySelector(".CodeToggler__button--below");
var toggleCodeBlockBtnFloat = toggleCodeSection.querySelector(".CodeToggler__button--float");
var codeBlockView = document.querySelector(".Columns__right");
var floating = document.body.classList.contains("with-float");

function setCodeBlockStyle(codeBlockState) {
for (var a = 0; a < toggleCodeBlockBtnList.length; a++) {
toggleCodeBlockBtnList[a].classList.remove("Button--active");
}
switch (codeBlockState) {
case true: // Show code blocks below (flowed); checkbox
var hidden = false;
break;
case false: // Hidden code blocks; checkbox
var hidden = true;
break;
case 2: // Show code blocks inline (floated)
toggleCodeBlockBtnFloat.classList.add("Button--active");
codeBlockView.classList.add("Columns__right--float");
codeBlockView.classList.remove("Columns__right--full");
var hidden = false;
break;
case 1: // Show code blocks below (flowed)
case "checked":
toggleCodeBlockBtnBelow.classList.add("Button--active");
codeBlockView.classList.remove("Columns__right--float");
codeBlockView.classList.add("Columns__right--full");
var hidden = false;
break;
case 0: // Hidden code blocks
default:
toggleCodeBlockBtnHide.classList.add("Button--active");
codeBlockView.classList.remove("Columns__right--float");
codeBlockView.classList.add("Columns__right--full");
var hidden = true;
break;
}
for (var a = 0; a < codeBlocks.length; a++) {
if (hidden) {
codeBlocks[a].classList.add("Hidden");
} else {
codeBlocks[a].classList.remove("Hidden");
}
}
try {
localStorage.setItem("codeBlockState", +codeBlockState);
} catch (e) {
// local storage operations can fail with the file:// protocol
}
}
if (!floating) {
toggleCodeBlockBtnSet.addEventListener("change", function(ev) {setCodeBlockStyle(ev.target.checked);}, false);
} else {
toggleCodeBlockBtnHide.addEventListener("click", function() {setCodeBlockStyle(0);}, false);
toggleCodeBlockBtnBelow.addEventListener("click", function() {setCodeBlockStyle(1);}, false);
toggleCodeBlockBtnFloat.addEventListener("click", function() {setCodeBlockStyle(2);}, false);
}

try {
var codeBlockState = localStorage.getItem("codeBlockState");
} catch (e) {
// local storage operations can fail with the file:// protocol
var codeBlockState = null;
}
if (!codeBlockState) {
codeBlockState = floating ? 2 : 1;
} else {
codeBlockState = parseInt(codeBlockState);
}
if (!floating) {
codeBlockState = !!codeBlockState;
}

setCodeBlockStyle(codeBlockState);
})();

(function() {
function debounce(func, wait) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
};

clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
};

var navItems = document.querySelectorAll('.Nav__item.has-children i.Nav__arrow');

function _toggleSubMenu(ev) {
if (ev.preventDefault !== undefined) {
ev.preventDefault();
}

var parent = ev.target.parentNode.parentNode;
var subNav = parent.querySelector('ul.Nav');

if (ev.preventDefault !== undefined && parent.classList.contains('Nav__item--open')) {
// Temporarily set the height so the transition can work.
subNav.style.height = subNav.scrollHeight + 'px';
subNav.style.transitionDuration = Math.max(subNav.scrollHeight, 150) + 'ms';
subNav.style.height = '0px';
parent.classList.remove('Nav__item--open');
} else {
if (ev.preventDefault !== undefined) {
subNav.style.transitionDuration = Math.max(subNav.scrollHeight, 150) + 'ms';
// After the transition finishes set the height to auto so child
// menus can expand properly.
subNav.addEventListener('transitionend', _setHeightToAuto);
subNav.style.height = subNav.scrollHeight + 'px';
parent.classList.add('Nav__item--open');
} else {
// When running at page load the transitions don't need to fire and
// the classList doesn't need to be altered.
subNav.style.height = 'auto';
}
}
}

function _setHeightToAuto(ev) {
if (ev.target.style.height !== '0px') {
ev.target.style.height = 'auto';
}

ev.target.removeEventListener('transitionend', _setHeightToAuto);
}

// Go in reverse here because on page load the child nav items need to be
// opened first before their parents so the height on the parents can be
// calculated properly.
for (var i = navItems.length - 1, cur; i >= 0; i--) {
cur = navItems[i];
cur.addEventListener('click', _toggleSubMenu);

if (cur.parentNode.parentNode.classList.contains('Nav__item--open')) {
_toggleSubMenu({ target: cur });
}
}
})();

(function() {
var trigger = document.querySelector('.Collapsible__trigger');

if (!trigger) {
return;
}

content = document.querySelector('.Collapsible__content');

trigger.addEventListener('click', function(ev) {
if (content.classList.contains('Collapsible__content--open')) {
content.style.height = 0;
content.classList.remove('Collapsible__content--open');
} else {
content.style.transitionDuration = Math.max(content.scrollHeight, 150) + 'ms';
content.style.height = content.scrollHeight + 'px';
content.classList.add('Collapsible__content--open');
}
});
})();

+ 2
- 0
docs/theme/arsse/daux.min.js View File

@@ -0,0 +1,2 @@
var e=document.querySelectorAll(".s-content pre"),t=document.querySelector(".CodeToggler"),n="daux_code_blocks_hidden";function a(t){for(var a=0;a<e.length;a++)e[a].classList.toggle("Hidden",t);try{localStorage.setItem(n,t)}catch(e){}}t&&(e.length?function(){var e=t.querySelector(".CodeToggler__button--main");e.addEventListener("change",(function(e){a(!e.target.checked)}),!1);var r=!1;try{"false"===(r=localStorage.getItem(n))?r=!1:"true"===r&&(r=!0),r&&(a(!!r),e.checked=!r)}catch(e){}}():t.classList.add("Hidden"));var r=document.querySelector(".Collapsible__trigger");if(r){var o=document.querySelector(".Collapsible__content");r.addEventListener("click",(function(e){o.classList.contains("Collapsible__content--open")?(o.style.height=0,o.classList.remove("Collapsible__content--open"),r.setAttribute("aria-expanded","false")):(r.setAttribute("aria-expanded","true"),o.style.transitionDuration="150ms",o.style.height="".concat(o.scrollHeight,"px"),o.classList.add("Collapsible__content--open"))}))}var l=document.querySelectorAll("pre > code:not(.hljs)");if(l.length){var i=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.async=!0,c.src="".concat(window.base_url,"daux_libraries/highlight.pack.js"),c.onload=function(e){[].forEach.call(l,window.hljs.highlightBlock)},i.appendChild(c)}function s(e){var t=void 0!==e.preventDefault;t&&e.preventDefault();var n=function(e){for(var t=e;(t=t.parentNode)&&9!==t.nodeType;)if(1===t.nodeType&&t.classList.contains("Nav__item"))return t;throw new Error("Could not find a NavItem...")}(e.target),a=n.querySelector("ul.Nav");t&&n.classList.contains("Nav__item--open")?(a.style.height="".concat(a.scrollHeight,"px"),a.style.transitionDuration="150ms",a.style.height="0px",n.classList.remove("Nav__item--open")):t?(a.style.transitionDuration="150ms",a.addEventListener("transitionend",(function e(t){"0px"!==t.target.style.height&&(t.target.style.height="auto"),t.target.removeEventListener("transitionend",e)})),a.style.height="".concat(a.scrollHeight,"px"),n.classList.add("Nav__item--open")):a.style.height="auto"}for(var d,u=document.querySelectorAll(".Nav__item.has-children i.Nav__arrow"),h=u.length-1;h>=0;h--)(d=u[h]).addEventListener("click",s),d.parentNode.parentNode.classList.contains("Nav__item--open")&&s({target:d});var g=document.querySelectorAll(".Nav__item__link--nopage"),v=!0,p=!1,_=void 0;try{for(var y,m=g[Symbol.iterator]();!(v=(y=m.next()).done);v=!0){y.value.addEventListener("click",s)}}catch(e){p=!0,_=e}finally{try{v||null==m.return||m.return()}finally{if(p)throw _}}
//# sourceMappingURL=daux.min.js.map

+ 0
- 2
docs/theme/arsse/highlight.pack.js
File diff suppressed because it is too large
View File


+ 8
- 8
docs/theme/src/arsse.scss View File

@@ -1,12 +1,12 @@
/* Daux imports; fonts are omitted */
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/vendor/normalize.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_variables.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_mixins.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_structure.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_typography.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_components.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_homepage.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/themes/daux/scss/_print.scss" print;
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/vendor/normalize.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_variables.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_mixins.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_structure.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_typography.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_components.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_homepage.scss";
@import "../../../vendor-bin/daux/vendor/daux/daux.io/src/css/theme_daux/_print.scss" print;




+ 1
- 1
lib/Arsse.php View File

@@ -7,7 +7,7 @@ declare(strict_types=1);
namespace JKingWeb\Arsse;

class Arsse {
const VERSION = "0.8.0";
const VERSION = "0.8.1";

/** @var Lang */
public static $lang;

+ 2
- 2
lib/CLI.php View File

@@ -206,7 +206,7 @@ USAGE_TEXT;
$this->logError($e->getMessage());
return $e->getCode();
}
}
} // @codeCoverageIgnore

/** @codeCoverageIgnore */
protected function logError(string $msg) {
@@ -248,7 +248,7 @@ USAGE_TEXT;
case "":
return $this->userList();
}
}
} // @codeCoverageIgnore

protected function userAddOrSetPassword(string $method, string $user, string $password = null, string $oldpass = null): int {
$passwd = Arsse::$user->$method(...array_slice(func_get_args(), 1));

+ 3
- 0
lib/Conf.php View File

@@ -264,6 +264,7 @@ class Conf {
$type |= Value::M_NULL;
}
} else {
// catch-all for custom properties
$type = Value::T_MIXED; // @codeCoverageIgnore
}
$out[$p->name] = ['name' => $match[0], 'const' => $type];
@@ -286,6 +287,7 @@ class Conf {
}
switch (self::EXPECTED_TYPES[$key] ?? gettype($this->$key)) {
case "integer":
// no properties are currently typed as integers
return Value::normalize($value, Value::T_INT | $mode); // @codeCoverageIgnore
case "double":
return Value::normalize($value, Value::T_FLOAT | $mode);
@@ -293,6 +295,7 @@ class Conf {
case "object":
return $value;
default:
// this should never occur
throw new Conf\Exception("ambiguousDefault", ['param' => $key]); // @codeCoverageIgnore
}
}

+ 0
- 15
lib/Database.php View File

@@ -78,21 +78,6 @@ class Database {
return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];
}

/** Lists the available database drivers, as an associative array with
* fully-qualified class names as keys, and human-readable descriptions as values
*/
public static function driverList(): array {
$sep = \DIRECTORY_SEPARATOR;
$path = __DIR__.$sep."Db".$sep;
$classes = [];
foreach (glob($path."*".$sep."Driver.php") as $file) {
$name = basename(dirname($file));
$class = NS_BASE."Db\\$name\\Driver";
$classes[$class] = $class::driverName();
}
return $classes;
}

/** Returns the current (actual) schema version of the database; compared against self::SCHEMA_VERSION to know when an upgrade is required */
public function driverSchemaVersion(): int {
return $this->db->schemaVersion();

+ 16
- 29
lib/Db/AbstractStatement.php View File

@@ -46,23 +46,14 @@ abstract class AbstractStatement implements Statement {
return $query;
}

public function retypeArray(array $bindings, bool $append = false): bool {
if (!$append) {
$this->types = [];
}
foreach ($bindings as $binding) {
if (is_array($binding)) {
// recursively flatten any arrays, which may be provided for SET or IN() clauses
$this->retypeArray($binding, true);
} else {
$bindId = self::TYPES[trim(strtolower($binding))] ?? 0;
assert($bindId, new Exception("paramTypeInvalid", $binding));
$this->types[] = $bindId;
}
}
if (!$append) {
$this->prepare(static::mungeQuery($this->query, $this->types));
public function retypeArray(array $bindings): bool {
$this->types = [];
foreach (ValueInfo::flatten($bindings) as $binding) { // recursively flatten any arrays, which may be provided for SET or IN() clauses
$bindId = self::TYPES[trim(strtolower($binding))] ?? 0;
assert($bindId, new Exception("paramTypeInvalid", $binding));
$this->types[] = $bindId;
}
$this->prepare(static::mungeQuery($this->query, $this->types));
return true;
}

@@ -79,26 +70,22 @@ abstract class AbstractStatement implements Statement {
}
}

protected function bindValues(array $values, int $offset = null): int {
$a = (int) $offset;
foreach ($values as $value) {
if (is_array($value)) {
// recursively flatten any arrays, which may be provided for SET or IN() clauses
$a += $this->bindValues($value, $a);
} elseif (array_key_exists($a, $this->types)) {
protected function bindValues(array $values): bool {
// recursively flatten any arrays, which may be provided for SET or IN() clauses
$values = ValueInfo::flatten($values);
foreach ($values as $a => $value) {
if (array_key_exists($a, $this->types)) {
$value = $this->cast($value, $this->types[$a]);
$this->bindValue($value, $this->types[$a] % self::T_NOT_NULL, ++$a);
} else {
throw new Exception("paramTypeMissing", $a+1);
}
}
// once the last value is bound, check that all parameters have been supplied values and bind null for any missing ones
// once all values are bound, check that all parameters have been supplied values and bind null for any missing ones
// SQLite will happily substitute null for a missing value, but other engines (viz. PostgreSQL) produce an error
if (is_null($offset)) {
while ($a < sizeof($this->types)) {
$this->bindValue(null, $this->types[$a] % self::T_NOT_NULL, ++$a);
}
for ($a = sizeof($values); $a < sizeof($this->types); $a++) {
$this->bindValue(null, $this->types[$a] % self::T_NOT_NULL, $a + 1);
}
return $a - $offset;
return true;
}
}

+ 2
- 0
lib/Db/SQLite3/AbstractPDODriver.php View File

@@ -7,5 +7,7 @@ declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;

abstract class AbstractPDODriver extends Driver {
// this class exists solely so SQLite's PDO driver can call methods of the generic PDO driver via parent::method()
// if there's a better way to do this, please FIXME ;)
use \JKingWeb\Arsse\Db\PDODriver;
}

+ 4
- 4
lib/ImportExport/AbstractImportExport.php View File

@@ -57,7 +57,7 @@ abstract class AbstractImportExport {
}
if (!isset($folderMap[$id])) {
// if no existing folder exists, add one
$folderMap[$id] = Arsse::$db->folderAdd($user, ['name' => $f['name'], 'parent' -> $parent]);
$folderMap[$id] = Arsse::$db->folderAdd($user, ['name' => $f['name'], 'parent' => $parent]);
}
}
// process newsfeed subscriptions
@@ -118,21 +118,21 @@ abstract class AbstractImportExport {
foreach (array_diff(array_column($feedsDb, "id"), $feedMap) as $id) {
try {
Arsse::$db->subscriptionRemove($user, $id);
} catch (InputException $e) {
} catch (InputException $e) { // @codeCoverageIgnore
// ignore errors
}
}
foreach (array_diff(array_column($foldersDb, "id"), $folderMap) as $id) {
try {
Arsse::$db->folderRemove($user, $id);
} catch (InputException $e) {
} catch (InputException $e) { // @codeCoverageIgnore
// ignore errors
}
}
foreach (array_diff(array_column($tagsDb, "name"), array_keys($tagMap)) as $id) {
try {
Arsse::$db->tagRemove($user, $id, true);
} catch (InputException $e) {
} catch (InputException $e) { // @codeCoverageIgnore
// ignore errors
}
}

+ 24
- 22
lib/Misc/Query.php View File

@@ -29,61 +29,63 @@ class Query {
$this->setBody($body, $types, $values);
}

public function setBody(string $body = "", $types = null, $values = null): bool {
public function setBody(string $body = "", $types = null, $values = null): self {
$this->qBody = $body;
if (!is_null($types)) {
$this->tBody[] = $types;
$this->vBody[] = $values;
}
return true;
return $this;
}

public function setCTE(string $tableSpec, string $body, $types = null, $values = null): bool {
public function setCTE(string $tableSpec, string $body, $types = null, $values = null): self {
$this->qCTE[] = "$tableSpec as ($body)";
if (!is_null($types)) {
$this->tCTE[] = $types;
$this->vCTE[] = $values;
}
return true;
return $this;
}

public function setWhere(string $where, $types = null, $values = null): bool {
public function setWhere(string $where, $types = null, $values = null): self {
$this->qWhere[] = $where;
if (!is_null($types)) {
$this->tWhere[] = $types;
$this->vWhere[] = $values;
}
return true;
return $this;
}

public function setWhereNot(string $where, $types = null, $values = null): bool {
public function setWhereNot(string $where, $types = null, $values = null): self {
$this->qWhereNot[] = $where;
if (!is_null($types)) {
$this->tWhereNot[] = $types;
$this->vWhereNot[] = $values;
}
return true;
return $this;
}

public function setGroup(string ...$column): bool {
public function setGroup(string ...$column): self {
foreach ($column as $col) {
$this->group[] = $col;
}
return true;
return $this;
}

public function setOrder(string $order): bool {
$this->order[] = $order;
return true;
public function setOrder(string ...$order): self {
foreach ($order as $o) {
$this->order[] = $o;
}
return $this;
}

public function setLimit(int $limit, int $offset = 0): bool {
public function setLimit(int $limit, int $offset = 0): self {
$this->limit = $limit;
$this->offset = $offset;
return true;
return $this;
}

public function pushCTE(string $tableSpec): bool {
public function pushCTE(string $tableSpec): self {
// this function takes the query body and converts it to a common table expression, putting it at the bottom of the existing CTE stack
// all WHERE, ORDER BY, and LIMIT parts belong to the new CTE and are removed from the main query
$this->setCTE($tableSpec, $this->buildQueryBody(), [$this->tBody, $this->tWhere, $this->tWhereNot], [$this->vBody, $this->vWhere, $this->vWhereNot]);
@@ -98,7 +100,7 @@ class Query {
$this->order = [];
$this->group = [];
$this->setLimit(0, 0);
return true;
return $this;
}

public function __toString(): string {
@@ -117,11 +119,11 @@ class Query {
}

public function getTypes(): array {
return [$this->tCTE, $this->tBody, $this->tWhere, $this->tWhereNot];
return ValueInfo::flatten([$this->tCTE, $this->tBody, $this->tWhere, $this->tWhereNot]);
}

public function getValues(): array {
return [$this->vCTE, $this->vBody, $this->vWhere, $this->vWhereNot];
return ValueInfo::flatten([$this->vCTE, $this->vBody, $this->vWhere, $this->vWhereNot]);
}

protected function buildQueryBody(): string {
@@ -144,9 +146,9 @@ class Query {
if (sizeof($this->order)) {
$out .= " ORDER BY ".implode(", ", $this->order);
}
// add LIMIT and OFFSET if the former is specified
if ($this->limit > 0) {
$out .= " LIMIT ".$this->limit;
// add LIMIT and OFFSET if either is specified
if ($this->limit > 0 || $this->offset > 0) {
$out .= " LIMIT ".($this->limit < 1 ? -1 : $this->limit);
if ($this->offset > 0) {
$out .= " OFFSET ".$this->offset;
}

+ 1
- 1
lib/Misc/URL.php View File

@@ -145,7 +145,7 @@ class URL {
}

/** Appends data to a URL's query component
*
*
* @param string $url The input URL
* @param string $data The data to append. This should already be escaped where necessary and not start with any delimiter
* @param string $glue The query subcomponent delimiter, usually "&". If the URL has no query, "?" will be prepended instead

+ 11
- 0
lib/Misc/ValueInfo.php View File

@@ -397,6 +397,17 @@ class ValueInfo {
}
}

public static function flatten(array $arr): array {
$arr = array_values($arr);
for ($a = 0; $a < sizeof($arr); $a++) {
if (is_array($arr[$a])) {
array_splice($arr, $a, 1, $arr[$a]);
$a--;
}
}
return $arr;
}

public static function int($value): int {
$out = 0;
if (is_null($value)) {

+ 2
- 1
lib/REST/Fever/API.php View File

@@ -209,7 +209,8 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
// indexed arrays
$p->appendChild($this->makeXMLIndexed($v, $d->createElement($k), substr($k, 0, strlen($k) - 1)));
} else {
$p->appendChild($this->makeXMLAssoc($v, $d->createElement($k)));
// this case is never encountered with Fever's output
$p->appendChild($this->makeXMLAssoc($v, $d->createElement($k))); // @codeCoverageIgnore
}
}
return $p;

+ 4
- 18
lib/Service.php View File

@@ -12,30 +12,14 @@ class Service {
const DRIVER_NAMES = [
'serial' => \JKingWeb\Arsse\Service\Serial\Driver::class,
'subprocess' => \JKingWeb\Arsse\Service\Subprocess\Driver::class,
'curl' => \JKingWeb\Arsse\Service\Curl\Driver::class,
];

/** @var Service\Driver */
protected $drv;
/** @var \DateInterval */
protected $interval;

public static function driverList(): array {
$sep = \DIRECTORY_SEPARATOR;
$path = __DIR__.$sep."Service".$sep;
$classes = [];
foreach (glob($path."*".$sep."Driver.php") as $file) {
$name = basename(dirname($file));
$class = NS_BASE."User\\$name\\Driver";
$classes[$class] = $class::driverName();
}
return $classes;
}

public function __construct() {
$driver = Arsse::$conf->serviceDriver;
$this->drv = new $driver();
$this->interval = Arsse::$conf->serviceFrequency;
}

public function watch(bool $loop = true): \DateTimeInterface {
@@ -46,17 +30,19 @@ class Service {
$list = Arsse::$db->feedListStale();
if ($list) {
$this->drv->queue(...$list);
unset($list);
$this->drv->exec();
$this->drv->clean();
unset($list);
}
static::cleanupPost();
$t->add($this->interval);
$t->add(Arsse::$conf->serviceFrequency);
// @codeCoverageIgnoreStart
if ($loop) {
do {
@time_sleep_until($t->getTimestamp());
} while ($t->getTimestamp() > time());
}
// @codeCoverageIgnoreEnd
} while ($loop);
return $t;
}

+ 1
- 1
lib/Service/Driver.php View File

@@ -11,5 +11,5 @@ interface Driver {
public static function requirementsMet(): bool;
public function queue(int ...$feeds): int;
public function exec(): int;
public function clean(): bool;
public function clean(): int;
}

+ 3
- 2
lib/Service/Serial/Driver.php View File

@@ -36,8 +36,9 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
return Arsse::$conf->serviceQueueWidth - sizeof($this->queue);
}

public function clean(): bool {
public function clean(): int {
$out = sizeof($this->queue);
$this->queue = [];
return true;
return $out;
}
}

+ 9
- 3
lib/Service/Subprocess/Driver.php View File

@@ -33,7 +33,7 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
$id = (int) array_shift($this->queue);
$php = escapeshellarg(\PHP_BINARY);
$arsse = escapeshellarg($_SERVER['argv'][0]);
array_push($pp, popen("$php $arsse feed refresh $id", "r"));
array_push($pp, $this->execCmd("$php $arsse feed refresh $id"));
}
while ($pp) {
$p = array_pop($pp);
@@ -43,8 +43,14 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
return Arsse::$conf->serviceQueueWidth - sizeof($this->queue);
}

public function clean(): bool {
/** @codeCoverageIgnore */
protected function execCmd(string $cmd) {
return popen($cmd, "r");
}

public function clean(): int {
$out = sizeof($this->queue);
$this->queue = [];
return true;
return $out;
}
}

+ 0
- 12
lib/User.php View File

@@ -20,18 +20,6 @@ class User {
*/
protected $u;

public static function driverList(): array {
$sep = \DIRECTORY_SEPARATOR;
$path = __DIR__.$sep."User".$sep;
$classes = [];
foreach (glob($path."*".$sep."Driver.php") as $file) {
$name = basename(dirname($file));
$class = NS_BASE."User\\$name\\Driver";
$classes[$class] = $class::driverName();
}
return $classes;
}

public function __construct(\JKingWeb\Arsse\User\Driver $driver = null) {
$this->u = $driver ?? new Arsse::$conf->userDriver;
}

+ 0
- 7
tests/cases/Database/SeriesMiscellany.php View File

@@ -19,13 +19,6 @@ trait SeriesMiscellany {
protected function tearDownSeriesMiscellany() {
}

public function testListDrivers() {
$exp = [
'JKingWeb\\Arsse\\Db\\SQLite3\\Driver' => Arsse::$lang->msg("Driver.Db.SQLite3.Name"),
];
$this->assertArraySubset($exp, Database::driverList());
}

public function testInitializeDatabase() {
static::dbRaze(static::$drv);
$d = new Database(true);

+ 1
- 1
tests/cases/Db/MySQL/TestCreation.php View File

@@ -22,7 +22,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest {
public function testFailToConnect() {
// for the sake of simplicity we don't distinguish between failure modes, but the MySQL-supplied error messages do
self::setConf([
'dbMySQLPass' => (string) rand(),
'dbMySQLHost' => "example.invalid",
]);
$this->assertException("connectionFailure", "Db");
new Driver;

+ 0
- 1
tests/cases/Db/MySQL/TestDatabase.php View File

@@ -10,7 +10,6 @@ namespace JKingWeb\Arsse\TestCase\Db\MySQL;
* @group slow
* @group coverageOptional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\MySQL;

+ 1
- 1
tests/cases/Db/MySQLPDO/TestCreation.php View File

@@ -22,7 +22,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest {
public function testFailToConnect() {
// for the sake of simplicity we don't distinguish between failure modes, but the MySQL-supplied error messages do
self::setConf([
'dbMySQLPass' => (string) rand(),
'dbMySQLHost' => "example.invalid",
]);
$this->assertException("connectionFailure", "Db");
new Driver;

+ 0
- 1
tests/cases/Db/MySQLPDO/TestDatabase.php View File

@@ -11,7 +11,6 @@ namespace JKingWeb\Arsse\TestCase\Db\MySQLPDO;
* @group optional
* @group coverageOptional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\MySQLPDO;

+ 1
- 1
tests/cases/Db/PostgreSQL/TestCreation.php View File

@@ -65,7 +65,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest {
public function testFailToConnect() {
// we cannnot distinguish between different connection failure modes
self::setConf([
'dbPostgreSQLPass' => (string) rand(),
'dbPostgreSQLHost' => "example.invalid",
]);
$this->assertException("connectionFailure", "Db");
new Driver;

+ 0
- 1
tests/cases/Db/PostgreSQL/TestDatabase.php View File

@@ -10,7 +10,6 @@ namespace JKingWeb\Arsse\TestCase\Db\PostgreSQL;
* @group slow
* @group coverageOptional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\PostgreSQL;

+ 1
- 1
tests/cases/Db/PostgreSQLPDO/TestCreation.php View File

@@ -65,7 +65,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest {
public function testFailToConnect() {
// PDO dies not distinguish between different connection failure modes
self::setConf([
'dbPostgreSQLPass' => (string) rand(),
'dbPostgreSQLHost' => "example.invalid",
]);
$this->assertException("connectionFailure", "Db");
new Driver;

+ 0
- 1
tests/cases/Db/PostgreSQLPDO/TestDatabase.php View File

@@ -11,7 +11,6 @@ namespace JKingWeb\Arsse\TestCase\Db\PostgreSQLPDO;
* @group optional
* @group coverageOptional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\PostgreSQLPDO;

+ 0
- 1
tests/cases/Db/SQLite3/TestDatabase.php View File

@@ -9,7 +9,6 @@ namespace JKingWeb\Arsse\TestCase\Db\SQLite3;
/**
* @group optional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\SQLite3;

+ 0
- 1
tests/cases/Db/SQLite3PDO/TestDatabase.php View File

@@ -8,7 +8,6 @@ namespace JKingWeb\Arsse\TestCase\Db\SQLite3PDO;

/**
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\AbstractTest {
use \JKingWeb\Arsse\Test\DatabaseDrivers\SQLite3PDO;

+ 2
- 0
tests/cases/ImportExport/TestImportExport.php View File

@@ -212,11 +212,13 @@ class TestImportExport extends \JKingWeb\Arsse\Test\AbstractTest {
['id' => 4, 'name' => "Politics", 'parent' => 0],
['id' => 5, 'name' => "Local", 'parent' => 4],
['id' => 6, 'name' => "National", 'parent' => 4],
['id' => 7, 'name' => "Nature", 'parent' => 0], // new folder
]];
\Phake::when($this->proc)->parse->thenReturn($in);
$this->proc->import("john.doe@example.com", "", false, true);
$exp = $this->primeExpectations($this->data, $this->checkTables);
$exp['arsse_subscriptions']['rows'][3] = [4, "john.doe@example.com", null, 4, "CBC"];
$exp['arsse_folders']['rows'][] = [7, "john.doe@example.com", null, "Nature"];
$this->compareExpectations($this->drv, $exp);
}


tests/cases/Lang/testComplex.php → tests/cases/Lang/TestComplex.php View File


+ 115
- 0
tests/cases/Misc/TestQuery.php View File

@@ -0,0 +1,115 @@
<?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\TestCase\Misc;

use JKingWeb\Arsse\Misc\Query;
use JKingWeb\Arsse\Misc\ValueInfo;

/** @covers \JKingWeb\Arsse\Misc\Query */
class TestQuery extends \JKingWeb\Arsse\Test\AbstractTest {
public function testBasicQuery() {
$q = new Query("select * from table where a = ?", "int", 3);
$this->assertSame("select * from table where a = ?", $q->getQuery());
$this->assertSame(["int"], $q->getTypes());
$this->assertSame([3], $q->getValues());
}

public function testWhereQuery() {
// simple where clause
$q = (new Query("select * from table"))->setWhere("a = ?", "int", 3);
$this->assertSame("select * from table WHERE a = ?", $q->getQuery());
$this->assertSame(["int"], $q->getTypes());
$this->assertSame([3], $q->getValues());
// compound where clause
$q = (new Query("select * from table"))->setWhere("a = ?", "int", 3)->setWhere("b = ?", "str", 4);
$this->assertSame("select * from table WHERE a = ? AND b = ?", $q->getQuery());
$this->assertSame(["int", "str"], $q->getTypes());
$this->assertSame([3, 4], $q->getValues());
// negative where clause
$q = (new Query("select * from table"))->setWhereNot("a = ?", "int", 3);
$this->assertSame("select * from table WHERE NOT (a = ?)", $q->getQuery());
$this->assertSame(["int"], $q->getTypes());
$this->assertSame([3], $q->getValues());
// compound negative where clause
$q = (new Query("select * from table"))->setWhereNot("a = ?", "int", 3)->setWhereNot("b = ?", "str", 4);
$this->assertSame("select * from table WHERE NOT (a = ? OR b = ?)", $q->getQuery());
$this->assertSame(["int", "str"], $q->getTypes());
$this->assertSame([3, 4], $q->getValues());
// mixed where clause
$q = (new Query("select * from table"))->setWhereNot("a = ?", "int", 1)->setWhere("b = ?", "str", 2)->setWhereNot("c = ?", "int", 3)->setWhere("d = ?", "str", 4);
$this->assertSame("select * from table WHERE b = ? AND d = ? AND NOT (a = ? OR c = ?)", $q->getQuery());
$this->assertSame(["str", "str", "int", "int"], $q->getTypes());
$this->assertSame([2, 4, 1, 3], $q->getValues());
}

public function testGroupedQuery() {
$q = (new Query("select col1, col2, count(*) as count from table"))->setGroup("col1", "col2");
$this->assertSame("select col1, col2, count(*) as count from table GROUP BY col1, col2", $q->getQuery());
$this->assertSame([], $q->getTypes());
$this->assertSame([], $q->getValues());
}

public function testOrderedQuery() {
$q = (new Query("select col1, col2, col3 from table"))->setOrder("col1 desc", "col2")->setOrder("col3 asc");
$this->assertSame("select col1, col2, col3 from table ORDER BY col1 desc, col2, col3 asc", $q->getQuery());
$this->assertSame([], $q->getTypes());
$this->assertSame([], $q->getValues());
}

public function testLimitedQuery() {
// no offset
$q = (new Query("select * from table"))->setLimit(5);
$this->assertSame("select * from table LIMIT 5", $q->getQuery());
$this->assertSame([], $q->getTypes());
$this->assertSame([], $q->getValues());
// with offset
$q = (new Query("select * from table"))->setLimit(5, 10);
$this->assertSame("select * from table LIMIT 5 OFFSET 10", $q->getQuery());
$this->assertSame([], $q->getTypes());
$this->assertSame([], $q->getValues());
// no limit with offset
$q = (new Query("select * from table"))->setLimit(0, 10);
$this->assertSame("select * from table LIMIT -1 OFFSET 10", $q->getQuery());
$this->assertSame([], $q->getTypes());
$this->assertSame([], $q->getValues());
}

public function testQueryWithCommonTableExpression() {
$q = (new Query("select * from table where a in (select * from cte where a = ?)", "int", 1))->setCTE("cte", "select * from other_table where a = ? and b = ?", ["str", "str"], [2, 3]);
$this->assertSame("WITH RECURSIVE cte as (select * from other_table where a = ? and b = ?) select * from table where a in (select * from cte where a = ?)", $q->getQuery());
$this->assertSame(["str", "str", "int"], $q->getTypes());
$this->assertSame([2, 3, 1], $q->getValues());
// multiple CTEs
$q = (new Query("select * from table where a in (select * from cte1 join cte2 using (a) where a = ?)", "int", 1))->setCTE("cte1", "select * from other_table where a = ? and b = ?", ["str", "str"], [2, 3])->setCTE("cte2", "select * from other_table where c between ? and ?", ["datetime", "datetime"], [4, 5]);
$this->assertSame("WITH RECURSIVE cte1 as (select * from other_table where a = ? and b = ?), cte2 as (select * from other_table where c between ? and ?) select * from table where a in (select * from cte1 join cte2 using (a) where a = ?)", $q->getQuery());
$this->assertSame(["str", "str", "datetime", "datetime", "int"], $q->getTypes());
$this->assertSame([2, 3, 4, 5, 1], $q->getValues());
}

public function testQueryWithPushedCommonTableExpression() {
$q = (new Query("select * from table1"))->setWhere("a between ? and ?", ["datetime", "datetime"], [1, 2])
->setCTE("cte1", "select * from table2 where a = ? and b = ?", ["str", "str"], [3, 4])
->pushCTE("cte2")
->setBody("select * from table3 join cte1 using (a) join cte2 using (a) where a = ?", "int", 5);
$this->assertSame("WITH RECURSIVE cte1 as (select * from table2 where a = ? and b = ?), cte2 as (select * from table1 WHERE a between ? and ?) select * from table3 join cte1 using (a) join cte2 using (a) where a = ?", $q->getQuery());
$this->assertSame(["str", "str", "datetime", "datetime", "int"], $q->getTypes());
$this->assertSame([3, 4, 1, 2, 5], $q->getValues());
}

public function testComplexQuery() {
$q = (new query("select *, ? as const from table", "datetime", 1))
->setWhereNot("b = ?", "bool", 2)
->setGroup("col1", "col2")
->setWhere("a = ?", "str", 3)
->setLimit(4, 5)
->setOrder("col3")
->setCTE("cte", "select ? as const", "int", 6);
$this->assertSame("WITH RECURSIVE cte as (select ? as const) select *, ? as const from table WHERE a = ? AND NOT (b = ?) GROUP BY col1, col2 ORDER BY col3 LIMIT 4 OFFSET 5", $q->getQuery());
$this->assertSame(["int", "datetime", "str", "bool"], $q->getTypes());
$this->assertSame([6, 1, 3, 2], $q->getValues());
}
}

+ 17
- 0
tests/cases/Misc/TestURL.php View File

@@ -91,4 +91,21 @@ class TestURL extends \JKingWeb\Arsse\Test\AbstractTest {
["/#ack", "", "/#ack"],
];
}

/** @dataProvider provideAbsolutes */
public function testDetermineAbsoluteness(bool $exp, string $url) {
$this->assertSame($exp, URL::absolute($url));
}

public function provideAbsolutes() {
return [
[true, "http://example.com/"],
[true, "HTTP://example.com/"],
[false, "//example.com/"],
[false, "/example"],
[false, "example.com/"],
[false, "example.com"],
[false, "http:///example"],
];
}
}

+ 6
- 0
tests/cases/Misc/TestValueInfo.php View File

@@ -639,4 +639,10 @@ class TestValueInfo extends \JKingWeb\Arsse\Test\AbstractTest {
$out->f = $msec;
return $out;
}

public function testFlattenArray() {
$arr = [1, [2, 3, [4, 5]], 6, [[7, 8], 9, 10]];
$exp = range(1, 10);
$this->assertSame($exp, I::flatten($arr));
}
}

+ 47
- 0
tests/cases/Service/TestSerial.php View File

@@ -0,0 +1,47 @@
<?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\TestCase\Service;

use JKingWeb\Arsse\Arsse;
use JKingWeb\Arsse\Database;
use JKingWeb\Arsse\Service\Driver as DriverInterface;
use JKingWeb\Arsse\Service\Serial\Driver;

/** @covers \JKingWeb\Arsse\Service\Serial\Driver */
class TestSerial extends \JKingWeb\Arsse\Test\AbstractTest {
public function setUp() {
self::clearData();
self::setConf();
Arsse::$db = \Phake::mock(Database::class);
}

public function testConstruct() {
$this->assertTrue(Driver::requirementsMet());
$this->assertInstanceOf(DriverInterface::class, new Driver);
}

public function testFetchDriverName() {
$this->assertTrue(strlen(Driver::driverName()) > 0);
}

public function testEnqueueFeeds() {
$d = new Driver;
$this->assertSame(3, $d->queue(1, 2, 3));
$this->assertSame(5, $d->queue(4, 5));
$this->assertSame(5, $d->clean());
$this->assertSame(1, $d->queue(5));
}

public function testRefreshFeeds() {
$d = new Driver;
$d->queue(1, 4, 3);
$this->assertSame(Arsse::$conf->serviceQueueWidth, $d->exec());
\Phake::verify(Arsse::$db)->feedUpdate(1);
\Phake::verify(Arsse::$db)->feedUpdate(4);
\Phake::verify(Arsse::$db)->feedUpdate(3);
}
}

+ 41
- 0
tests/cases/Service/TestService.php View File

@@ -39,4 +39,45 @@ class TestService extends \JKingWeb\Arsse\Test\AbstractTest {
$this->assertTrue(Service::hasCheckedIn());
$this->assertFalse(Service::hasCheckedIn());
}

public function testPerformPreCleanup() {
$this->assertTrue(Service::cleanupPre());
\Phake::verify(Arsse::$db)->feedCleanup();
\Phake::verify(Arsse::$db)->sessionCleanup();
}

public function testPerformShortPostCleanup() {
\Phake::when(Arsse::$db)->articleCleanup()->thenReturn(0);
$this->assertTrue(Service::cleanupPost());
\Phake::verify(Arsse::$db)->articleCleanup();
\Phake::verify(Arsse::$db, \Phake::times(0))->driverMaintenance();
}

public function testPerformFullPostCleanup() {
\Phake::when(Arsse::$db)->articleCleanup()->thenReturn(1);
$this->assertTrue(Service::cleanupPost());
\Phake::verify(Arsse::$db)->articleCleanup();
\Phake::verify(Arsse::$db)->driverMaintenance();
}

public function testRefreshFeeds() {
// set up mock database actions
\Phake::when(Arsse::$db)->metaSet->thenReturn(true);
\Phake::when(Arsse::$db)->feedCleanup->thenReturn(true);
\Phake::when(Arsse::$db)->sessionCleanup->thenReturn(true);
\Phake::when(Arsse::$db)->articleCleanup->thenReturn(0);
\Phake::when(Arsse::$db)->feedListStale->thenReturn([1,2,3]);
// perform the test
$d = \Phake::mock(\JKingWeb\Arsse\Service\Driver::class);
$s = new \JKingWeb\Arsse\Test\Service($d);
$this->assertInstanceOf(\DateTimeInterface::class, $s->watch(false));
// verify invocations
\Phake::verify($d)->queue(1, 2, 3);
\Phake::verify($d)->exec();
\Phake::verify($d)->clean();
\Phake::verify(Arsse::$db)->feedCleanup();
\Phake::verify(Arsse::$db)->sessionCleanup();
\Phake::verify(Arsse::$db)->articleCleanup();
\Phake::verify(Arsse::$db)->metaSet("service_last_checkin", $this->anything(), "datetime");
}
}

+ 48
- 0
tests/cases/Service/TestSubprocess.php View File

@@ -0,0 +1,48 @@
<?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\TestCase\Service;

use JKingWeb\Arsse\Arsse;
use JKingWeb\Arsse\Database;
use JKingWeb\Arsse\Service\Driver as DriverInterface;
use JKingWeb\Arsse\Service\Subprocess\Driver;

/** @covers \JKingWeb\Arsse\Service\Subprocess\Driver */
class TestSubprocess extends \JKingWeb\Arsse\Test\AbstractTest {
public function setUp() {
self::clearData();
self::setConf();
}

public function testConstruct() {
$this->assertTrue(Driver::requirementsMet());
$this->assertInstanceOf(DriverInterface::class, new Driver);
}

public function testFetchDriverName() {
$this->assertTrue(strlen(Driver::driverName()) > 0);
}

public function testEnqueueFeeds() {
$d = new Driver;
$this->assertSame(3, $d->queue(1, 2, 3));
$this->assertSame(5, $d->queue(4, 5));
$this->assertSame(5, $d->clean());
$this->assertSame(1, $d->queue(5));
}

public function testRefreshFeeds() {
$d = \Phake::partialMock(Driver::class);
\Phake::when($d)->execCmd->thenReturnCallback(function(string $cmd) {
// FIXME: Does this work in Windows?
return popen("echo ".escapeshellarg($cmd), "r");
});
$this->assertSame(3, $d->queue(1, 4, 3));
$this->assertSame(Arsse::$conf->serviceQueueWidth, $d->exec());
\Phake::verify($d, \Phake::times(3))->execCmd;
}
}

+ 50
- 0
tests/cases/TestArsse.php View File

@@ -0,0 +1,50 @@
<?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\TestCase;

use JKingWeb\Arsse\Arsse;
use JKingWeb\Arsse\Conf;
use JKingWeb\Arsse\Lang;
use JKingWeb\Arsse\User;
use JKingWeb\Arsse\Database;
use JKingWeb\Arsse\Service;

/** @covers \JKingWeb\Arsse\Arsse */
class TestArsse extends \JKingWeb\Arsse\Test\AbstractTest {
public function setUp() {
self::clearData(false);
}
public function tearDown() {
self::clearData();
}

public function testLoadExistingData() {
$lang = Arsse::$lang = \Phake::mock(Lang::class);
$db = Arsse::$db = \Phake::mock(Database::class);
$user = Arsse::$user = \Phake::mock(User::class);
$conf1 = Arsse::$conf = \Phake::mock(Conf::class);
$conf2 = (new Conf)->import(['lang' => "test"]);
Arsse::load($conf2);
$this->assertSame($conf2, Arsse::$conf);
$this->assertSame($lang, Arsse::$lang);
$this->assertSame($db, Arsse::$db);
$this->assertSame($user, Arsse::$user);
\Phake::verify($lang)->set("test");
}

public function testLoadNewData() {
if (!\JKingWeb\Arsse\Db\SQLite3\Driver::requirementsMet() && !\JKingWeb\Arsse\Db\SQLite3\PDODriver::requirementsMet()) {
$this->markTestSkipped("A functional SQLite interface is required for this test");
}
$conf = (new Conf)->import(['dbSQLite3File' => ":memory:"]);
Arsse::load($conf);
$this->assertInstanceOf(Conf::class, Arsse::$conf);
$this->assertInstanceOf(Lang::class, Arsse::$lang);
$this->assertInstanceOf(Database::class, Arsse::$db);
$this->assertInstanceOf(User::class, Arsse::$user);
}
}

+ 0
- 7
tests/cases/User/TestUser.php View File

@@ -24,13 +24,6 @@ class TestUser extends \JKingWeb\Arsse\Test\AbstractTest {
$this->drv = \Phake::mock(Driver::class);
}

public function testListDrivers() {
$exp = [
'JKingWeb\\Arsse\\User\\Internal\\Driver' => Arsse::$lang->msg("Driver.User.Internal.Name"),
];
$this->assertArraySubset($exp, User::driverList());
}

public function testConstruct() {
$this->assertInstanceOf(User::class, new User($this->drv));
$this->assertInstanceOf(User::class, new User);

+ 2
- 2
tests/lib/AbstractTest.php View File

@@ -74,7 +74,7 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
if (isset($params)) {
if (is_array($params)) {
$params = implode("&", array_map(function($v, $k) {
return rawurlencode($k).(isset($v) ? "=".rawurlencode($v) : "");
return rawurlencode($k).(isset($v) ? "=".rawurlencode($v) : "");
}, $params, array_keys($params)));
}
$url = URL::queryAppend($url, (string) $params);
@@ -90,7 +90,7 @@ abstract class AbstractTest extends \PHPUnit\Framework\TestCase {
if (is_string($body) && in_array(strtolower($type), ["", "application/x-www-form-urlencoded"])) {
parse_str($body, $parsedBody);
} elseif (!is_string($body) && in_array(strtolower($type), ["application/json", "text/json"])) {
$body = json_encode($body, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
$body = json_encode($body, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
} elseif (!is_string($body) && in_array(strtolower($type), ["", "application/x-www-form-urlencoded"])) {
$parsedBody = $body;
$body = http_build_query($body, "a", "&");

+ 5
- 1
tests/lib/Lang/Setup.php View File

@@ -9,6 +9,7 @@ namespace JKingWeb\Arsse\Test\Lang;
use JKingWeb\Arsse\Lang;
use JKingWeb\Arsse\Arsse;
use org\bovigo\vfs\vfsStream;
use Webmozart\Glob\Glob;

trait Setup {
public function setUp() {
@@ -36,7 +37,10 @@ trait Setup {
// set up a file without read access
chmod($this->path."ru.php", 0000);
// make the test Lang class use the vfs files
$this->l = new TestLang($this->path);
$this->l = \Phake::partialMock(Lang::class, $this->path);
\Phake::when($this->l)->globFiles->thenReturnCallback(function(string $path): array {
return Glob::glob($this->path."*.php");
});
// create a mock Lang object so as not to create a dependency loop
self::clearData(false);
Arsse::$lang = \Phake::mock(Lang::class);

+ 0
- 15
tests/lib/Lang/TestLang.php View File

@@ -1,15 +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\Test\Lang;

use Webmozart\Glob\Glob;

class TestLang extends \JKingWeb\Arsse\Lang {
protected function globFiles(string $path): array {
return Glob::glob($this->path."*.php");
}
}

+ 13
- 0
tests/lib/Service.php View File

@@ -0,0 +1,13 @@
<?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\Test;

class Service extends \JKingWeb\Arsse\Service {
public function __construct(\JKingWeb\Arsse\Service\Driver $drv) {
$this->drv = $drv;
}
}

+ 4
- 0
tests/phpunit.dist.xml View File

@@ -45,6 +45,7 @@
<testsuite name="Sundry">
<file>cases/Misc/TestValueInfo.php</file>
<file>cases/Misc/TestDate.php</file>
<file>cases/Misc/TestQuery.php</file>
<file>cases/Misc/TestContext.php</file>
<file>cases/Misc/TestURL.php</file>
<file>cases/Misc/TestHTTP.php</file>
@@ -128,7 +129,10 @@
</testsuite>
<testsuite name="Admin tools">
<file>cases/Service/TestService.php</file>
<file>cases/Service/TestSerial.php</file>
<file>cases/Service/TestSubprocess.php</file>
<file>cases/CLI/TestCLI.php</file>
<file>cases/TestArsse.php</file>
</testsuite>
<testsuite name="Import/Export">
<file>cases/ImportExport/TestFile.php</file>

+ 116
- 113
vendor-bin/csfixer/composer.lock View File

@@ -114,16 +114,16 @@
},
{
"name": "doctrine/annotations",
"version": "v1.6.1",
"version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "53120e0eb10355388d6ccbe462f1fea34ddadb24"
"reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/53120e0eb10355388d6ccbe462f1fea34ddadb24",
"reference": "53120e0eb10355388d6ccbe462f1fea34ddadb24",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc",
"reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc",
"shasum": ""
},
"require": {
@@ -132,12 +132,12 @@
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "^6.4"
"phpunit/phpunit": "^7.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
"dev-master": "1.7.x-dev"
}
},
"autoload": {
@@ -150,6 +150,10 @@
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@@ -158,10 +162,6 @@
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
@@ -178,32 +178,34 @@
"docblock",
"parser"
],
"time": "2019-03-25T19:12:02+00:00"
"time": "2019-10-01T18:55:10+00:00"
},
{
"name": "doctrine/lexer",
"version": "1.0.2",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8"
"reference": "e17f069ede36f7534b95adec71910ed1b49c74ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea",
"reference": "e17f069ede36f7534b95adec71910ed1b49c74ea",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^4.5"
"doctrine/coding-standard": "^6.0",
"phpstan/phpstan": "^0.11.8",
"phpunit/phpunit": "^8.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -216,14 +218,14 @@
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
@@ -238,20 +240,20 @@
"parser",
"php"
],
"time": "2019-06-08T11:03:04+00:00"
"time": "2019-07-30T19:33:28+00:00"
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v2.15.1",
"version": "v2.15.3",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
"reference": "20064511ab796593a3990669eff5f5b535001f7c"
"reference": "705490b0f282f21017d73561e9498d2b622ee34c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/20064511ab796593a3990669eff5f5b535001f7c",
"reference": "20064511ab796593a3990669eff5f5b535001f7c",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/705490b0f282f21017d73561e9498d2b622ee34c",
"reference": "705490b0f282f21017d73561e9498d2b622ee34c",
"shasum": ""
},
"require": {
@@ -281,9 +283,10 @@
"php-cs-fixer/accessible-object": "^1.0",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1",
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1",
"phpunitgoodpractices/traits": "^1.8",
"symfony/phpunit-bridge": "^4.3"
"symfony/phpunit-bridge": "^4.3",
"symfony/yaml": "^3.0 || ^4.0"
},
"suggest": {
"ext-mbstring": "For handling non-UTF8 characters in cache signature.",
@@ -316,17 +319,17 @@
"MIT"
],
"authors": [
{
"name": "Dariusz Rumiński",
"email": "dariusz.ruminski@gmail.com"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Dariusz Rumiński",
"email": "dariusz.ruminski@gmail.com"
}
],
"description": "A tool to automatically fix PHP code style",
"time": "2019-06-01T10:32:12+00:00"
"time": "2019-08-31T12:51:54+00:00"
},
{
"name": "paragonie/random_compat",
@@ -522,16 +525,16 @@
},
{
"name": "symfony/console",
"version": "v4.3.2",
"version": "v4.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "b592b26a24265a35172d8a2094d8b10f22b7cc39"
"reference": "929ddf360d401b958f611d44e726094ab46a7369"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/b592b26a24265a35172d8a2094d8b10f22b7cc39",
"reference": "b592b26a24265a35172d8a2094d8b10f22b7cc39",
"url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369",
"reference": "929ddf360d401b958f611d44e726094ab46a7369",
"shasum": ""
},
"require": {
@@ -593,20 +596,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2019-06-13T11:03:18+00:00"
"time": "2019-10-07T12:36:49+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.3.2",
"version": "v4.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "d257021c1ab28d48d24a16de79dfab445ce93398"
"reference": "6229f58993e5a157f6096fc7145c0717d0be8807"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d257021c1ab28d48d24a16de79dfab445ce93398",
"reference": "d257021c1ab28d48d24a16de79dfab445ce93398",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6229f58993e5a157f6096fc7145c0717d0be8807",
"reference": "6229f58993e5a157f6096fc7145c0717d0be8807",
"shasum": ""
},
"require": {
@@ -663,20 +666,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2019-06-13T11:03:18+00:00"
"time": "2019-10-01T16:40:32+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
"version": "v1.1.5",
"version": "v1.1.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "c61766f4440ca687de1084a5c00b08e167a2575c"
"reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c61766f4440ca687de1084a5c00b08e167a2575c",
"reference": "c61766f4440ca687de1084a5c00b08e167a2575c",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c43ab685673fb6c8d84220c77897b1d6cdbe1d18",
"reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18",
"shasum": ""
},
"require": {
@@ -721,20 +724,20 @@
"interoperability",
"standards"
],
"time": "2019-06-20T06:46:26+00:00"
"time": "2019-09-17T09:54:03+00:00"
},
{
"name": "symfony/filesystem",
"version": "v4.3.2",
"version": "v4.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d"
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263",
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263",
"shasum": ""
},
"require": {
@@ -771,20 +774,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2019-06-23T08:51:25+00:00"
"time": "2019-08-20T14:07:54+00:00"
},
{
"name": "symfony/finder",
"version": "v4.3.2",
"version": "v4.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a"
"reference": "5e575faa95548d0586f6bedaeabec259714e44d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a",
"reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a",
"url": "https://api.github.com/repos/symfony/finder/zipball/5e575faa95548d0586f6bedaeabec259714e44d1",
"reference": "5e575faa95548d0586f6bedaeabec259714e44d1",
"shasum": ""
},
"require": {
@@ -820,20 +823,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2019-06-13T11:03:18+00:00"
"time": "2019-09-16T11:29:48+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v4.3.2",
"version": "v4.3.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "40762ead607c8f792ee4516881369ffa553fee6f"
"reference": "81c2e120522a42f623233968244baebd6b36cb6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f",
"reference": "40762ead607c8f792ee4516881369ffa553fee6f",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/81c2e120522a42f623233968244baebd6b36cb6a",
"reference": "81c2e120522a42f623233968244baebd6b36cb6a",
"shasum": ""
},
"require": {
@@ -874,20 +877,20 @@
"configuration",
"options"
],
"time": "2019-06-13T11:01:17+00:00"
"time": "2019-08-08T09:29:19+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.11.0",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "82ebae02209c21113908c229e9883c419720738a"
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "82ebae02209c21113908c229e9883c419720738a",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"shasum": ""
},
"require": {
@@ -899,7 +902,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
"dev-master": "1.12-dev"
}
},
"autoload": {
@@ -916,12 +919,12 @@
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Gert de Pagter",
"email": "backendtea@gmail.com"
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
@@ -932,20 +935,20 @@
"polyfill",
"portable"
],
"time": "2019-02-06T07:57:58+00:00"
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.11.0",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fe5e94c604826c35a32fa832f35bd036b6799609"
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609",
"reference": "fe5e94c604826c35a32fa832f35bd036b6799609",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"shasum": ""
},