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/en/developers/01_First_steps.md | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'docs/en/developers/01_First_steps.md') diff --git a/docs/en/developers/01_First_steps.md b/docs/en/developers/01_First_steps.md index adca4495b..fef27cb39 100644 --- a/docs/en/developers/01_First_steps.md +++ b/docs/en/developers/01_First_steps.md @@ -148,26 +148,9 @@ abstract class ClassName {} Files must be encoded with UTF-8 character set. -## PHP 5.3 compatibility +## PHP compatibility -Do not get an array item directly from a function or a method. Use a variable. - -```php -// code with PHP 5.3 compatibility -$my_variable = function_returning_an_array(); -echo $my_variable[0]; -// code without PHP 5.3 compatibility -echo function_returning_an_array()[0]; -``` - -Do not use short array declaration. - -```php -// code with PHP 5.3 compatibility -$variable = array(); -// code without PHP 5.3 compatibility -$variable = []; -``` +Ensure that your code is working with a PHP version as old as what FreshRSS officially supports. ## Miscellaneous -- cgit v1.2.3 From ad44ff81694ff4cbcccc514a17351476a38aadd8 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 29 Aug 2019 11:59:32 +0200 Subject: tec: Add Makefile and Docker conf for development (#2492) Co-Authored-By: Frans de Jonge Co-Authored-By: Alexandre Alapetite --- Makefile | 38 ++++++++++++++++++++++++ docs/en/developers/01_First_steps.md | 57 ++++++++++++++++++++++++++++++++++-- 2 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 Makefile (limited to 'docs/en/developers/01_First_steps.md') diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..7239775f6 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +.DEFAULT_GOAL := help + +ifndef TAG + TAG=dev-alpine +endif + +ifeq ($(findstring alpine,$(TAG)),alpine) + DOCKERFILE=Dockerfile-Alpine +else ifeq ($(findstring arm,$(TAG)),arm) + DOCKERFILE=Dockerfile-QEMU-ARM +else + DOCKERFILE=Dockerfile +endif + +.PHONY: build +build: ## Build a Docker image + docker build \ + --pull \ + --tag freshrss/freshrss:$(TAG) \ + -f Docker/$(DOCKERFILE) . + +.PHONY: start +start: ## Start the development environment (use Docker) + docker run \ + --rm \ + -v $(shell pwd):/var/www/FreshRSS:z \ + -p 8080:80 \ + -e FRESHRSS_ENV=development \ + --name freshrss-dev \ + freshrss/freshrss:$(TAG) + +.PHONY: stop +stop: ## Stop FreshRSS container if any + docker stop freshrss-dev + +.PHONY: help +help: + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/docs/en/developers/01_First_steps.md b/docs/en/developers/01_First_steps.md index fef27cb39..6b7f437a7 100644 --- a/docs/en/developers/01_First_steps.md +++ b/docs/en/developers/01_First_steps.md @@ -1,6 +1,59 @@ -# Environment configuration +# Environment configuration (Docker) -**TODO** +FreshRSS is built with PHP and uses a homemade framework, Minz. The dependencies are directly included in the source code, so you don't need Composer. + +There are various ways to configure your development environment. The easiest and most supported method is based on Docker, which is the solution documented below. If you already have a working PHP environment, you probably don't need it. + +We assume here that you use a GNU/Linux distribution, capable of running Docker. Otherwise, you'll have to adapt the commands accordingly. + +The commands that follow have to be executed in a console. They start by `$` when commands need to be executed as normal user, and by `#` when they need to be executed as root user. You don't have to type these characters. A path may be indicated before these characters to help you identify where they need to be executed. For instance, `app$ echo 'Hello World'` indicates that you have to execute `echo` command in the `app/` directory. + +First, you need to install [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/). + +Once you're done, clone the repository with: + +```console +$ git clone https://github.com/FreshRSS/FreshRSS.git +$ cd FreshRSS +``` + +Note that, if you want to contribute, you have to fork the repository first and clone your fork instead of the "root" one. Adapt the commands in consequence. + +Then, the only command you need to know is the following: + +```console +$ make start +``` + +This might take some time while Docker downloads the image. If your user isn't in the `docker` group, you'll need to prepend the command with `sudo`. + +**You can now access FreshRSS at [http://localhost:8080](http://localhost:8080).** Just follow the install process and select the SQLite database. + +You can stop the containers by typing Control + c or with the following command, in another terminal: + +```console +$ make stop +``` + +If you're interested in the configuration, the `make` commands are defined in the [`Makefile`](/Makefile). + +If you need to use a different tag image (default is `dev-alpine`), you can set the `TAG` environment variable: + +```console +$ TAG=dev-arm make start +``` + +You can find the full list of available tags [on the Docker hub](https://hub.docker.com/r/freshrss/freshrss/tags). + +You might want to rebuild the Docker image locally. You can do it with: + +```console +$ make build +$ # or +$ TAG=dev-arm make build +``` + +The `TAG` variable can be anything (e.g. `dev-local`). You can target a specific architecture by adding `-alpine` or `-arm` at the end of the tag (e.g. `dev-local-arm`). # Project architecture -- 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/en/developers/01_First_steps.md') 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