Skip to content

Commit 1c00f15

Browse files
committed
Merge pull request #152 from hpatoio/issue_144
Mentioning NGINX and added info about groups for tests | Related to #144
2 parents 8b99517 + 4a2ca91 commit 1c00f15

10 files changed

+41
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Features
2323
* Send [cache invalidation requests](http://foshttpcache.readthedocs.org/en/latest/cache-invalidator.html)
2424
with minimal impact on performance.
2525
* Use the built-in support for [Varnish](http://foshttpcache.readthedocs.org/en/latest/varnish-configuration.html)
26-
3 and 4, [Nginx](http://foshttpcache.readthedocs.org/en/latest/nginx-configuration.html), the
26+
3 and 4, [NGINX](http://foshttpcache.readthedocs.org/en/latest/nginx-configuration.html), the
2727
[Symfony reverse proxy from the http-kernel component](http://foshttpcache.readthedocs.org/en/latest/symfony-cache-configuration.html)
2828
or easily implement your own caching proxy client.
2929
* [Test your application](http://foshttpcache.readthedocs.org/en/latest/testing-your-application.html)
30-
against your Varnish or Nginx setup.
30+
against your Varnish or NGINX setup.
3131
* This library is fully compatible with [HHVM](http://www.hhvm.com).
3232

3333
Documentation

doc/contributing.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ To run the unit tests separately:
2727
Functional Tests
2828
~~~~~~~~~~~~~~~~
2929

30-
The library also includes functional tests against a Varnish instance. The
31-
functional test suite by default uses PHP’s built-in web server. If you have
30+
The library also includes functional tests against a Varnish and NGINX instance.
31+
The functional test suite by default uses PHP’s built-in web server. If you have
3232
PHP 5.4 or newer, simply run with the default configuration.
3333

3434
If you want to run the tests on PHP 5.3, you need to configure a web server
@@ -44,6 +44,15 @@ To run the functional tests:
4444
4545
$ phpunit tests/Functional
4646
47+
Tests are organized in groups: one for each reverse proxy supported. At the moment
48+
groups are: `varnish` and `nginx`.
49+
50+
To run only the `varnish` functional tests:
51+
52+
.. code-block:: bash
53+
54+
$ phpunit --group=varnish
55+
4756
For more information about testing, see :doc:`/testing-your-application`.
4857

4958
Building the Documentation

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FOSHttpCache
44
This is the documentation for the `FOSHttpCache library <https://github.com/FriendsOfSymfony/FOSHttpCache>`_.
55

66
This library integrates your PHP applications with HTTP caching proxies such as
7-
Varnish, Nginx or the Symfony HttpCache class. Use this library to send
7+
Varnish, NGINX or the Symfony HttpCache class. Use this library to send
88
invalidation requests from your application to the caching proxy and to test
99
your caching and invalidation setup.
1010

doc/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Overview
3131

3232
This library mainly consists of:
3333

34-
* low-level clients for communicating with caching proxies (Varnish and Nginx)
34+
* low-level clients for communicating with caching proxies (Varnish and NGINX)
3535
* a cache invalidator that acts as an abstraction layer for the caching proxy
3636
clients
3737
* test classes that you can use for integration testing your application

doc/invalidation-introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HTTP Caching Terminology
2222

2323
Caching proxy
2424
Also `reverse caching proxy <http://en.wikipedia.org/wiki/Reverse_proxy>`_.
25-
Examples: Varnish, Nginx.
25+
Examples: Varnish, NGINX.
2626

2727
Time to live (TTL)
2828
Maximum lifetime of some content. Expressed in either an expiry date

doc/nginx-configuration.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
.. _nginx configuration:
22

3-
Nginx Configuration
3+
NGINX Configuration
44
-------------------
55

6-
Below you will find detailed Nginx configuration recommendations for the
7-
features provided by this library. The examples are tested with Nginx version
6+
Below you will find detailed NGINX configuration recommendations for the
7+
features provided by this library. The examples are tested with NGINX version
88
1.4.6.
99

10-
Nginx cache is a set of key/value pairs. The key is built with elements taken from the requests
10+
NGINX cache is a set of key/value pairs. The key is built with elements taken from the requests
1111
(URI, cookies, http headers etc) as specified by `proxy_cache_key` directive.
1212

13-
When we interact with the cache to purge/refresh entries we must send to Nginx a request which has
13+
When we interact with the cache to purge/refresh entries we must send to NGINX a request which has
1414
the very same values, for the elements used for building the key, as the request that create the entry.
15-
In this way Nginx can build the correct key and apply the required operation to the entry.
15+
In this way NGINX can build the correct key and apply the required operation to the entry.
1616

17-
By default Nginx key is built with `$scheme$proxy_host$request_uri`. For a full list of the elements
17+
By default NGINX key is built with `$scheme$proxy_host$request_uri`. For a full list of the elements
1818
you can use in the key see `this page from the official documentation <http://nginx.org/en/docs/http/ngx_http_core_module.html#variables>`_
1919

2020
Purge
2121
~~~~~
2222

23-
Nginx does not support :term:`purge` functionality out of the box but you can easily add it with
23+
NGINX does not support :term:`purge` functionality out of the box but you can easily add it with
2424
`ngx_cache_purge <https://github.com/FRiCKLE/ngx_cache_purge>`_ module. You just need to compile
25-
Nginx from sources adding `ngx_cache_purge` with `--add-module`
25+
NGINX from sources adding `ngx_cache_purge` with `--add-module`
2626

2727
You can check the script :source:`install-nginx.sh <tests/install-nginx.sh>` to get an idea
2828
about the steps you need to perform.
2929

30-
Then configure Nginx for purge requests:
30+
Then configure NGINX for purge requests:
3131

3232
.. literalinclude:: ../tests/Functional/Fixtures/nginx/fos.conf
3333
:language: nginx
3434
:linenos:
3535
:emphasize-lines: 41, 47-53
3636

3737
Please refer to the `ngx_cache_purge module documentation <https://github.com/FRiCKLE/ngx_cache_purge>`_
38-
for more on configuring Nginx to support purge requests.
38+
for more on configuring NGINX to support purge requests.
3939

4040
Refresh
4141
~~~~~~~

doc/proxy-clients.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Caching Proxy Clients
22
=====================
33

4-
This library ships with clients for the Varnish and Nginx caching proxy. You
4+
This library ships with clients for the Varnish and NGINX caching proxy. You
55
can use the clients either wrapped by the :doc:`cache invalidator <cache-invalidator>`
66
(recommended), or directly for low-level access to invalidation functionality.
77

@@ -37,12 +37,12 @@ include that port in the base URL::
3737

3838
To use the client, you need to :doc:`configure Varnish <varnish-configuration>` accordingly.
3939

40-
Nginx Client
40+
NGINX Client
4141
~~~~~~~~~~~~
4242

43-
At minimum, supply an array containing IPs or hostnames of the Nginx servers
43+
At minimum, supply an array containing IPs or hostnames of the NGINX servers
4444
that you want to send invalidation requests to. Make sure to include the port
45-
Nginx runs on if it is not port 80::
45+
NGINX runs on if it is not port 80::
4646

4747
use FOS\HttpCache\Invalidation\Nginx;
4848

@@ -55,14 +55,14 @@ is available as the second parameter::
5555

5656
$nginx = new Nginx($servers, 'my-cool-app.com');
5757

58-
If you have configured Nginx to support purge requests at a separate location,
58+
If you have configured NGINX to support purge requests at a separate location,
5959
supply that location to the class as the third parameter::
6060

6161
$nginx = new Nginx($servers, 'my-cool-app.com', '/purge');
6262

6363
.. note::
6464

65-
To use the client, you need to :doc:`configure Nginx <nginx-configuration>` accordingly.
65+
To use the client, you need to :doc:`configure NGINX <nginx-configuration>` accordingly.
6666

6767
Using the Clients
6868
-----------------
@@ -86,7 +86,7 @@ Supported invalidation methods
8686
Client Purge Refresh Ban
8787
============= ======= ======= =======
8888
Varnish ✓ ✓ ✓
89-
Nginx ✓ ✓
89+
NGINX ✓ ✓
9090
Symfony Cache ✓ ✓
9191
============= ======= ======= =======
9292

doc/symfony-cache-configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Symfony HttpCache Configuration
33

44
The ``symfony/http-kernel`` component provides a reverse proxy implemented
55
completely in PHP, called `HttpCache`_. While it is certainly less efficient
6-
than using Varnish or Nginx, it can still provide considerable performance
6+
than using Varnish or NGINX, it can still provide considerable performance
77
gains over an installation that is not cached at all. It can be useful for
88
running an application on shared hosting for instance.
99

src/Test/NginxTestCase.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ abstract class NginxTestCase extends ProxyTestCase
4949
*
5050
* @throws \Exception
5151
*
52-
* @return string the path to the nginx server configuration file to use with this test.
52+
* @return string the path to the NGINX server configuration file to use with this test.
5353
*/
5454
protected function getConfigFile()
5555
{
5656
if (!defined('NGINX_FILE')) {
57-
throw new \Exception('Specify the nginx configuration file path in phpunit.xml or override getConfigFile()');
57+
throw new \Exception('Specify the NGINX'
58+
. ' configuration file path in phpunit.xml or override getConfigFile()');
5859
}
5960

60-
// Nginx needs an absolute path
61+
// NGINX needs an absolute path
6162
return realpath(NGINX_FILE);
6263
}
6364

@@ -82,7 +83,7 @@ protected function getCachingProxyPort()
8283
}
8384

8485
/**
85-
* Get Nginx cache directory
86+
* Get NGINX cache directory
8687
*/
8788
protected function getCacheDir()
8889
{

src/Test/Proxy/NginxProxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NginxProxy extends Abstractproxy
2222
/**
2323
* Constructor
2424
*
25-
* @param string $configFile Path to Nginx configuration file
25+
* @param string $configFile Path to NGINX configuration file
2626
*/
2727
public function __construct($configFile)
2828
{

0 commit comments

Comments
 (0)