From cdf174164280de7e1b4ced5b6f1798c3d20797aa Mon Sep 17 00:00:00 2001 From: Kendrick Date: Tue, 6 Oct 2015 12:42:21 +0200 Subject: [PATCH 1/4] symlink issues with php-fpm # symlink fastcgi_param DOCUMENT_ROOT $realpath_root; permits to have the real path with the current symlink while deploying with Capifony (evoiding restarting php-fpm) --- cookbook/configuration/web_server_configuration.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cookbook/configuration/web_server_configuration.rst b/cookbook/configuration/web_server_configuration.rst index f483a291b68..7faa1b6de9a 100644 --- a/cookbook/configuration/web_server_configuration.rst +++ b/cookbook/configuration/web_server_configuration.rst @@ -269,6 +269,8 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # symlink + fastcgi_param DOCUMENT_ROOT $realpath_root; } # PROD location ~ ^/app\.php(/|$) { @@ -276,6 +278,8 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + # symlink + fastcgi_param DOCUMENT_ROOT $realpath_root; # Prevents URIs that include the front controller. This will 404: # http://domain.tld/app.php/some-path # Remove the internal directive to allow URIs like this From 93a17c86a0968489e469d3061cfb6382e07489ca Mon Sep 17 00:00:00 2001 From: Kendrick Date: Tue, 6 Oct 2015 14:45:57 +0200 Subject: [PATCH 2/4] comment # symlink issue with PHP-FPM and OPcache. Symlink may not be refreshed, so it's necessary to use a real path (eg. after a deployment with Capifony which uses the current symlink to point towards a release directory, you may notice that PHP-FPM displays old pages or freezes) : --- cookbook/configuration/web_server_configuration.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/configuration/web_server_configuration.rst b/cookbook/configuration/web_server_configuration.rst index 7faa1b6de9a..7f2ab221630 100644 --- a/cookbook/configuration/web_server_configuration.rst +++ b/cookbook/configuration/web_server_configuration.rst @@ -269,7 +269,7 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - # symlink + # symlink issue with PHP-FPM and OPcache. Symlink may not be refreshed, so it's necessary to use a real path (eg. after a deployment with Capifony which uses the current symlink to point towards a release directory, you may notice that PHP-FPM displays old pages or freezes) : fastcgi_param DOCUMENT_ROOT $realpath_root; } # PROD @@ -278,7 +278,7 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - # symlink + # symlink issue with PHP-FPM and OPcache. Symlink may not be refreshed, so it's necessary to use a real path (eg. after a deployment with Capifony which uses the current symlink to point towards a release directory, you may notice that PHP-FPM displays old pages or freezes) : fastcgi_param DOCUMENT_ROOT $realpath_root; # Prevents URIs that include the front controller. This will 404: # http://domain.tld/app.php/some-path From 1b2e2e6c0a667baccee2039c40b0b4749cb5334c Mon Sep 17 00:00:00 2001 From: Kendrick Date: Thu, 8 Oct 2015 17:11:36 +0200 Subject: [PATCH 3/4] update --- .../web_server_configuration.rst | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cookbook/configuration/web_server_configuration.rst b/cookbook/configuration/web_server_configuration.rst index 7f2ab221630..71a1c8172b7 100644 --- a/cookbook/configuration/web_server_configuration.rst +++ b/cookbook/configuration/web_server_configuration.rst @@ -268,8 +268,14 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - # symlink issue with PHP-FPM and OPcache. Symlink may not be refreshed, so it's necessary to use a real path (eg. after a deployment with Capifony which uses the current symlink to point towards a release directory, you may notice that PHP-FPM displays old pages or freezes) : + # When you are using symlinks to link the document root to the + # current version of your application, you should pass the real + # application path instead of the path to the symlink to PHP + # FPM. + # Otherwise, PHP's OPcache may not properly detect changes to + # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 + # for more information). + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; } # PROD @@ -277,8 +283,14 @@ The **minimum configuration** to get your application running under Nginx is: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - # symlink issue with PHP-FPM and OPcache. Symlink may not be refreshed, so it's necessary to use a real path (eg. after a deployment with Capifony which uses the current symlink to point towards a release directory, you may notice that PHP-FPM displays old pages or freezes) : + # When you are using symlinks to link the document root to the + # current version of your application, you should pass the real + # application path instead of the path to the symlink to PHP + # FPM. + # Otherwise, PHP's OPcache may not properly detect changes to + # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 + # for more information). + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; # Prevents URIs that include the front controller. This will 404: # http://domain.tld/app.php/some-path From 7ef7ba77ac794ceed838b11b9d12bb91f6b8b78b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 15 Oct 2015 12:39:04 +0200 Subject: [PATCH 4/4] fix build --- cookbook/event_dispatcher/event_listener.rst | 12 ++++++------ reference/constraints/IsFalse.rst | 2 +- reference/constraints/IsNull.rst | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cookbook/event_dispatcher/event_listener.rst b/cookbook/event_dispatcher/event_listener.rst index dcf2798b1a0..a6e4c50a2cf 100644 --- a/cookbook/event_dispatcher/event_listener.rst +++ b/cookbook/event_dispatcher/event_listener.rst @@ -255,6 +255,12 @@ Listeners and subscribers can be used in the same application indistinctly. The decision to use either of them is usually a matter of personal taste. However, there are some minor advantages for each of them: +* **Subscribers are easier to reuse** because the knowledge of the events is kept + in the class rather than in the service definition. This is the reason why + Symfony uses subscribers internally; +* **Listeners are more flexible** because bundles can enable or disable each of + them conditionally depending on some configuration value. + Debugging Event Listeners ------------------------- @@ -274,9 +280,3 @@ its name: .. code-block:: bash $ php app/console debug:event-dispatcher kernel.exception -======= -* **Subscribers are easier to reuse** because the knowledge of the events is kept - in the class rather than in the service definition. This is the reason why - Symfony uses subscribers internally; -* **Listeners are more flexible** because bundles can enable or disable each of - them conditionally depending on some configuration value. diff --git a/reference/constraints/IsFalse.rst b/reference/constraints/IsFalse.rst index 3e5989a5bd7..a4171bcf598 100644 --- a/reference/constraints/IsFalse.rst +++ b/reference/constraints/IsFalse.rst @@ -11,7 +11,7 @@ Also see :doc:`IsTrue `. | Applies to | :ref:`property or method ` | +----------------+-----------------------------------------------------------------------+ | Options | - `message`_ | -| | - `payload`_ | +| | - `payload`_ | +----------------+-----------------------------------------------------------------------+ | Class | :class:`Symfony\\Component\\Validator\\Constraints\\IsFalse` | +----------------+-----------------------------------------------------------------------+ diff --git a/reference/constraints/IsNull.rst b/reference/constraints/IsNull.rst index eab1859f725..7c281fd1592 100644 --- a/reference/constraints/IsNull.rst +++ b/reference/constraints/IsNull.rst @@ -11,7 +11,7 @@ Also see :doc:`NotNull `. | Applies to | :ref:`property or method ` | +----------------+-----------------------------------------------------------------------+ | Options | - `message`_ | -| | - `payload`_ | +| | - `payload`_ | +----------------+-----------------------------------------------------------------------+ | Class | :class:`Symfony\\Component\\Validator\\Constraints\\IsNull` | +----------------+-----------------------------------------------------------------------+