From fd33d92d413acb5ee48e04d8a78f251e35ef06c5 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 20 Aug 2019 14:55:43 +0200 Subject: Require PHP 5.5+ (#2495) * Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093 I think it would be reasonable to require PHP 5.5+ for the core of FreshRSS after all. As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the most popular PHP application. We would loose about 20% of the PHP servers according to https://w3techs.com/technologies/details/pl-php/5/all but I expect this number to drop fast after the release of CentOS 8 (CentOS accounts for 17% of Linux servers https://w3techs.com/technologies/details/os-linux/all/all ). Distributions: * no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze, Mageia, as all active versions have PHP > 7 * no impact on OpenSuze, Synology, as all active versions have PHP > 5.5 * we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch (2017-06) - current is Debian 10 Buster * we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05) * we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released soonish) When dropping older versions, I can better like when it is for a good reason, and there is actually one with PHP 5.5, namely generators (yield) https://php.net/language.generators.overview which I consider using. * Version note for JSON.php * hex2bin * Update .travis.yml Co-Authored-By: Frans de Jonge --- docs/fr/users/01_Installation.md | 6 +----- docs/fr/users/06_Mobile_access.md | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'docs/fr/users') diff --git a/docs/fr/users/01_Installation.md b/docs/fr/users/01_Installation.md index a6495d2fd..cc1f543f1 100644 --- a/docs/fr/users/01_Installation.md +++ b/docs/fr/users/01_Installation.md @@ -7,15 +7,11 @@ Il est toutefois de votre responsabilité de vérifier que votre hébergement pe | Logiciel | Recommandé | Fonctionne aussi avec | | -------- | ----------- | --------------------- | | Serveur web | **Apache 2** | Nginx | - | PHP | **PHP 5.5+** | PHP 5.3.8+ | + | PHP | **PHP 7+** | PHP 5.5+ | | Modules PHP | Requis : libxml, cURL, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : JSON, Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/744a9e8cf00aef7dec0acfa5f90f0dcfa2ef8837/Docker/Dockerfile-Alpine#L7-L9)* | | | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Navigateur | **Firefox** | Chrome, Opera, Safari, or IE 11+ | -## Note importante - -FreshRSS **PEUT** fonctionner sur la version de PHP 5.3.8+. En effet, nous utilisons des fonctions spécifiques pour la connexion par formulaire et notamment la [bibliothèque ''password_compat''](https://github.com/ircmaxell/password_compat#requirements). - # Choisir la bonne version de FreshRSS FreshRSS possède trois versions différentes (nous parlons de branches) qui sortent à des fréquences plus ou moins rapides. Aussi prenez le temps de comprendre à quoi correspond chacune de ces versions. diff --git a/docs/fr/users/06_Mobile_access.md b/docs/fr/users/06_Mobile_access.md index 7bce9eea3..225c55c7c 100644 --- a/docs/fr/users/06_Mobile_access.md +++ b/docs/fr/users/06_Mobile_access.md @@ -29,7 +29,7 @@ Voir la [page sur l’API compatible Fever](06_Fever_API.md) pour une autre poss * Si vous obtenez *Service Unavailable!*, retourner à l’étape 6. * Avec __Apache__: * Si vous obtenez *FAIL getallheaders!*, alors la combinaison de votre version de PHP et de votre serveur Web ne permet pas l’accès à [`getallheaders`](http://php.net/getallheaders) - * Utilisez au moins PHP 5.4+, ou utilisez PHP en tant que module plutôt que CGI. Sinon, activer Apache `mod_setenvif` (souvent activé par défault), ou `mod_rewrite` avec la procédure suivante : + * Activer Apache `mod_setenvif` (souvent activé par défault), ou `mod_rewrite` avec la procédure suivante : * Autoriser [`FileInfo` dans `.htaccess`](http://httpd.apache.org/docs/trunk/mod/core.html#allowoverride) : revoir [l’installation du serveur](01_Installation.md). * Activer [`mod_rewrite`](http://httpd.apache.org/docs/trunk/mod/mod_rewrite.html) : * Sur Debian / Ubuntu : `sudo a2enmod rewrite` -- cgit v1.2.3 From d09826c145bd6276f8a0e85a87dccefb55227ca1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 20 Aug 2019 15:48:54 +0200 Subject: Docker Alpine opcache (#2498) https://github.com/FreshRSS/FreshRSS/pull/2495#discussion_r315662184 https://php.net/ref.opcache We need to retest the performances https://github.com/FreshRSS/FreshRSS/pull/2205 --- Docker/Dockerfile-Alpine | 2 +- docs/en/admins/02_Installation.md | 2 +- docs/fr/users/01_Installation.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/fr/users') diff --git a/Docker/Dockerfile-Alpine b/Docker/Dockerfile-Alpine index ac5d74a43..b8ef72988 100644 --- a/Docker/Dockerfile-Alpine +++ b/Docker/Dockerfile-Alpine @@ -5,7 +5,7 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] RUN apk add --no-cache \ apache2 php7-apache2 \ php7 php7-curl php7-gmp php7-intl php7-mbstring php7-xml php7-zip \ - php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-session php7-simplexml php7-xmlreader php7-zlib \ + php7-ctype php7-dom php7-fileinfo php7-iconv php7-json php7-opcache php7-session php7-simplexml php7-xmlreader php7-zlib \ php7-pdo_sqlite php7-pdo_mysql php7-pdo_pgsql RUN mkdir -p /var/www/FreshRSS /run/apache2/ diff --git a/docs/en/admins/02_Installation.md b/docs/en/admins/02_Installation.md index 7606ce7b2..375b68044 100644 --- a/docs/en/admins/02_Installation.md +++ b/docs/en/admins/02_Installation.md @@ -8,7 +8,7 @@ You need to verify that your server can run FreshRSS before installing it. If yo | ----------- | ---------------- | ----------------------------- | | Web server | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.5+ | -| PHP modules | Required: libxml, cURL, PDO_MySQL, PCRE and ctype.
Required (32-bit only): GMP
Recommanded: JSON, Zlib, mbstring, iconv, ZipArchive
*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/744a9e8cf00aef7dec0acfa5f90f0dcfa2ef8837/Docker/Dockerfile-Alpine#L7-L9)* | | +| PHP modules | Required: libxml, cURL, PDO_MySQL, PCRE and ctype.
Required (32-bit only): GMP
Recommanded: JSON, Zlib, mbstring, iconv, ZipArchive
*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Database | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Browser | **Firefox** | Chrome, Opera, Safari, or IE11+ | diff --git a/docs/fr/users/01_Installation.md b/docs/fr/users/01_Installation.md index cc1f543f1..f90d52c54 100644 --- a/docs/fr/users/01_Installation.md +++ b/docs/fr/users/01_Installation.md @@ -8,7 +8,7 @@ Il est toutefois de votre responsabilité de vérifier que votre hébergement pe | -------- | ----------- | --------------------- | | Serveur web | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.5+ | - | Modules PHP | Requis : libxml, cURL, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : JSON, Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/744a9e8cf00aef7dec0acfa5f90f0dcfa2ef8837/Docker/Dockerfile-Alpine#L7-L9)* | | + | Modules PHP | Requis : libxml, cURL, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : JSON, Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Navigateur | **Firefox** | Chrome, Opera, Safari, or IE 11+ | -- cgit v1.2.3 From 38117df976a5b8776a6df483ac7666895691b832 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 17 Sep 2019 20:28:07 +0200 Subject: Require PHP 5.6+ Discussion https://github.com/FreshRSS/FreshRSS/pull/2495#issuecomment-531911473 Needed for constant arrays https://www.php.net/manual/en/migration56.new-features.php which will be used in https://github.com/FreshRSS/FreshRSS/pull/2522 --- .travis.yml | 3 --- CHANGELOG.md | 2 +- README.fr.md | 4 ++-- README.md | 4 ++-- app/install.php | 2 +- app/views/update/checkInstall.phtml | 2 +- docs/en/admins/02_Installation.md | 2 +- docs/en/admins/05_Configuring_email_validation.md | 5 +---- docs/fr/users/01_Installation.md | 2 +- lib/lib_install.php | 2 +- lib/lib_rss.php | 4 ++-- 11 files changed, 13 insertions(+), 19 deletions(-) (limited to 'docs/fr/users') diff --git a/.travis.yml b/.travis.yml index 5b0ba705a..aedc526d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,6 @@ env: matrix: fast_finish: true include: - # PHP 5.5 only runs on Travis in 14.04 (trusty), not 16.04 (xenial) - - php: "5.5" - dist: trusty - php: "7.2" env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no - language: node_js diff --git a/CHANGELOG.md b/CHANGELOG.md index 443302273..67103374b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * New option to display article authors underneath the article title [#2487](https://github.com/FreshRSS/FreshRSS/pull/2487) * Add e-mail capability [#2476](https://github.com/FreshRSS/FreshRSS/pull/2476) * Compatibility - * Require at least PHP 5.5+ [#2495](https://github.com/FreshRSS/FreshRSS/pull/2495) + * Require at least PHP 5.6+ [#2495](https://github.com/FreshRSS/FreshRSS/pull/2495) * Deployment * Take advantage of `mod_authz_core` instead of `mod_access_compat` when running on Apache 2.4+ [#2461](https://github.com/FreshRSS/FreshRSS/pull/2461) * Docker: Alpine image updated to 3.10 with PHP 7.3.8 and Apache 2.4.41 [#2238](https://github.com/FreshRSS/FreshRSS/pull/2238) diff --git a/README.fr.md b/README.fr.md index ceee48f5b..9644f78de 100644 --- a/README.fr.md +++ b/README.fr.md @@ -43,7 +43,7 @@ FreshRSS n’est fourni avec aucune garantie. * Serveur modeste, par exemple sous Linux ou Windows * Fonctionne même sur un Raspberry Pi 1 avec des temps de réponse < 1s (testé sur 150 flux, 22k articles) * Serveur Web Apache2 (recommandé), ou nginx, lighttpd (non testé sur les autres) -* PHP 5.5+ (PHP 7+ recommandé pour de meilleures performances) +* PHP 5.6+ (PHP 7+ recommandé pour de meilleures performances) * Requis : [cURL](https://secure.php.net/curl), [DOM](https://secure.php.net/dom), [XML](https://secure.php.net/xml), [session](https://secure.php.net/session), [ctype](https://secure.php.net/ctype), et [PDO_MySQL](https://secure.php.net/pdo-mysql) ou [PDO_SQLite](https://secure.php.net/pdo-sqlite) ou [PDO_PGSQL](https://secure.php.net/pdo-pgsql) * Recommandés : [JSON](https://secure.php.net/json), [GMP](https://secure.php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](https://secure.php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](https://secure.php.net/mbstring) (pour le texte Unicode), [iconv](https://secure.php.net/iconv) (pour conversion d’encodages), [ZIP](https://secure.php.net/zip) (pour import/export), [zlib](https://secure.php.net/zlib) (pour les flux compressés) * MySQL 5.5.3+ (recommandé) ou équivalent MariaDB, ou SQLite 3.7.4+, ou PostgreSQL 9.2+ @@ -121,7 +121,7 @@ Voir la [documentation de la ligne de commande](cli/README.md) pour plus de dét ## Contrôle d’accès Il est requis pour le mode multi-utilisateur, et recommandé dans tous les cas, de limiter l’accès à votre FreshRSS. Au choix : -* En utilisant l’identification par formulaire (requiert JavaScript, et PHP 5.5+ recommandé) +* En utilisant l’identification par formulaire (requiert JavaScript) * En utilisant un contrôle d’accès HTTP défini par votre serveur Web * Voir par exemple la [documentation d’Apache sur l’authentification](https://httpd.apache.org/docs/trunk/howto/auth.html) * Créer dans ce cas un fichier `./p/i/.htaccess` avec un fichier `.htpasswd` correspondant. diff --git a/README.md b/README.md index 6123ae903..829d0306f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ FreshRSS comes with absolutely no warranty. * Light server running Linux or Windows * It even works on Raspberry Pi 1 with response time under a second (tested with 150 feeds, 22k articles) * A web server: Apache2 (recommended), nginx, lighttpd (not tested on others) -* PHP 5.5+ (PHP 7+ recommended for higher performance) +* PHP 5.6+ (PHP 7+ recommended for higher performance) * Required extensions: [cURL](https://secure.php.net/curl), [DOM](https://secure.php.net/dom), [XML](https://secure.php.net/xml), [session](https://secure.php.net/session), [ctype](https://secure.php.net/ctype), and [PDO_MySQL](https://secure.php.net/pdo-mysql) or [PDO_SQLite](https://secure.php.net/pdo-sqlite) or [PDO_PGSQL](https://secure.php.net/pdo-pgsql) * Recommended extensions: [JSON](https://secure.php.net/json), [GMP](https://secure.php.net/gmp) (for API access on 32-bit platforms), [IDN](https://secure.php.net/intl.idn) (for Internationalized Domain Names), [mbstring](https://secure.php.net/mbstring) (for Unicode strings), [iconv](https://secure.php.net/iconv) (for charset conversion), [ZIP](https://secure.php.net/zip) (for import/export), [zlib](https://secure.php.net/zlib) (for compressed feeds) * MySQL 5.5.3+ (recommended) or MariaDB equivalent, or SQLite 3.7.4+, or PostgreSQL 9.2+ @@ -121,7 +121,7 @@ See more commands and git commands in the [Command-Line Interface documentation] ## Access control This is needed if you will be using the multi-user mode, to limit access to FreshRSS. Options Available: -* form authentication (needs JavaScript, and PHP 5.5+ recommended) +* form authentication (needs JavaScript) * HTTP authentication supported by your web server * See [Apache documentation](https://httpd.apache.org/docs/trunk/howto/auth.html) * In that case, create a `./p/i/.htaccess` file with a matching `.htpasswd` file. diff --git a/app/install.php b/app/install.php index a92394d2a..47ec1a8a9 100644 --- a/app/install.php +++ b/app/install.php @@ -432,7 +432,7 @@ function printStep1() {

-

+

diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml index e719e53dd..7ebbae869 100644 --- a/app/views/update/checkInstall.phtml +++ b/app/views/update/checkInstall.phtml @@ -9,7 +9,7 @@

Required (32-bit only): GMP
Recommanded: JSON, Zlib, mbstring, iconv, ZipArchive
*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Database | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Browser | **Firefox** | Chrome, Opera, Safari, or IE11+ | diff --git a/docs/en/admins/05_Configuring_email_validation.md b/docs/en/admins/05_Configuring_email_validation.md index 6cc9ca8f5..fe073545c 100644 --- a/docs/en/admins/05_Configuring_email_validation.md +++ b/docs/en/admins/05_Configuring_email_validation.md @@ -6,8 +6,6 @@ by default so you'll have to follow these few steps to verify email addresses. It is intended to administrators who host users and want to be sure to be able to contact them. -Note that this feature only works with PHP >= 5.5. - ## Force email validation In your `data/config.php` file, you'll find a `force_email_validation` item: @@ -15,8 +13,7 @@ set it to `true`. An email field now appears on the registration page and emails are sent when users change their email. You can also enable this feature directly in FreshRSS: `Administration` > -`System configuration` > check `Force email addresses validation`. If the -option doesn't appear, it means that you use PHP < 5.5. +`System configuration` > check `Force email addresses validation`. ## Configure the SMTP server diff --git a/docs/fr/users/01_Installation.md b/docs/fr/users/01_Installation.md index f90d52c54..619bce11b 100644 --- a/docs/fr/users/01_Installation.md +++ b/docs/fr/users/01_Installation.md @@ -7,7 +7,7 @@ Il est toutefois de votre responsabilité de vérifier que votre hébergement pe | Logiciel | Recommandé | Fonctionne aussi avec | | -------- | ----------- | --------------------- | | Serveur web | **Apache 2** | Nginx | - | PHP | **PHP 7+** | PHP 5.5+ | + | PHP | **PHP 7+** | PHP 5.6+ | | Modules PHP | Requis : libxml, cURL, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : JSON, Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Navigateur | **Firefox** | Chrome, Opera, Safari, or IE 11+ | diff --git a/lib/lib_install.php b/lib/lib_install.php index 6b9b33240..17defccf6 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -6,7 +6,7 @@ Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config. Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php')); function checkRequirements($dbType = '') { - $php = version_compare(PHP_VERSION, '5.5.0') >= 0; + $php = version_compare(PHP_VERSION, '5.6.0') >= 0; $minz = file_exists(join_path(LIB_PATH, 'Minz')); $curl = extension_loaded('curl'); $pdo_mysql = extension_loaded('pdo_mysql'); diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 03cfb82ad..b810e1296 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -1,6 +1,6 @@ Date: Wed, 18 Sep 2019 17:18:36 +0200 Subject: Remove JSON.php fallback (#2528) After moving to PHP 5.6+ https://github.com/FreshRSS/FreshRSS/pull/2527 it should not be necessary to have the JSON.php fallback anymore, which was mainly there due to an obscure licensing issue 6 years ago in Debian https://wiki.debian.org/qa.debian.org/jsonevil , which broke Ubuntu 13.10 https://github.com/FreshRSS/FreshRSS/issues/306 --- .travis.yml | 2 +- README.fr.md | 5 +- README.md | 5 +- app/install.php | 2 +- docs/en/admins/02_Installation.md | 2 +- docs/fr/users/01_Installation.md | 2 +- lib/JSON.php | 933 -------------------------------------- lib/lib_rss.php | 16 - phpcs.xml | 1 - 9 files changed, 8 insertions(+), 960 deletions(-) delete mode 100644 lib/JSON.php (limited to 'docs/fr/users') diff --git a/.travis.yml b/.travis.yml index aedc526d2..57121d727 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ install: script: - phpenv rehash - - find . -not -path "./lib/JSON.php" -name \*.php -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null 2>php-l-results + - find . -name \*.php -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null 2>php-l-results - if [ -s php-l-results ]; then cat php-l-results; exit 1; fi - | if [[ $VALIDATE_STANDARD == yes ]]; then diff --git a/README.fr.md b/README.fr.md index 9644f78de..2f57b1234 100644 --- a/README.fr.md +++ b/README.fr.md @@ -44,8 +44,8 @@ FreshRSS n’est fourni avec aucune garantie. * Fonctionne même sur un Raspberry Pi 1 avec des temps de réponse < 1s (testé sur 150 flux, 22k articles) * Serveur Web Apache2 (recommandé), ou nginx, lighttpd (non testé sur les autres) * PHP 5.6+ (PHP 7+ recommandé pour de meilleures performances) - * Requis : [cURL](https://secure.php.net/curl), [DOM](https://secure.php.net/dom), [XML](https://secure.php.net/xml), [session](https://secure.php.net/session), [ctype](https://secure.php.net/ctype), et [PDO_MySQL](https://secure.php.net/pdo-mysql) ou [PDO_SQLite](https://secure.php.net/pdo-sqlite) ou [PDO_PGSQL](https://secure.php.net/pdo-pgsql) - * Recommandés : [JSON](https://secure.php.net/json), [GMP](https://secure.php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](https://secure.php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](https://secure.php.net/mbstring) (pour le texte Unicode), [iconv](https://secure.php.net/iconv) (pour conversion d’encodages), [ZIP](https://secure.php.net/zip) (pour import/export), [zlib](https://secure.php.net/zlib) (pour les flux compressés) + * Requis : [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype), et [PDO_MySQL](https://www.php.net/pdo-mysql) ou [PDO_SQLite](https://www.php.net/pdo-sqlite) ou [PDO_PGSQL](https://www.php.net/pdo-pgsql) + * Recommandés : [GMP](https://www.php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](https://www.php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](https://www.php.net/mbstring) (pour le texte Unicode), [iconv](https://www.php.net/iconv) (pour conversion d’encodages), [ZIP](https://www.php.net/zip) (pour import/export), [zlib](https://www.php.net/zlib) (pour les flux compressés) * MySQL 5.5.3+ (recommandé) ou équivalent MariaDB, ou SQLite 3.7.4+, ou PostgreSQL 9.2+ @@ -218,7 +218,6 @@ Tout client supportant une API de type Fever ; Sélection : ## Uniquement pour certaines options ou configurations * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](https://github.com/phpquery/phpquery) -* [Services_JSON](https://pear.php.net/pepr/pepr-proposal-show.php?id=198) diff --git a/README.md b/README.md index 829d0306f..223970d97 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ FreshRSS comes with absolutely no warranty. * It even works on Raspberry Pi 1 with response time under a second (tested with 150 feeds, 22k articles) * A web server: Apache2 (recommended), nginx, lighttpd (not tested on others) * PHP 5.6+ (PHP 7+ recommended for higher performance) - * Required extensions: [cURL](https://secure.php.net/curl), [DOM](https://secure.php.net/dom), [XML](https://secure.php.net/xml), [session](https://secure.php.net/session), [ctype](https://secure.php.net/ctype), and [PDO_MySQL](https://secure.php.net/pdo-mysql) or [PDO_SQLite](https://secure.php.net/pdo-sqlite) or [PDO_PGSQL](https://secure.php.net/pdo-pgsql) - * Recommended extensions: [JSON](https://secure.php.net/json), [GMP](https://secure.php.net/gmp) (for API access on 32-bit platforms), [IDN](https://secure.php.net/intl.idn) (for Internationalized Domain Names), [mbstring](https://secure.php.net/mbstring) (for Unicode strings), [iconv](https://secure.php.net/iconv) (for charset conversion), [ZIP](https://secure.php.net/zip) (for import/export), [zlib](https://secure.php.net/zlib) (for compressed feeds) + * Required extensions: [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype), and [PDO_MySQL](https://www.php.net/pdo-mysql) or [PDO_SQLite](https://www.php.net/pdo-sqlite) or [PDO_PGSQL](https://www.php.net/pdo-pgsql) + * Recommended extensions: [GMP](https://www.php.net/gmp) (for API access on 32-bit platforms), [IDN](https://www.php.net/intl.idn) (for Internationalized Domain Names), [mbstring](https://www.php.net/mbstring) (for Unicode strings), [iconv](https://www.php.net/iconv) (for charset conversion), [ZIP](https://www.php.net/zip) (for import/export), [zlib](https://www.php.net/zlib) (for compressed feeds) * MySQL 5.5.3+ (recommended) or MariaDB equivalent, or SQLite 3.7.4+, or PostgreSQL 9.2+ @@ -218,7 +218,6 @@ Supported clients are: ## Only for some options or configurations * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](https://github.com/phpquery/phpquery) -* [Services_JSON](https://pear.php.net/pepr/pepr-proposal-show.php?id=198) [travis-badge]:https://travis-ci.org/FreshRSS/FreshRSS.svg?branch=master [travis-link]:https://travis-ci.org/FreshRSS/FreshRSS diff --git a/app/install.php b/app/install.php index 47ec1a8a9..178ae082a 100644 --- a/app/install.php +++ b/app/install.php @@ -457,7 +457,7 @@ function printStep1() {

-

+

diff --git a/docs/en/admins/02_Installation.md b/docs/en/admins/02_Installation.md index 0433ccaf2..446ef0dcf 100644 --- a/docs/en/admins/02_Installation.md +++ b/docs/en/admins/02_Installation.md @@ -8,7 +8,7 @@ You need to verify that your server can run FreshRSS before installing it. If yo | ----------- | ---------------- | ----------------------------- | | Web server | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.6+ | -| PHP modules | Required: libxml, cURL, PDO_MySQL, PCRE and ctype.
Required (32-bit only): GMP
Recommanded: JSON, Zlib, mbstring, iconv, ZipArchive
*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | +| PHP modules | Required: libxml, cURL, JSON, PDO_MySQL, PCRE and ctype.
Required (32-bit only): GMP
Recommanded: Zlib, mbstring, iconv, ZipArchive
*For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Database | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Browser | **Firefox** | Chrome, Opera, Safari, or IE11+ | diff --git a/docs/fr/users/01_Installation.md b/docs/fr/users/01_Installation.md index 619bce11b..288d84c4d 100644 --- a/docs/fr/users/01_Installation.md +++ b/docs/fr/users/01_Installation.md @@ -8,7 +8,7 @@ Il est toutefois de votre responsabilité de vérifier que votre hébergement pe | -------- | ----------- | --------------------- | | Serveur web | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.6+ | - | Modules PHP | Requis : libxml, cURL, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : JSON, Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | + | Modules PHP | Requis : libxml, cURL, JSON, PDO_MySQL, PCRE et ctype
Requis (32 bits seulement) : GMP
Recommandé : Zlib, mbstring et iconv, ZipArchive
*Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+ | | Navigateur | **Firefox** | Chrome, Opera, Safari, or IE 11+ | diff --git a/lib/JSON.php b/lib/JSON.php deleted file mode 100644 index 8dc8a6f01..000000000 --- a/lib/JSON.php +++ /dev/null @@ -1,933 +0,0 @@ - - * @author Matt Knapp - * @author Brett Stimmerman - * @copyright 2005 Michal Migurski - * @version CVS: $Id: JSON.php 305040 2010-11-02 23:19:03Z alan_k $ - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - */ - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_SLICE', 1); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_STR', 2); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_ARR', 3); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_OBJ', 4); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_CMT', 5); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_LOOSE_TYPE', 16); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_SUPPRESS_ERRORS', 32); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_USE_TO_JSON', 64); - -/** - * Converts to and from JSON format. - * - * Brief example of use: - * - * - * // create a new instance of Services_JSON - * $json = new Services_JSON(); - * - * // convert a complexe value to JSON notation, and send it to the browser - * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); - * $output = $json->encode($value); - * - * print($output); - * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] - * - * // accept incoming POST data, assumed to be in JSON notation - * $input = file_get_contents('php://input', 1000000); - * $value = $json->decode($input); - * - */ -class Services_JSON -{ - /** - * constructs a new JSON instance - * - * @param int $use object behavior flags; combine with boolean-OR - * - * possible values: - * - SERVICES_JSON_LOOSE_TYPE: loose typing. - * "{...}" syntax creates associative arrays - * instead of objects in decode(). - * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. - * Values which can't be encoded (e.g. resources) - * appear as NULL instead of throwing errors. - * By default, a deeply-nested resource will - * bubble up with an error, so all return values - * from encode() should be checked with isError() - * - SERVICES_JSON_USE_TO_JSON: call toJSON when serializing objects - * It serializes the return value from the toJSON call rather - * than the object it'self, toJSON can return associative arrays, - * strings or numbers, if you return an object, make sure it does - * not have a toJSON method, otherwise an error will occur. - */ - function Services_JSON($use = 0) - { - $this->use = $use; - $this->_mb_strlen = function_exists('mb_strlen'); - $this->_mb_convert_encoding = function_exists('mb_convert_encoding'); - $this->_mb_substr = function_exists('mb_substr'); - } - // private - cache the mbstring lookup results.. - var $_mb_strlen = false; - var $_mb_substr = false; - var $_mb_convert_encoding = false; - - /** - * convert a string from one UTF-16 char to one UTF-8 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf16 UTF-16 character - * @return string UTF-8 character - * @access private - */ - function utf162utf8($utf16) - { - // oh please oh please oh please oh please oh please - if($this->_mb_convert_encoding) { - return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); - } - - $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); - - switch(true) { - case ((0x7F & $bytes) == $bytes): - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x7F & $bytes); - - case (0x07FF & $bytes) == $bytes: - // return a 2-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xC0 | (($bytes >> 6) & 0x1F)) - . chr(0x80 | ($bytes & 0x3F)); - - case (0xFFFF & $bytes) == $bytes: - // return a 3-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xE0 | (($bytes >> 12) & 0x0F)) - . chr(0x80 | (($bytes >> 6) & 0x3F)) - . chr(0x80 | ($bytes & 0x3F)); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * convert a string from one UTF-8 char to one UTF-16 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf8 UTF-8 character - * @return string UTF-16 character - * @access private - */ - function utf82utf16($utf8) - { - // oh please oh please oh please oh please oh please - if($this->_mb_convert_encoding) { - return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); - } - - switch($this->strlen8($utf8)) { - case 1: - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return $utf8; - - case 2: - // return a UTF-16 character from a 2-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x07 & (ord($utf8{0}) >> 2)) - . chr((0xC0 & (ord($utf8{0}) << 6)) - | (0x3F & ord($utf8{1}))); - - case 3: - // return a UTF-16 character from a 3-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr((0xF0 & (ord($utf8{0}) << 4)) - | (0x0F & (ord($utf8{1}) >> 2))) - . chr((0xC0 & (ord($utf8{1}) << 6)) - | (0x7F & ord($utf8{2}))); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * encodes an arbitrary variable into JSON format (and sends JSON Header) - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - function encode($var) - { - header('Content-type: application/json'); - return $this->encodeUnsafe($var); - } - /** - * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow XSS!!!!) - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - function encodeUnsafe($var) - { - // see bug #16908 - regarding numeric locale printing - $lc = setlocale(LC_NUMERIC, 0); - setlocale(LC_NUMERIC, 'C'); - $ret = $this->_encode($var); - setlocale(LC_NUMERIC, $lc); - return $ret; - - } - /** - * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - function _encode($var) - { - - switch (gettype($var)) { - case 'boolean': - return $var ? 'true' : 'false'; - - case 'NULL': - return 'null'; - - case 'integer': - return (int) $var; - - case 'double': - case 'float': - return (float) $var; - - case 'string': - // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT - $ascii = ''; - $strlen_var = $this->strlen8($var); - - /* - * Iterate over every character in the string, - * escaping with a slash or encoding to UTF-8 where necessary - */ - for ($c = 0; $c < $strlen_var; ++$c) { - - $ord_var_c = ord($var{$c}); - - switch (true) { - case $ord_var_c == 0x08: - $ascii .= '\b'; - break; - case $ord_var_c == 0x09: - $ascii .= '\t'; - break; - case $ord_var_c == 0x0A: - $ascii .= '\n'; - break; - case $ord_var_c == 0x0C: - $ascii .= '\f'; - break; - case $ord_var_c == 0x0D: - $ascii .= '\r'; - break; - - case $ord_var_c == 0x22: - case $ord_var_c == 0x2F: - case $ord_var_c == 0x5C: - // double quote, slash, slosh - $ascii .= '\\'.$var{$c}; - break; - - case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): - // characters U-00000000 - U-0000007F (same as ASCII) - $ascii .= $var{$c}; - break; - - case (($ord_var_c & 0xE0) == 0xC0): - // characters U-00000080 - U-000007FF, mask 110XXXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - if ($c+1 >= $strlen_var) { - $c += 1; - $ascii .= '?'; - break; - } - - $char = pack('C*', $ord_var_c, ord($var{$c + 1})); - $c += 1; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF0) == 0xE0): - if ($c+2 >= $strlen_var) { - $c += 2; - $ascii .= '?'; - break; - } - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - @ord($var{$c + 1}), - @ord($var{$c + 2})); - $c += 2; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF8) == 0xF0): - if ($c+3 >= $strlen_var) { - $c += 3; - $ascii .= '?'; - break; - } - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3})); - $c += 3; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFC) == 0xF8): - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - if ($c+4 >= $strlen_var) { - $c += 4; - $ascii .= '?'; - break; - } - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4})); - $c += 4; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFE) == 0xFC): - if ($c+5 >= $strlen_var) { - $c += 5; - $ascii .= '?'; - break; - } - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4}), - ord($var{$c + 5})); - $c += 5; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - } - } - return '"'.$ascii.'"'; - - case 'array': - /* - * As per JSON spec if any array key is not an integer - * we must treat the the whole array as an object. We - * also try to catch a sparsely populated associative - * array with numeric keys here because some JS engines - * will create an array with empty indexes up to - * max_index which can cause memory issues and because - * the keys, which may be relevant, will be remapped - * otherwise. - * - * As per the ECMA and JSON specification an object may - * have any string as a property. Unfortunately due to - * a hole in the ECMA specification if the key is a - * ECMA reserved word or starts with a digit the - * parameter is only accessible using ECMAScript's - * bracket notation. - */ - - // treat as a JSON object - if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { - $properties = array_map(array($this, 'name_value'), - array_keys($var), - array_values($var)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - } - - // treat it like a regular array - $elements = array_map(array($this, '_encode'), $var); - - foreach($elements as $element) { - if(Services_JSON::isError($element)) { - return $element; - } - } - - return '[' . join(',', $elements) . ']'; - - case 'object': - - // support toJSON methods. - if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) { - // this may end up allowing unlimited recursion - // so we check the return value to make sure it's not got the same method. - $recode = $var->toJSON(); - - if (method_exists($recode, 'toJSON')) { - - return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) - ? 'null' - : new Services_JSON_Error(class_name($var). - " toJSON returned an object with a toJSON method."); - - } - - return $this->_encode( $recode ); - } - - $vars = get_object_vars($var); - - $properties = array_map(array($this, 'name_value'), - array_keys($vars), - array_values($vars)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - - default: - return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) - ? 'null' - : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); - } - } - - /** - * array-walking function for use in generating JSON-formatted name-value pairs - * - * @param string $name name of key to use - * @param mixed $value reference to an array element to be encoded - * - * @return string JSON-formatted name-value pair, like '"name":value' - * @access private - */ - function name_value($name, $value) - { - $encoded_value = $this->_encode($value); - - if(Services_JSON::isError($encoded_value)) { - return $encoded_value; - } - - return $this->_encode(strval($name)) . ':' . $encoded_value; - } - - /** - * reduce a string by removing leading and trailing comments and whitespace - * - * @param $str string string value to strip of comments and whitespace - * - * @return string string value stripped of comments and whitespace - * @access private - */ - function reduce_string($str) - { - $str = preg_replace(array( - - // eliminate single line comments in '// ...' form - '#^\s*//(.+)$#m', - - // eliminate multi-line comments in '/* ... */' form, at start of string - '#^\s*/\*(.+)\*/#Us', - - // eliminate multi-line comments in '/* ... */' form, at end of string - '#/\*(.+)\*/\s*$#Us' - - ), '', $str); - - // eliminate extraneous space - return trim($str); - } - - /** - * decodes a JSON string into appropriate variable - * - * @param string $str JSON-formatted string - * - * @return mixed number, boolean, string, array, or object - * corresponding to given JSON input string. - * See argument 1 to Services_JSON() above for object-output behavior. - * Note that decode() always returns strings - * in ASCII or UTF-8 format! - * @access public - */ - function decode($str) - { - $str = $this->reduce_string($str); - - switch (strtolower($str)) { - case 'true': - return true; - - case 'false': - return false; - - case 'null': - return null; - - default: - $m = array(); - - if (is_numeric($str)) { - // Lookie-loo, it's a number - - // This would work on its own, but I'm trying to be - // good about returning integers where appropriate: - // return (float)$str; - - // Return float or int, as appropriate - return ((float)$str == (integer)$str) - ? (integer)$str - : (float)$str; - - } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { - // STRINGS RETURNED IN UTF-8 FORMAT - $delim = $this->substr8($str, 0, 1); - $chrs = $this->substr8($str, 1, -1); - $utf8 = ''; - $strlen_chrs = $this->strlen8($chrs); - - for ($c = 0; $c < $strlen_chrs; ++$c) { - - $substr_chrs_c_2 = $this->substr8($chrs, $c, 2); - $ord_chrs_c = ord($chrs{$c}); - - switch (true) { - case $substr_chrs_c_2 == '\b': - $utf8 .= chr(0x08); - ++$c; - break; - case $substr_chrs_c_2 == '\t': - $utf8 .= chr(0x09); - ++$c; - break; - case $substr_chrs_c_2 == '\n': - $utf8 .= chr(0x0A); - ++$c; - break; - case $substr_chrs_c_2 == '\f': - $utf8 .= chr(0x0C); - ++$c; - break; - case $substr_chrs_c_2 == '\r': - $utf8 .= chr(0x0D); - ++$c; - break; - - case $substr_chrs_c_2 == '\\"': - case $substr_chrs_c_2 == '\\\'': - case $substr_chrs_c_2 == '\\\\': - case $substr_chrs_c_2 == '\\/': - if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || - ($delim == "'" && $substr_chrs_c_2 != '\\"')) { - $utf8 .= $chrs{++$c}; - } - break; - - case preg_match('/\\\u[0-9A-F]{4}/i', $this->substr8($chrs, $c, 6)): - // single, escaped unicode character - $utf16 = chr(hexdec($this->substr8($chrs, ($c + 2), 2))) - . chr(hexdec($this->substr8($chrs, ($c + 4), 2))); - $utf8 .= $this->utf162utf8($utf16); - $c += 5; - break; - - case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): - $utf8 .= $chrs{$c}; - break; - - case ($ord_chrs_c & 0xE0) == 0xC0: - // characters U-00000080 - U-000007FF, mask 110XXXXX - //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= $this->substr8($chrs, $c, 2); - ++$c; - break; - - case ($ord_chrs_c & 0xF0) == 0xE0: - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= $this->substr8($chrs, $c, 3); - $c += 2; - break; - - case ($ord_chrs_c & 0xF8) == 0xF0: - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= $this->substr8($chrs, $c, 4); - $c += 3; - break; - - case ($ord_chrs_c & 0xFC) == 0xF8: - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= $this->substr8($chrs, $c, 5); - $c += 4; - break; - - case ($ord_chrs_c & 0xFE) == 0xFC: - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= $this->substr8($chrs, $c, 6); - $c += 5; - break; - - } - - } - - return $utf8; - - } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { - // array, or object notation - - if ($str{0} == '[') { - $stk = array(SERVICES_JSON_IN_ARR); - $arr = array(); - } else { - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = array(); - } else { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = new stdClass(); - } - } - - array_push($stk, array('what' => SERVICES_JSON_SLICE, - 'where' => 0, - 'delim' => false)); - - $chrs = $this->substr8($str, 1, -1); - $chrs = $this->reduce_string($chrs); - - if ($chrs == '') { - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } else { - return $obj; - - } - } - - //print("\nparsing {$chrs}\n"); - - $strlen_chrs = $this->strlen8($chrs); - - for ($c = 0; $c <= $strlen_chrs; ++$c) { - - $top = end($stk); - $substr_chrs_c_2 = $this->substr8($chrs, $c, 2); - - if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { - // found a comma that is not inside a string, array, etc., - // OR we've reached the end of the character list - $slice = $this->substr8($chrs, $top['where'], ($c - $top['where'])); - array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); - //print("Found split at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - // we are in an array, so just push an element onto the stack - array_push($arr, $this->decode($slice)); - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - // we are in an object, so figure - // out the property name and set an - // element in an associative array, - // for now - $parts = array(); - - if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) { - // "name":value pair - $key = $this->decode($parts[1]); - $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B")); - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } elseif (preg_match('/^\s*(\w+)\s*:/Uis', $slice, $parts)) { - // name:value pair, where name is unquoted - $key = $parts[1]; - $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B")); - - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } - - } - - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { - // found a quote, and we are not inside a string - array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); - //print("Found start of string at {$c}\n"); - - } elseif (($chrs{$c} == $top['delim']) && - ($top['what'] == SERVICES_JSON_IN_STR) && - (($this->strlen8($this->substr8($chrs, 0, $c)) - $this->strlen8(rtrim($this->substr8($chrs, 0, $c), '\\'))) % 2 != 1)) { - // found a quote, we're in a string, and it's not escaped - // we know that it's not escaped becase there is _not_ an - // odd number of backslashes at the end of the string so far - array_pop($stk); - //print("Found end of string at {$c}: ".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '[') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-bracket, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); - //print("Found start of array at {$c}\n"); - - } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { - // found a right-bracket, and we're in an array - array_pop($stk); - //print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '{') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-brace, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); - //print("Found start of object at {$c}\n"); - - } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { - // found a right-brace, and we're in an object - array_pop($stk); - //print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($substr_chrs_c_2 == '/*') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a comment start, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); - $c++; - //print("Found start of comment at {$c}\n"); - - } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { - // found a comment end, and we're in one now - array_pop($stk); - $c++; - - for ($i = $top['where']; $i <= $c; ++$i) - $chrs = substr_replace($chrs, ' ', $i, 1); - - //print("Found end of comment at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } - - } - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - return $obj; - - } - - } - } - } - - /** - * @todo Ultimately, this should just call PEAR::isError() - */ - function isError($data, $code = null) - { - if (class_exists('pear')) { - return PEAR::isError($data, $code); - } elseif (is_object($data) && (get_class($data) == 'services_json_error' || - is_subclass_of($data, 'services_json_error'))) { - return true; - } - - return false; - } - - /** - * Calculates length of string in bytes - * @param string - * @return integer length - */ - function strlen8( $str ) - { - if ( $this->_mb_strlen ) { - return mb_strlen( $str, "8bit" ); - } - return strlen( $str ); - } - - /** - * Returns part of a string, interpreting $start and $length as number of bytes. - * @param string - * @param integer start - * @param integer length - * @return integer length - */ - function substr8( $string, $start, $length=false ) - { - if ( $length === false ) { - $length = $this->strlen8( $string ) - $start; - } - if ( $this->_mb_substr ) { - return mb_substr( $string, $start, $length, "8bit" ); - } - return substr( $string, $start, $length ); - } - -} - -if (class_exists('PEAR_Error')) { - - class Services_JSON_Error extends PEAR_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - parent::PEAR_Error($message, $code, $mode, $options, $userinfo); - } - } - -} else { - - /** - * @todo Ultimately, this class shall be descended from PEAR_Error - */ - class Services_JSON_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - - } - } - -} diff --git a/lib/lib_rss.php b/lib/lib_rss.php index b810e1296..1bba60c36 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -3,22 +3,6 @@ if (version_compare(PHP_VERSION, '5.6.0', '<')) { die('FreshRSS error: FreshRSS requires PHP 5.6.0+!'); } -if (!function_exists('json_decode')) { //PHP bug #63520 < PHP 7 - require_once(__DIR__ . '/JSON.php'); - function json_decode($var, $assoc = false) { - $JSON = new Services_JSON($assoc ? SERVICES_JSON_LOOSE_TYPE : 0); - return $JSON->decode($var); - } -} - -if (!function_exists('json_encode')) { - require_once(__DIR__ . '/JSON.php'); - function json_encode($var) { - $JSON = new Services_JSON(); - return $JSON->encodeUnsafe($var); - } -} - if (!function_exists('mb_strcut')) { function mb_strcut($str, $start, $length = null, $encoding = 'UTF-8') { return substr($str, $start, $length); diff --git a/phpcs.xml b/phpcs.xml index 8234aced8..c69f53ea4 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -8,7 +8,6 @@ ./lib/SimplePie/ ./lib/PHPMailer/ ./lib/http-conditional.php - ./lib/JSON.php ./lib/lib_phpQuery.php -- cgit v1.2.3 From 823f5815237af3b17ce24c6f224c8624dab6cc92 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 28 Sep 2019 23:16:21 +0200 Subject: Document Reeder compatibility (#2540) https://github.com/FreshRSS/FreshRSS/issues/2513 https://github.com/FreshRSS/FreshRSS/pull/2526 --- CHANGELOG.md | 6 ++++-- README.fr.md | 9 +++++---- README.md | 9 +++++---- docs/en/users/06_Fever_API.md | 10 +++++----- docs/en/users/06_Mobile_access.md | 2 ++ docs/fr/users/06_Fever_API.md | 10 +++++----- docs/fr/users/06_Mobile_access.md | 3 +++ 7 files changed, 29 insertions(+), 20 deletions(-) (limited to 'docs/fr/users') diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3670102..9aa49aafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * Including default feeds [#2515](https://github.com/FreshRSS/FreshRSS/pull/2515) * Add support for terms of service [#2520](https://github.com/FreshRSS/FreshRSS/pull/2520) * Add sharing with [Lemmy](https://github.com/dessalines/lemmy) [#2510](https://github.com/FreshRSS/FreshRSS/pull/2510) +* API + * Add support for [Reeder-4](https://www.reederapp.com/) client [#2513](https://github.com/FreshRSS/FreshRSS/issues/2513) * Compatibility * Require at least PHP 5.6+ [#2495](https://github.com/FreshRSS/FreshRSS/pull/2495), [#2527](https://github.com/FreshRSS/FreshRSS/pull/2527) * Require `php-json` and remove remove `JSON.php` fallback [#2528](https://github.com/FreshRSS/FreshRSS/pull/2528) @@ -322,8 +324,8 @@ * API * Add support for Fever compatible API, enabling more clients [#1406](https://github.com/FreshRSS/FreshRSS/pull/1406) - * iOS: [Fiery Feeds](https://itunes.apple.com/app/fiery-feeds-rss-reader/id1158763303), [Unread](https://itunes.apple.com/app/unread-rss-reader/id1252376153) - * MacOS: [Readkit](https://itunes.apple.com/app/readkit/id588726889) + * iOS: [Fiery Feeds](https://apps.apple.com/app/fiery-feeds-rss-reader/id1158763303), [Unread](https://apps.apple.com/app/unread-rss-reader/id1252376153) + * MacOS: [Readkit](https://apps.apple.com/app/readkit/id588726889) * Features * Several per-feed options (implemented in JSON) [#1838](https://github.com/FreshRSS/FreshRSS/pull/1838) * Mark updated articles as read [#891](https://github.com/FreshRSS/FreshRSS/issues/891) diff --git a/README.fr.md b/README.fr.md index 2f57b1234..78e4ed8de 100644 --- a/README.fr.md +++ b/README.fr.md @@ -187,6 +187,8 @@ Tout client supportant une API de type Google Reader ; Sélection : * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Libre, [F-Droid](https://f-droid.org/fr/packages/org.freshrss.easyrss/)) * GNU/Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Libre) +* iOS + * [Reeder-4](https://www.reederapp.com/) (Commercial) * MacOS * [Vienna RSS](http://www.vienna-rss.com/) (Libre) @@ -199,11 +201,10 @@ Tout client supportant une API de type Fever ; Sélection : * Android * [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) (Propriétaire) * iOS - * [Fiery Feeds](https://itunes.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Propriétaire) - * [Unread](https://itunes.apple.com/app/unread-rss-reader/id1252376153) (Propriétaire) - * [Reeder-3](https://itunes.apple.com/app/reeder-3/id697846300) (Propriétaire) + * [Fiery Feeds](https://apps.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Propriétaire) + * [Unread](https://apps.apple.com/app/unread-rss-reader/id1252376153) (Commercial) * MacOS - * [Readkit](https://itunes.apple.com/app/readkit/id588726889) (Propriétaire) + * [Readkit](https://apps.apple.com/app/readkit/id588726889) (Commercial) # Bibliothèques incluses diff --git a/README.md b/README.md index 223970d97..73d90b944 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,8 @@ Supported clients are: * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, [F-Droid](https://f-droid.org/packages/org.freshrss.easyrss/)) * GNU/Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) +* iOS + * [Reeder-4](https://www.reederapp.com/) (Commercial) * MacOS * [Vienna RSS](http://www.vienna-rss.com/) (Open source) @@ -199,11 +201,10 @@ Supported clients are: * Android * [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) (Closed source) * iOS - * [Fiery Feeds](https://itunes.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Closed source) - * [Unread](https://itunes.apple.com/app/unread-rss-reader/id1252376153) (Closed source) - * [Reeder-3](https://itunes.apple.com/app/reeder-3/id697846300) (Closed source) + * [Fiery Feeds](https://apps.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Closed source) + * [Unread](https://apps.apple.com/app/unread-rss-reader/id1252376153) (Commercial) * MacOS - * [Readkit](https://itunes.apple.com/app/readkit/id588726889) (Closed source) + * [Readkit](https://apps.apple.com/app/readkit/id588726889) (Commercial) # Included libraries diff --git a/docs/en/users/06_Fever_API.md b/docs/en/users/06_Fever_API.md index b895d4eae..d231c9fc5 100644 --- a/docs/en/users/06_Fever_API.md +++ b/docs/en/users/06_Fever_API.md @@ -21,15 +21,15 @@ Then point your mobile application to the URL of `fever.php` (e.g. `https://fres Tested with: - Android - - [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) + - [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) (Closed source) - iOS - - [Fiery Feeds](https://itunes.apple.com/app/fiery-feeds-rss-reader/id1158763303) - - [Unread](https://itunes.apple.com/app/unread-rss-reader/id1252376153) - - [Reeder-4](https://itunes.apple.com/app/reeder-4/id1449412357) + - [Fiery Feeds](https://apps.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Closed source) + - [Unread](https://apps.apple.com/app/unread-rss-reader/id1252376153) (Commercial) + - [Reeder](https://www.reederapp.com/) (Commercial) (Use its Google Reader API option instead) - MacOS - - [Readkit](https://itunes.apple.com/app/readkit/id588726889) + - [Readkit](https://apps.apple.com/app/readkit/id588726889) (Commercial) ## Features diff --git a/docs/en/users/06_Mobile_access.md b/docs/en/users/06_Mobile_access.md index be4d0ded2..a131d76c3 100644 --- a/docs/en/users/06_Mobile_access.md +++ b/docs/en/users/06_Mobile_access.md @@ -53,6 +53,8 @@ See the [page about the Fever compatible API](06_Fever_API.md) for another possi * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, [F-Droid](https://f-droid.org/packages/org.freshrss.easyrss/)) * Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) + * iOS + * [Reeder-4](https://apps.apple.com/app/reeder-4/id1449412357) (Commercial) * MacOS * [Vienna RSS](http://www.vienna-rss.com/) (Open source) * Firefox diff --git a/docs/fr/users/06_Fever_API.md b/docs/fr/users/06_Fever_API.md index fb15e596b..c3623b341 100644 --- a/docs/fr/users/06_Fever_API.md +++ b/docs/fr/users/06_Fever_API.md @@ -8,15 +8,15 @@ et des généralités sur l’accès par API. Testé avec: - Android - [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) + [Readably](https://play.google.com/store/apps/details?id=com.isaiasmatewos.readably) (Propriétaire) - iOS - - [Fiery Feeds](https://itunes.apple.com/app/fiery-feeds-rss-reader/id1158763303) - - [Unread](https://itunes.apple.com/app/unread-rss-reader/id1252376153) - - [Reeder-3](https://itunes.apple.com/app/reeder-3/id697846300) + - [Fiery Feeds](https://apps.apple.com/app/fiery-feeds-rss-reader/id1158763303) (Propriétaire) + - [Unread](https://apps.apple.com/app/unread-rss-reader/id1252376153) (Commercial) + - [Reeder](https://www.reederapp.com/) (Commercial) (Connectez-vous plutôt par son option Google Reader API) - MacOS - - [Readkit](https://itunes.apple.com/app/readkit/id588726889) + - [Readkit](https://apps.apple.com/app/readkit/id588726889) (Commercial) ## TODO diff --git a/docs/fr/users/06_Mobile_access.md b/docs/fr/users/06_Mobile_access.md index 225c55c7c..9f8c64f5c 100644 --- a/docs/fr/users/06_Mobile_access.md +++ b/docs/fr/users/06_Mobile_access.md @@ -67,11 +67,14 @@ Tout client supportant une API de type Google Reader. Sélection : * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Libre, F-Droid) * Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Libre) +* iOS + * [Reeder-4](https://apps.apple.com/app/reeder-4/id1449412357) (Commercial) * MacOS * [Vienna RSS](http://www.vienna-rss.com/) (Libre) * Firefox * [FreshRSS-Notify](https://addons.mozilla.org/fr/firefox/addon/freshrss-notify-webextension/) (Libre) + # API compatible Google Reader Exemples de requêtes simples : -- cgit v1.2.3 From 37b52b7361d3ac15273ca19a0b96ef74299e759e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 1 Oct 2019 18:12:21 +0200 Subject: Trim whitespace (#2544) --- CHANGELOG.md | 4 +- Docker/README.md | 2 +- app/shares.php | 10 +- app/views/helpers/index/normal/entry_header.phtml | 29 +++--- app/views/index/tos.phtml | 20 ++-- app/views/user/profile.phtml | 6 +- app/views/user/validateEmail.phtml | 34 +++---- cli/README.md | 2 +- docs/en/admins/02_Installation.md | 2 +- docs/en/admins/03_Updating.md | 4 +- docs/en/contributing.md | 2 +- docs/en/developers/01_First_steps.md | 42 ++++----- docs/en/developers/03_Backend/05_Extensions.md | 110 +++++++++++----------- docs/en/users/03_Main_view.md | 16 ++-- docs/en/users/05_Configuration.md | 2 +- docs/en/users/07_Frequently_Asked_Questions.md | 2 +- docs/fr/developers/01_First_steps.md | 40 ++++---- docs/fr/developers/03_Backend/05_Extensions.md | 78 +++++++-------- docs/fr/users/06_Mobile_access.md | 4 +- docs/fr/users/07_Frequently_Asked_Questions.md | 4 +- lib/Minz/ModelPdo.php | 6 +- 21 files changed, 209 insertions(+), 210 deletions(-) (limited to 'docs/fr/users') diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa49aafe..e68c9a2fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -522,7 +522,7 @@ * Simplified Chinese [#1541](https://github.com/FreshRSS/FreshRSS/pull/1541) * Improve English [#1465](https://github.com/FreshRSS/FreshRSS/pull/1465) * Improve Dutch [#1559](https://github.com/FreshRSS/FreshRSS/pull/1559) - * Added Spanish language [#1631] (https://github.com/FreshRSS/FreshRSS/pull/1631/) + * Added Spanish language [#1631] (https://github.com/FreshRSS/FreshRSS/pull/1631/) * Security * Do not require write access to check availability of new versions [#1450](https://github.com/FreshRSS/FreshRSS/issues/1450) * Misc. @@ -548,7 +548,7 @@ * New command `./cli/reconfigure.php` to update an existing installation [#1439](https://github.com/FreshRSS/FreshRSS/pull/1439) * Many CLI improvements [#1447](https://github.com/FreshRSS/FreshRSS/pull/1447) * More information (number of feeds, articles, etc.) in `./cli/user-info.php` - * Better idempotency of `./cli/do-install.php` and language parameter [#1449](https://github.com/FreshRSS/FreshRSS/issues/1449) + * Better idempotency of `./cli/do-install.php` and language parameter [#1449](https://github.com/FreshRSS/FreshRSS/issues/1449) * Bug fixing * Fix several CLI issues [#1445](https://github.com/FreshRSS/FreshRSS/issues/1445) * Fix CLI install bugs with SQLite [#1443](https://github.com/FreshRSS/FreshRSS/issues/1443), [#1448](https://github.com/FreshRSS/FreshRSS/issues/1448) diff --git a/Docker/README.md b/Docker/README.md index 4146a57dd..13988a316 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -48,7 +48,7 @@ docker run -d --restart unless-stopped --log-opt max-size=10m \ See [more information about Docker and Let’s Encrypt in Træfik](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/). -## Run FreshRSS +## Run FreshRSS Example using the built-in refresh cron job (see further below for alternatives). You must first chose a domain (DNS) or sub-domain, e.g. `freshrss.example.net`. diff --git a/app/shares.php b/app/shares.php index 71860c9e3..9df83617a 100644 --- a/app/shares.php +++ b/app/shares.php @@ -139,9 +139,9 @@ return array( 'method' => 'GET', ), 'lemmy' => array( - 'url' => '~URL~/create_post?url=~LINK~&name=~TITLE~', - 'transform' => array('rawurlencode'), - 'form' => 'advanced', - 'method' => 'GET', - ), + 'url' => '~URL~/create_post?url=~LINK~&name=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'advanced', + 'method' => 'GET', + ), ); diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml index 7873b16e4..82c209bb2 100644 --- a/app/views/helpers/index/normal/entry_header.phtml +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -28,21 +28,20 @@ } } ?>
  • ✇ feed->name(); ?>
  • -
  • entry->title(); ?>
    - entry->authors(); - if (is_array($authors)): - $first = true; - foreach ($authors as $author): - echo $first ? $author : ', ' . $author; - $first = false; - endforeach; - endif; - ?>
  • +
  • entry->title(); ?>
    entry->authors(); + if (is_array($authors)) { + $first = true; + foreach ($authors as $author) { + echo $first ? $author : ', ' . $author; + $first = false; + } + } + ?>
  • entry->date(); ?> 
  • diff --git a/app/views/index/tos.phtml b/app/views/index/tos.phtml index 79c597244..1b3498134 100644 --- a/app/views/index/tos.phtml +++ b/app/views/index/tos.phtml @@ -1,13 +1,13 @@
    - can_register) { ?> - - - - - - - - + can_register) { ?> + + + + + + + + - terms_of_service; ?> + terms_of_service; ?>
    diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml index df43642dd..de717b36e 100644 --- a/app/views/user/profile.phtml +++ b/app/views/user/profile.phtml @@ -1,7 +1,7 @@ disable_aside) { - $this->partial('aside_configure'); - } + if (!$this->disable_aside) { + $this->partial('aside_configure'); + } ?>
    diff --git a/app/views/user/validateEmail.phtml b/app/views/user/validateEmail.phtml index a246c222e..51517f5eb 100644 --- a/app/views/user/validateEmail.phtml +++ b/app/views/user/validateEmail.phtml @@ -1,22 +1,22 @@
    -

    - title); ?> -

    +

    + title); ?> +

    -

    - mail_login); ?> -

    +

    + mail_login); ?> +

    -
    - - -
    +
    + + +
    -

    - - - -

    +

    + + + +

    diff --git a/cli/README.md b/cli/README.md index 35c9bad9b..89b440a39 100644 --- a/cli/README.md +++ b/cli/README.md @@ -128,4 +128,4 @@ Example to get the number of feeds of a given user: # Install and updates If you want to administrate FreshRSS using git, please read our [installation docs](https://freshrss.github.io/FreshRSS/en/admins/02_Installation.html) -and [update guidelines](https://freshrss.github.io/FreshRSS/en/admins/03_Updating.html). +and [update guidelines](https://freshrss.github.io/FreshRSS/en/admins/03_Updating.html). diff --git a/docs/en/admins/02_Installation.md b/docs/en/admins/02_Installation.md index 446ef0dcf..7bba647ec 100644 --- a/docs/en/admins/02_Installation.md +++ b/docs/en/admins/02_Installation.md @@ -137,7 +137,7 @@ A step-by-step tutorial is available [in French](http://www.pihomeserver.fr/2013 # Security -Make sure to expose only the `./p/` folder on the web, the other directories contain personal and sensitive data. +Make sure to expose only the `./p/` folder on the web, the other directories contain personal and sensitive data. See the Apache and nginx config examples above. **TODO** diff --git a/docs/en/admins/03_Updating.md b/docs/en/admins/03_Updating.md index 4e1fdfa5d..461366049 100644 --- a/docs/en/admins/03_Updating.md +++ b/docs/en/admins/03_Updating.md @@ -15,7 +15,7 @@ The update process depends on your installation type, see below: Change to your installation at http://localhost/FreshRSS/p/i/?c=update and hit the "Check for new updates" button. -If there is a new version you will be prompted again. +If there is a new version you will be prompted again. ## Using git @@ -72,7 +72,7 @@ cd /usr/share/FreshRSS ``` Commands intended to be executed in order (you can c/p the whole block if desired): - + ```sh wget https://github.com/FreshRSS/FreshRSS/archive/master.zip unzip master.zip diff --git a/docs/en/contributing.md b/docs/en/contributing.md index 45c1650fb..870e0c14f 100644 --- a/docs/en/contributing.md +++ b/docs/en/contributing.md @@ -52,5 +52,5 @@ We are working on a better way to handle internationalization but don't hesitate ## Contribute to documentation -The documentation needs a lot of improvements in order to be more useful to new contributors and we are working on it. +The documentation needs a lot of improvements in order to be more useful to new contributors and we are working on it. If you want to give some help, meet us in the main repositories [docs directory](https://github.com/FreshRSS/FreshRSS/tree/master/docs)! diff --git a/docs/en/developers/01_First_steps.md b/docs/en/developers/01_First_steps.md index 6b7f437a7..28c249be4 100644 --- a/docs/en/developers/01_First_steps.md +++ b/docs/en/developers/01_First_steps.md @@ -61,7 +61,7 @@ The `TAG` variable can be anything (e.g. `dev-local`). You can target a specific # Extensions -If you want to create your own FreshRSS extension, take a look at the [extension documentation](03_Backend/05_Extensions.md). +If you want to create your own FreshRSS extension, take a look at the [extension documentation](03_Backend/05_Extensions.md). # Coding style @@ -110,7 +110,7 @@ There is a space before and after every operator. ```php if ($a == 10) { - // do something + // do something } echo $a ? 1 : 0; @@ -122,11 +122,11 @@ There is no spaces in the brackets. There is no space before the opening bracket ```php if ($a == 10) { - // do something + // do something } if ((int)$a == 10) { - // do something + // do something } ``` @@ -137,16 +137,16 @@ It happens most of the time in Javascript files. When there is chained functions ```javascript // First instruction shortcut.add(shortcuts.mark_read, function () { - //... - }, { - 'disable_in_input': true - }); + //... + }, { + 'disable_in_input': true + }); // Second instruction shortcut.add("shift+" + shortcuts.mark_read, function () { - //... - }, { - 'disable_in_input': true - }); + //... + }, { + 'disable_in_input': true + }); ``` ## Line length @@ -158,7 +158,7 @@ With functions, parameters can be declared on different lines. ```php function my_function($param_1, $param_2, $param_3, $param_4) { - // do something + // do something } ``` @@ -173,7 +173,7 @@ They must follow the "snake case" convention. ```php // a function function function_name() { - // do something + // do something } // a variable $variable_name; @@ -185,7 +185,7 @@ They must follow the "lower camel case" convention. ```php private function methodName() { - // do something + // do something } ``` @@ -213,7 +213,7 @@ They must be at the end of the line if a condition runs on more than one line. ```php if ($a == 10 || $a == 20) { - // do something + // do something } ``` @@ -226,9 +226,9 @@ If the file contains only PHP code, the PHP closing tag must be omitted. If an array declaration runs on more than one line, each element must be followed by a comma even the last one. ```php -$variable = array( - "value 1", - "value 2", - "value 3", -); +$variable = [ + "value 1", + "value 2", + "value 3", +]; ``` diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md index 7c1f8c046..0cfa5c8b7 100644 --- a/docs/en/developers/03_Backend/05_Extensions.md +++ b/docs/en/developers/03_Backend/05_Extensions.md @@ -48,13 +48,13 @@ Code example: view->a_variable = 'FooBar'; - } + public function indexAction() { + $this->view->a_variable = 'FooBar'; + } - public function worldAction() { - $this->view->a_variable = 'Hello World!'; - } + public function worldAction() { + $this->view->a_variable = 'Hello World!'; + } } ?> @@ -74,7 +74,7 @@ As explained above, the views consist of HTML mixed with PHP. Code example: ```html

    - This is a parameter passed from the controller: a_variable; ?> + This is a parameter passed from the controller: a_variable; ?>

    ``` @@ -119,7 +119,7 @@ To take full advantage of the Minz routing system, it is strongly discouraged to ```html

    - Go to page Hello world! + Go to page Hello world!

    ``` @@ -130,13 +130,13 @@ So use the `Minz_Url` class and its `display()` method instead. `Minz_Url::displ ```php 'hello', - 'a' => 'world', - 'params' => array( - 'foo' => 'bar', - ) -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', + 'params' => [ + 'foo' => 'bar', + ], +]; // Show something like .?c=hello&a=world&foo=bar echo Minz_Url::display($url_array); @@ -166,10 +166,10 @@ Code example: ```php 'hello', - 'a' => 'world' -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', +]; // Tells Minz to redirect the user to the hello / world page. // Note that this is a redirection in the Minz sense of the term, not a redirection that the browser will have to manage (HTTP code 301 or 302) @@ -188,10 +188,10 @@ It is very common to want display a message to the user while performing a redir ```php 'hello', - 'a' => 'world' -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', +]; $feedback_good = 'Tout s\'est bien passé !'; $feedback_bad = 'Oups, quelque chose n\'a pas marché.'; @@ -226,18 +226,18 @@ The translation files are quite simple: it is only a matter of returning a PHP t array( - 'actualize' => 'Actualiser', - 'back_to_rss_feeds' => '← Retour à vos flux RSS', - 'cancel' => 'Annuler', - 'create' => 'Créer', - 'disable' => 'Désactiver', - ), - 'freshrss' => array( - '_' => 'FreshRSS', - 'about' => 'À propos de FreshRSS', - ), -); + 'action' => [ + 'actualize' => 'Actualiser', + 'back_to_rss_feeds' => '← Retour à vos flux RSS', + 'cancel' => 'Annuler', + 'create' => 'Créer', + 'disable' => 'Désactiver', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'À propos de FreshRSS', + ), +]; ?> ``` @@ -247,9 +247,9 @@ Code example: ```html

    - - - + + +

    ``` @@ -267,8 +267,8 @@ An extension allows you to add functionality easily to FreshRSS without having t ### Basic files and folders -The first thing to note is that **all** extensions **must** be located in the `extensions` directory, at the base of the FreshRSS tree. -An extension is a directory containing a set of mandatory (and optional) files and subdirectories. +The first thing to note is that **all** extensions **must** be located in the `extensions` directory, at the base of the FreshRSS tree. +An extension is a directory containing a set of mandatory (and optional) files and subdirectories. The convention requires that the main directory name be preceded by an "x" to indicate that it is not an extension included by default in FreshRSS. The main directory of an extension must contain at least two **mandatory** files: @@ -276,16 +276,16 @@ The main directory of an extension must contain at least two **mandatory** files - A `metadata.json` file that contains a description of the extension. This file is written in JSON. - An `extension.php` file containing the entry point of the extension (which is a class that inherits Minz_Extension). -Please note that there is a not a required link between the directory name of the extension and the name of the class inside `extension.php`, -but you should follow our best practice: +Please note that there is a not a required link between the directory name of the extension and the name of the class inside `extension.php`, +but you should follow our best practice: If you want to write a `HelloWorld` extension, the directory name should be `xExtension-HelloWorld` and the base class name `HelloWorldExtension`. In the file `freshrss/extensions/xExtension-HelloWorld/extension.php` you need the structure: ```html class HelloWorldExtension extends Minz_Extension { - public function init() { - // your code here - } + public function init() { + // your code here + } } ``` There is an example HelloWorld extension that you can download from [our GitHub repo](https://github.com/FreshRSS/xExtension-HelloWorld). @@ -315,14 +315,14 @@ Only the `name` and` entrypoint` fields are required. ### Choose between « system » or « user » -A __user__ extension can be enabled by some users and not by others (typically for user preferences). +A __user__ extension can be enabled by some users and not by others (typically for user preferences). A __system__ extension in comparison is enabled for every account. ### Writing your own extension.php -This file is the entry point of your extension. It must contain a specific class to function. -As mentioned above, the name of the class must be your `entrypoint` suffixed by` Extension` (`HelloWorldExtension` for example). +This file is the entry point of your extension. It must contain a specific class to function. +As mentioned above, the name of the class must be your `entrypoint` suffixed by` Extension` (`HelloWorldExtension` for example). In addition, this class must be inherited from the `Minz_Extension` class to benefit from extensions-specific methods. Your class will benefit from four methods to redefine: @@ -351,13 +351,13 @@ You can register at the FreshRSS event system in an extensions `init()` method, ```html class HelloWorldExtension extends Minz_Extension { - public function init() { - $this->registerHook('entry_before_display', array($this, 'renderEntry')); - } - public function renderEntry($entry) { - $entry->_content('

    Hello World

    ' . $entry->content()); - return $entry; - } + public function init() { + $this->registerHook('entry_before_display', array($this, 'renderEntry')); + } + public function renderEntry($entry) { + $entry->_content('

    Hello World

    ' . $entry->content()); + return $entry; + } } ``` diff --git a/docs/en/users/03_Main_view.md b/docs/en/users/03_Main_view.md index 59d051e7e..c6c3e3b50 100644 --- a/docs/en/users/03_Main_view.md +++ b/docs/en/users/03_Main_view.md @@ -32,20 +32,20 @@ Here is an example to trigger article update every hour. Special parameters to configure the script - all parameters can be combined: -- Parameter "force" -https://freshrss.example.net/i/?c=feed&a=actualize&force=1 +- Parameter "force" +https://freshrss.example.net/i/?c=feed&a=actualize&force=1 If *force* is set to 1 all feeds will be refreshed at once. -- Parameter "ajax" -https://freshrss.example.net/i/?c=feed&a=actualize&ajax=1 +- Parameter "ajax" +https://freshrss.example.net/i/?c=feed&a=actualize&ajax=1 Only a status site is returned and not a complete website. Example: "OK" -- Parameter "maxFeeds" -https://freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=30 +- Parameter "maxFeeds" +https://freshrss.example.net/i/?c=feed&a=actualize&maxFeeds=30 If *maxFeeds* is set the configured amount of feeds is refreshed at once. The default setting is "10". -- Parameter "token" -https://freshrss.example.net/i/?c=feed&a=actualize&token=542345872345734 +- Parameter "token" +https://freshrss.example.net/i/?c=feed&a=actualize&token=542345872345734 Security parameter to prevent unauthorized refreshes. For detailed Documentation see "Form authentication". ### Online cron diff --git a/docs/en/users/05_Configuration.md b/docs/en/users/05_Configuration.md index 225c1e5f9..f635f9d5e 100644 --- a/docs/en/users/05_Configuration.md +++ b/docs/en/users/05_Configuration.md @@ -9,7 +9,7 @@ the missing bits or add a new language, please check how you can [contribute to There are parts of FreshRSS that are not translated and are not intended to be translated. For now, the logs visible in the application as well as the one generated by automatic update scripts are part of it. -Available languages are: cz, de, en, es, fr, he, it, kr, nl, oc, pt-br, ru, tr, zh-cn. +Available languages are: cz, de, en, es, fr, he, it, kr, nl, oc, pt-br, ru, tr, zh-cn. ## Theme diff --git a/docs/en/users/07_Frequently_Asked_Questions.md b/docs/en/users/07_Frequently_Asked_Questions.md index 42156b1a9..fd3db4bea 100644 --- a/docs/en/users/07_Frequently_Asked_Questions.md +++ b/docs/en/users/07_Frequently_Asked_Questions.md @@ -47,7 +47,7 @@ For more information on that matter, there is a [dedicated documentation](../../ ## Permissions under SELinux -Some Linux distribution like Fedora or RedHat Enterprise Linux have SELinux system enabled. This acts like a firewall application, so all applications cannot write/modify files under certain conditions. While installing FreshRSS, step 2 can fail if the httpd process cannot write to some data sub-directories, the following command should be executed as root : +Some Linux distribution like Fedora or RedHat Enterprise Linux have SELinux system enabled. This acts like a firewall application, so all applications cannot write/modify files under certain conditions. While installing FreshRSS, step 2 can fail if the httpd process cannot write to some data sub-directories, the following command should be executed as root : ```sh semanage fcontext -a -t httpd_sys_rw_content_t '/usr/share/FreshRSS/data(/.*)?' restorecon -Rv /usr/share/FreshRSS/data diff --git a/docs/fr/developers/01_First_steps.md b/docs/fr/developers/01_First_steps.md index dd38bcb3f..df3fa65f2 100644 --- a/docs/fr/developers/01_First_steps.md +++ b/docs/fr/developers/01_First_steps.md @@ -57,7 +57,7 @@ Chaque opérateur est entouré d'espaces. ```php if ($a == 10) { - // faire quelque chose + // faire quelque chose } echo $a ? 1 : 0; @@ -69,11 +69,11 @@ Il n'y a pas d'espaces entre des parenthèses. Il n'y a pas d'espaces avant une ```php if ($a == 10) { - // faire quelque chose + // faire quelque chose } if ((int)$a == 10) { - // faire quelque chose + // faire quelque chose } ``` @@ -84,16 +84,16 @@ Ce cas se présente le plus souvent en Javascript. Quand on a des fonctions chai ```javascript // Première instruction shortcut.add(shortcuts.mark_read, function () { - //... - }, { - 'disable_in_input': true - }); + //... + }, { + 'disable_in_input': true + }); // Deuxième instruction shortcut.add("shift+" + shortcuts.mark_read, function () { - //... - }, { - 'disable_in_input': true - }); + //... + }, { + 'disable_in_input': true + }); ``` ## Longueur des lignes @@ -105,7 +105,7 @@ Dans le cas des fonctions, les paramètres peuvent être déclarés sur plusieur ```php function ma_fonction($param_1, $param_2, $param_3, $param_4) { - // faire quelque chose + // faire quelque chose } ``` @@ -120,7 +120,7 @@ Les fonctions et les variables doivent suivre la convention "snake case". ```php // une fontion function nom_de_la_fontion() { - // faire quelque chose + // faire quelque chose } // une variable $nom_de_la_variable; @@ -132,7 +132,7 @@ Les méthodes doivent suivre la convention "lower camel case". ```php private function nomDeLaMethode() { - // faire quelque chose + // faire quelque chose } ``` @@ -160,7 +160,7 @@ Les opérateurs doivent être en fin de ligne dans le cas de conditions sur plus ```php if ($a == 10 || $a == 20) { - // faire quelque chose + // faire quelque chose } ``` @@ -173,9 +173,9 @@ Si le fichier ne contient que du PHP, il ne doit pas comporter de balise fermant Lors de l'écriture de tableaux sur plusieurs lignes, tous les éléments doivent être suivis d'une virgule (même le dernier). ```php -$variable = array( - "valeur 1", - "valeur 2", - "valeur 3", -); +$variable = [ + "valeur 1", + "valeur 2", + "valeur 3", +]; ``` diff --git a/docs/fr/developers/03_Backend/05_Extensions.md b/docs/fr/developers/03_Backend/05_Extensions.md index 2ee81b781..3a23e0c5a 100644 --- a/docs/fr/developers/03_Backend/05_Extensions.md +++ b/docs/fr/developers/03_Backend/05_Extensions.md @@ -49,13 +49,13 @@ Exemple de code : view->a_variable = 'FooBar'; - } + public function indexAction() { + $this->view->a_variable = 'FooBar'; + } - public function worldAction() { - $this->view->a_variable = 'Hello World!'; - } + public function worldAction() { + $this->view->a_variable = 'Hello World!'; + } } ?> @@ -75,7 +75,7 @@ Comme expliqué plus haut, les vues sont du code HTML mixé à du PHP. Exemple d ```html

    - Phrase passée en paramètre : a_variable; ?> + Phrase passée en paramètre : a_variable; ?>

    ``` @@ -119,7 +119,7 @@ Pour profiter pleinement du système de routage de Minz, il est fortement décon ```html

    - Accéder à la page Hello world! + Accéder à la page Hello world!

    ``` @@ -130,13 +130,13 @@ Préférez donc l'utilisation de la classe `Minz_Url` et de sa méthode `display ```php 'hello', - 'a' => 'world', - 'params' => array( - 'foo' => 'bar', - ) -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', + 'params' => [ + 'foo' => 'bar', + ], +]; // Affichera quelque chose comme .?c=hello&a=world&foo=bar echo Minz_Url::display($url_array); @@ -166,10 +166,10 @@ Exemple de code : ```php 'hello', - 'a' => 'world' -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', +]; // Indique à Minz de rediriger l'utilisateur vers la page hello/world. // Notez qu'il s'agit d'une redirection au sens Minz du terme, pas d'une redirection que le navigateur va avoir à gérer (code HTTP 301 ou 302) @@ -188,10 +188,10 @@ Il est très fréquent de vouloir effectuer une redirection tout en affichant un ```php 'hello', - 'a' => 'world' -); +$url_array = [ + 'c' => 'hello', + 'a' => 'world', +]; $feedback_good = 'Tout s\'est bien passé !'; $feedback_bad = 'Oups, quelque chose n\'a pas marché.'; @@ -225,19 +225,19 @@ Les fichiers de traduction sont assez simples : il s'agit seulement de retourne ```php array( - 'actualize' => 'Actualiser', - 'back_to_rss_feeds' => '← Retour à vos flux RSS', - 'cancel' => 'Annuler', - 'create' => 'Créer', - 'disable' => 'Désactiver', - ), - 'freshrss' => array( - '_' => 'FreshRSS', - 'about' => 'À propos de FreshRSS', - ), -); +return [ + 'action' => [ + 'actualize' => 'Actualiser', + 'back_to_rss_feeds' => '← Retour à vos flux RSS', + 'cancel' => 'Annuler', + 'create' => 'Créer', + 'disable' => 'Désactiver', + ], + 'freshrss' => [ + '_' => 'FreshRSS', + 'about' => 'À propos de FreshRSS', + ], +]; ?> ``` @@ -246,9 +246,9 @@ Pour accéder à ces traductions, `Minz_Translate` va nous aider à l'aide de sa ```html

    - - - + + +

    ``` diff --git a/docs/fr/users/06_Mobile_access.md b/docs/fr/users/06_Mobile_access.md index 9f8c64f5c..f637ccf5b 100644 --- a/docs/fr/users/06_Mobile_access.md +++ b/docs/fr/users/06_Mobile_access.md @@ -45,7 +45,7 @@ Voir la [page sur l’API compatible Fever](06_Fever_API.md) pour une autre poss 6. Vous pouvez maintenant tester sur une application mobile (News+, FeedMe, ou EasyRSS sur Android) * en utilisant comme adresse https://rss.example.net/api/greader.php ou http://example.net/FreshRSS/p/api/greader.php selon la configuration de votre site Web. - * ⚠️ attention aux majuscules et aux espaces en tapant l’adresse avec le clavier du mobile ⚠️ + * ⚠️ attention aux majuscules et aux espaces en tapant l’adresse avec le clavier du mobile ⚠️ * avec votre nom d’utilisateur et le mot de passe enregistré au point 2 (mot de passe API). @@ -53,7 +53,7 @@ Voir la [page sur l’API compatible Fever](06_Fever_API.md) pour une autre poss * Vous pouvez voir les logs API dans `./FreshRSS/data/users/_/log_api.txt` * Si vous avez une erreur 404 (fichier non trouvé) lors de l’étape de test, et que vous êtes sous Apache, - voir http://httpd.apache.org/docs/trunk/mod/core.html#allowencodedslashes pour utiliser News+ + voir http://httpd.apache.org/docs/trunk/mod/core.html#allowencodedslashes pour utiliser News+ (facultatif pour EasyRSS et FeedMe qui devraient fonctionner dès lors que vous obtenez un PASS au test *Check partial server configuration*). diff --git a/docs/fr/users/07_Frequently_Asked_Questions.md b/docs/fr/users/07_Frequently_Asked_Questions.md index 2dc2cae97..87ff8631a 100644 --- a/docs/fr/users/07_Frequently_Asked_Questions.md +++ b/docs/fr/users/07_Frequently_Asked_Questions.md @@ -19,9 +19,9 @@ L'explication est la même pour les fichiers ```favicon.ico``` et ```.htaccess`` ## Pourquoi j'ai des erreurs quand j'essaye d'enregistrer un flux ? -Il peut y avoir différentes origines à ce problème. +Il peut y avoir différentes origines à ce problème. Le flux peut avoir une syntaxe invalide, il peut ne pas être reconnu par la bibliothèque SimplePie, l'hébergement peut avoir des problèmes, FreshRSS peut être boggué. -Il faut dans un premier temps déterminer la cause du problème. +Il faut dans un premier temps déterminer la cause du problème. Voici la liste des étapes à suivre pour la déterminer : 1. __Vérifier la validité du flux__ grâce à l'[outil en ligne du W3C](http://validator.w3.org/feed/ "Validateur en ligne de flux RSS et Atom"). Si ça ne fonctionne pas, nous ne pouvons rien faire. diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 3fabb73c8..873fa21ff 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -117,7 +117,7 @@ abstract class MinzPDO extends PDO { public function __construct($dsn, $username = null, $passwd = null, $options = null) { parent::__construct($dsn, $username, $passwd, $options); $this->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); - } + } abstract public function dbType(); @@ -178,7 +178,7 @@ class MinzPDOSQLite extends MinzPDO { public function __construct($dsn, $username = null, $passwd = null, $options = null) { parent::__construct($dsn, $username, $passwd, $options); $this->exec('PRAGMA foreign_keys = ON;'); - } + } public function dbType() { return 'sqlite'; @@ -193,7 +193,7 @@ class MinzPDOPGSQL extends MinzPDO { public function __construct($dsn, $username = null, $passwd = null, $options = null) { parent::__construct($dsn, $username, $passwd, $options); $this->exec("SET NAMES 'UTF8';"); - } + } public function dbType() { return 'pgsql'; -- cgit v1.2.3 From 61724c651b18934690b2102537e0a5f7ab4284e4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 5 Oct 2019 15:48:25 +0200 Subject: PostgreSQL 9.5+ (#2554) Needed for `CREATE INDEX IF NOT EXISTS` syntax. Supported as back as Ubuntu 16.04 LTS. Similar version checks than for the PHP version bump https://github.com/FreshRSS/FreshRSS/pull/2495 https://www.postgresql.org/docs/9.5/sql-createindex.html https://www.postgresql.org/docs/9.5/release-9-5.html --- README.fr.md | 2 +- README.md | 2 +- app/SQL/install.sql.pgsql.php | 18 +++++++++--------- docs/en/admins/02_Installation.md | 2 +- docs/fr/users/01_Installation.md | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'docs/fr/users') diff --git a/README.fr.md b/README.fr.md index 78e4ed8de..ae89a0b58 100644 --- a/README.fr.md +++ b/README.fr.md @@ -46,7 +46,7 @@ FreshRSS n’est fourni avec aucune garantie. * PHP 5.6+ (PHP 7+ recommandé pour de meilleures performances) * Requis : [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype), et [PDO_MySQL](https://www.php.net/pdo-mysql) ou [PDO_SQLite](https://www.php.net/pdo-sqlite) ou [PDO_PGSQL](https://www.php.net/pdo-pgsql) * Recommandés : [GMP](https://www.php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](https://www.php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](https://www.php.net/mbstring) (pour le texte Unicode), [iconv](https://www.php.net/iconv) (pour conversion d’encodages), [ZIP](https://www.php.net/zip) (pour import/export), [zlib](https://www.php.net/zlib) (pour les flux compressés) -* MySQL 5.5.3+ (recommandé) ou équivalent MariaDB, ou SQLite 3.7.4+, ou PostgreSQL 9.2+ +* MySQL 5.5.3+ ou équivalent MariaDB, ou SQLite 3.7.4+, ou PostgreSQL 9.5+ # Téléchargement diff --git a/README.md b/README.md index 73d90b944..cf3fbdddb 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ FreshRSS comes with absolutely no warranty. * PHP 5.6+ (PHP 7+ recommended for higher performance) * Required extensions: [cURL](https://www.php.net/curl), [DOM](https://www.php.net/dom), [JSON](https://www.php.net/json), [XML](https://www.php.net/xml), [session](https://www.php.net/session), [ctype](https://www.php.net/ctype), and [PDO_MySQL](https://www.php.net/pdo-mysql) or [PDO_SQLite](https://www.php.net/pdo-sqlite) or [PDO_PGSQL](https://www.php.net/pdo-pgsql) * Recommended extensions: [GMP](https://www.php.net/gmp) (for API access on 32-bit platforms), [IDN](https://www.php.net/intl.idn) (for Internationalized Domain Names), [mbstring](https://www.php.net/mbstring) (for Unicode strings), [iconv](https://www.php.net/iconv) (for charset conversion), [ZIP](https://www.php.net/zip) (for import/export), [zlib](https://www.php.net/zlib) (for compressed feeds) -* MySQL 5.5.3+ (recommended) or MariaDB equivalent, or SQLite 3.7.4+, or PostgreSQL 9.2+ +* MySQL 5.5.3+ or MariaDB equivalent, or SQLite 3.7.4+, or PostgreSQL 9.5+ # Releases diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php index dfacc38e7..b37ff9f90 100644 --- a/app/SQL/install.sql.pgsql.php +++ b/app/SQL/install.sql.pgsql.php @@ -28,9 +28,9 @@ CREATE TABLE IF NOT EXISTS `_feed` ( "cache_nbUnreads" INT DEFAULT 0, FOREIGN KEY ("category") REFERENCES `_category` ("id") ON DELETE SET NULL ON UPDATE CASCADE ); -CREATE INDEX `_name_index` ON `_feed` ("name"); -CREATE INDEX `_priority_index` ON `_feed` ("priority"); -CREATE INDEX `_keep_history_index` ON `_feed` ("keep_history"); +CREATE INDEX IF NOT EXISTS `_name_index` ON `_feed` ("name"); +CREATE INDEX IF NOT EXISTS `_priority_index` ON `_feed` ("priority"); +CREATE INDEX IF NOT EXISTS `_keep_history_index` ON `_feed` ("keep_history"); CREATE TABLE IF NOT EXISTS `_entry` ( "id" BIGINT NOT NULL PRIMARY KEY, @@ -49,9 +49,9 @@ CREATE TABLE IF NOT EXISTS `_entry` ( FOREIGN KEY ("id_feed") REFERENCES `_feed` ("id") ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE ("id_feed","guid") ); -CREATE INDEX `_is_favorite_index` ON `_entry` ("is_favorite"); -CREATE INDEX `_is_read_index` ON `_entry` ("is_read"); -CREATE INDEX `_entry_lastSeen_index` ON `_entry` ("lastSeen"); +CREATE INDEX IF NOT EXISTS `_is_favorite_index` ON `_entry` ("is_favorite"); +CREATE INDEX IF NOT EXISTS `_is_read_index` ON `_entry` ("is_read"); +CREATE INDEX IF NOT EXISTS `_entry_lastSeen_index` ON `_entry` ("lastSeen"); INSERT INTO `_category` (id, name) SELECT 1, 'Uncategorized' @@ -77,10 +77,10 @@ CREATE TABLE IF NOT EXISTS `_entrytmp` ( -- v1.7 FOREIGN KEY ("id_feed") REFERENCES `_feed` ("id") ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE ("id_feed","guid") ); -CREATE INDEX `_entrytmp_date_index` ON `_entrytmp` ("date"); +CREATE INDEX IF NOT EXISTS `_entrytmp_date_index` ON `_entrytmp` ("date"); -- v1.7 -CREATE INDEX `_entry_feed_read_index` ON `_entry` ("id_feed","is_read"); +CREATE INDEX IF NOT EXISTS `_entry_feed_read_index` ON `_entry` ("id_feed","is_read"); SQL; const SQL_CREATE_TABLE_TAGS = <<<'SQL' @@ -96,7 +96,7 @@ CREATE TABLE IF NOT EXISTS `_entrytag` ( FOREIGN KEY ("id_tag") REFERENCES `_tag` ("id") ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY ("id_entry") REFERENCES `_entry` ("id") ON DELETE CASCADE ON UPDATE CASCADE ); -CREATE INDEX `_entrytag_id_entry_index` ON `_entrytag` ("id_entry"); +CREATE INDEX IF NOT EXISTS `_entrytag_id_entry_index` ON `_entrytag` ("id_entry"); SQL; const SQL_INSERT_FEED = <<<'SQL' diff --git a/docs/en/admins/02_Installation.md b/docs/en/admins/02_Installation.md index 7bba647ec..1156c4f3a 100644 --- a/docs/en/admins/02_Installation.md +++ b/docs/en/admins/02_Installation.md @@ -9,7 +9,7 @@ You need to verify that your server can run FreshRSS before installing it. If yo | Web server | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.6+ | | PHP modules | Required: libxml, cURL, JSON, PDO_MySQL, PCRE and ctype.
    Required (32-bit only): GMP
    Recommanded: Zlib, mbstring, iconv, ZipArchive
    *For the whole modules list see [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | -| Database | **MySQL 5.5.3+** | SQLite 3.7.4+ | +| Database | **MySQL 5.5.3+** | SQLite 3.7.4+, PostgreSQL 9.5+ | | Browser | **Firefox** | Chrome, Opera, Safari, or IE11+ | diff --git a/docs/fr/users/01_Installation.md b/docs/fr/users/01_Installation.md index 288d84c4d..9c5022f17 100644 --- a/docs/fr/users/01_Installation.md +++ b/docs/fr/users/01_Installation.md @@ -9,7 +9,7 @@ Il est toutefois de votre responsabilité de vérifier que votre hébergement pe | Serveur web | **Apache 2** | Nginx | | PHP | **PHP 7+** | PHP 5.6+ | | Modules PHP | Requis : libxml, cURL, JSON, PDO_MySQL, PCRE et ctype
    Requis (32 bits seulement) : GMP
    Recommandé : Zlib, mbstring et iconv, ZipArchive
    *Pour une liste complète des modules nécessaires voir le [Dockerfile](https://github.com/FreshRSS/FreshRSS/blob/master/Docker/Dockerfile-Alpine#L7-L9)* | | - | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+ | + | Base de données | **MySQL 5.5.3+** | SQLite 3.7.4+, PostgreSQL 9.5+ | | Navigateur | **Firefox** | Chrome, Opera, Safari, or IE 11+ | # Choisir la bonne version de FreshRSS -- cgit v1.2.3