Skip to content

Commit

Permalink
Merge branch '3.0' into 3.next
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Apr 16, 2017
2 parents 4fe0ed4 + edaedda commit ed46778
Show file tree
Hide file tree
Showing 14 changed files with 882 additions and 95 deletions.
2 changes: 1 addition & 1 deletion en/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ set.
If you generate reports or send emails that make use of ``Router::url()`` those
will contain the default host ``http://localhost/`` and thus resulting in
invalid URLs. In this case you need to specify the domain manually.
You can do that using the Configure value ``App.fullBaseURL`` from your
You can do that using the Configure value ``App.fullBaseUrl`` from your
bootstrap or config, for example.

For sending emails, you should provide Email class with the host you want to
Expand Down
10 changes: 5 additions & 5 deletions en/development/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1583,11 +1583,11 @@ Tests for plugins are created in their own directory inside the plugins
folder. ::

/src
/plugins
/Blog
/tests
/TestCase
/Fixture
/plugins
/Blog
/tests
/TestCase
/Fixture

They work just like normal tests but you have to remember to use the naming
conventions for plugins when importing classes. This is an example of a testcase
Expand Down
65 changes: 24 additions & 41 deletions en/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,22 +448,32 @@ nginx does not make use of .htaccess files like Apache, so it is necessary to
create those rewritten URLs in the site-available configuration. This is usually
found in ``/etc/nginx/sites-available/your_virtual_host_conf_file``. Depending
on your setup, you will have to modify this, but at the very least, you will
need PHP running as a FastCGI instance:
need PHP running as a FastCGI instance.
The following configuration redirects the request to ``webroot/index.php``:

.. code-block:: nginx
location / {
try_files $uri $uri/ /index.php?$args;
}
A sample of the server directive is as follows:

.. code-block:: nginx
server {
listen 80;
listen [::]:80;
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
return 301 http://example.com$request_uri;
}
server {
listen 80;
listen [::]:80;
server_name example.com;
# root directive should be global
root /var/www/example.com/public/webroot/;
root /var/www/example.com/public/webroot;
index index.php;
access_log /var/www/example.com/log/access.log;
Expand All @@ -475,47 +485,20 @@ need PHP running as a FastCGI instance:
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
On some servers (Like Ubuntu 14.04) the above configuration won't work out of
the box, and the nginx docs recommend a different approach anyway
(http://nginx.org/en/docs/http/converting_rewrite_rules.html). You might try the
following (you'll notice this is also just one server {} block, rather than two,
although if you want example.com to resolve to your CakePHP application in
addition to www.example.com consult the nginx link above):

.. code-block:: nginx
server {
listen 80;
server_name www.example.com;
rewrite 301 http://www.example.com$request_uri permanent;
# root directive should be global
root /var/www/example.com/public/webroot/;
index index.php;
access_log /var/www/example.com/log/access.log;
error_log /var/www/example.com/log/error.log;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
.. note::
Recent configurations of PHP-FPM are set to listen to the unix php-fpm
socket instead of TCP port 9000 on address 127.0.0.1. If you get 502 bad
gateway errors from the above configuration, try update ``fastcgi_pass`` to
use the unix socket path (eg: fastcgi_pass
unix:/var/run/php/php7.1-fpm.sock;) instead of the TCP port.

IIS7 (Windows hosts)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion fr/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ Si vous générez des rapports ou envoyez des emails qui utilisent
``Router::url()``, ceux-ci vont contenir l'hôte par défaut
``http://localhost/`` et cela va entrainer des URLs invalides. Dans ce cas,
vous devrez spécifier le domaine manuellement. Vous pouvez faire cela en
utilisant la valeur de Configure ``App.fullBaseURL`` de votre bootstrap ou
utilisant la valeur de Configure ``App.fullBaseUrl`` de votre bootstrap ou
config, par exemple.

Pour envoyer des emails, vous devrez fournir à la classe Email l'hôte avec
Expand Down
12 changes: 6 additions & 6 deletions fr/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ Envoyer des fichiers
.. php:method:: withFile($path, $options = [])
Il y a des fois où vous voulez envoyer des fichiers en réponses de vos requêtes.
Vous pouvez faire cela en utilisant
Vous pouvez le faire en utilisant
:php:meth:`Cake\\Http\\Response::withFile()`::

public function sendFile($id)
Expand Down Expand Up @@ -653,7 +653,7 @@ des réponses. En utilisant :php:meth:`Cake\\Http\\Response::withCache()`::
$this->response = $this->response->withCache('-1 minute', '+5 days');
}

Ce qui est au-dessus dira aux clients de mettre en cache la réponse résultante
Ce qui est au-dessus indiquera aux clients de mettre en cache la réponse résultante
pendant 5 jours, en espérant accélérer l'expérience de vos visiteurs.
La méthode ``withCache()`` définit valeur ``Last-Modified`` en
premier argument. L'entête ``Expires`` et ``max-age`` sont définis en se basant
Expand All @@ -664,9 +664,9 @@ sur le second paramètre. Le Cache-Control est défini aussi à ``public``.
Réglage fin du Cache HTTP
-------------------------

Une des façons les meilleures et les plus simples de rendre votre application
L'une des plus meilleures et plus simples méthodes pour rendre votre application
plus rapide est d'utiliser le cache HTTP. Selon ce modèle de mise en cache,
vous êtes tenu seulement d'aider les clients à décider s'ils doivent utiliser
vous êtes seulement tenu d'aider les clients à décider s'ils doivent utiliser
une copie de la réponse mise en cache en définissant quelques propriétés
d'en-têtes comme la date de mise à jour et la balise entity de réponse.

Expand All @@ -676,7 +676,7 @@ modèles, l'expiration et la validation qui habituellement sont beaucoup plus
simples que d'avoir à gérer le cache soi-même.

En dehors de l'utilisation de :php:meth:`Cake\\Http\\Response::withCache()`, vous
pouvez aussi utiliser plusieurs autres méthodes pour affiner le réglage des
pouvez également utiliser d'autres méthodes pour affiner le réglage des
en-têtes de cache HTTP pour tirer profit du navigateur ou à l'inverse du cache
du proxy.

Expand Down Expand Up @@ -867,7 +867,7 @@ Erreurs Communes avec les Responses Immutables

Depuis CakePHP 3.4.0, les objets responses offrent de nombreuses méthodes qui
traitent les responses comme des objets immutables. Les objets immutables
permettent de prévenir les effets de bord difficile à repérer.
permettent de prévenir les effets de bord difficiles à repérer.
Malgré leurs nombreux avantages, s'habituer aux objets immutables peut prendre
un peu de temps. Toutes les méthodes qui commencent par ``with`` intéragiront
avec la réponse à la manière immutable et retourneront **toujours** une
Expand Down
10 changes: 5 additions & 5 deletions fr/development/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1650,11 +1650,11 @@ Les Tests pour les plugins sont créés dans leur propre répertoire à
l'intérieur du dossier des plugins::

/src
/plugins
/Blog
/tests
/TestCase
/Fixture
/plugins
/Blog
/tests
/TestCase
/Fixture

Ils fonctionnent comme des tests normaux mais vous devrez vous souvenir
d'utiliser les conventions de nommage pour les plugins quand vous importez des
Expand Down
2 changes: 1 addition & 1 deletion ja/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ XML で返します。XML ドキュメントの例としては以下のように
``Router::url()`` を使ってレポートを作成したり電子メールを送ったりする場合、
それらにはデフォルトホスト ``http://localhost/`` が構成に含まれており、 そのため結果として無効な
URL となってしまいます。こういったケースでは、ドメインを手作業で設定する必要があります。
これを、たとえばブートストラップまたは config で、コンフィグ値 ``App.fullBaseURL`` を使って
これを、たとえばブートストラップまたは config で、コンフィグ値 ``App.fullBaseUrl`` を使って
設定できます。

電子メールを送る場合は、Email クラスでメールを送る際のホストを指定する必要があります。 ::
Expand Down
10 changes: 5 additions & 5 deletions ja/development/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1541,11 +1541,11 @@ Orders を例に詳しく説明します。以下のテーブルを持ってい
プラグインのテストは、プラグインフォルダ内のディレクトリに作成されます。 ::

/src
/plugins
/Blog
/tests
/TestCase
/Fixture
/plugins
/Blog
/tests
/TestCase
/Fixture

それらは通常のテストと同じように動作しますが、別のクラスをインポートする場合、プラグインの命名規則を
使用することを覚えておく必要があります。これは、このマニュアルのプラグインの章から ``BlogPost``
Expand Down
2 changes: 1 addition & 1 deletion pt/console-and-shells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ estão definidas.
Se você gerar relatórios ou enviar e-mails que fazem uso de ``Router::url()``,
estes conterão a máquina padrão ``http://localhost/`` e resultando assim em
URLs inválidas. Neste caso, você precisa especificar o domínio manualmente.
Você pode fazer isso usando o valor de configuração ``App.fullBaseURL`` no seu
Você pode fazer isso usando o valor de configuração ``App.fullBaseUrl`` no seu
bootstrap ou na sua configuração, por exemplo.

Para enviar e-mails, você deve fornecer a classe CakeEmail com o host que você
Expand Down
9 changes: 7 additions & 2 deletions pt/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ Objetos de requisição e resposta
.. index:: $this->request
.. _cake-request:

Request
=======
Requisição
==========

.. _cake-response-file:

Enviando Arquivos
-----------------
Loading

0 comments on commit ed46778

Please sign in to comment.