Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commitb6f539d

Browse files
committed
Merging develop to master in preparation for 1.3.0
2 parentsd36c9ef +5971adb commitb6f539d

13 files changed

+2724
-108
lines changed

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.buildpath
2-
composer.lock
32
.project
43
.settings/
54
vendor/

‎.travis.yml‎

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,58 @@ cache:
77
-$HOME/.composer/cache
88
-vendor
99

10+
env:
11+
global:
12+
-COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
13+
1014
matrix:
1115
fast_finish:true
1216
include:
13-
-php:5.5
17+
-php:5.6
18+
env:
19+
-DEPS=lowest
20+
-php:5.6
1421
env:
15-
-EXECUTE_CS_CHECK=true
22+
-DEPS=locked
1623
-php:5.6
1724
env:
18-
-EXECUTE_COVERAGE=true
25+
-DEPS=latest
26+
-php:7
27+
env:
28+
-DEPS=lowest
29+
-php:7
30+
env:
31+
-DEPS=locked
32+
-CS_CHECK=true
1933
-php:7
34+
env:
35+
-DEPS=latest
36+
-php:hhvm
37+
env:
38+
-DEPS=lowest
2039
-php:hhvm
40+
env:
41+
-DEPS=locked
42+
-php:hhvm
43+
env:
44+
-DEPS=latest
2145
allow_failures:
22-
-php:7
2346
-php:hhvm
2447

2548
notifications:
2649
irc:"irc.freenode.org#apigility-dev"
2750
email:false
2851

2952
before_install:
30-
-if [[ $EXECUTE_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
31-
-composer self-update
53+
-if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
54+
-travis_retrycomposer self-update
3255

3356
install:
34-
-travis_retry composer install --no-interaction --ignore-platform-reqs --prefer-source
35-
-composer info -i
57+
-if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
58+
-if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
59+
-travis_retry composer install $COMPOSER_ARGS
60+
-composer show
3661

3762
script:
38-
-./vendor/bin/phpunit
39-
-if [[ $EXECUTE_CS_CHECK == 'true' ]]; then./vendor/bin/phpcs ; fi
63+
-composer test
64+
-if [[ $CS_CHECK == 'true' ]]; thencomposer cs-check ; fi

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
##1.3.0 - TBD
6+
7+
###Added
8+
9+
-[#11](https://github.com/zfcampus/zf-http-cache/pull/11) adds ETag support.
10+
A default generator that uses MD5 hashing of content for comparisons; if
11+
content matches, an empty 304 response is returned with a`Not-Modified`
12+
header. By default, it will not overwrite any ETag headers you already send,
13+
though you can override that via the`zf-http-cache.etag.override` flag.
14+
Additionally, you can provide alternate ETag generation mechanisms by
15+
implementing`ZF\HttpCache\ETagGeneratorInterface`, and specifying the service
16+
name of your implementation via the`zf-http-cache.etag.generator`
17+
configuration value.
18+
-[#13](https://github.com/zfcampus/zf-http-cache/pull/13) and
19+
[#14](https://github.com/zfcampus/zf-http-cache/pull/14) add support for Zend
20+
Framework v3 components, including zend-mvc, zend-servicemanager, and
21+
zend-eventmanager.
22+
-[#14](https://github.com/zfcampus/zf-http-cache/pull/14) marks the package as
23+
a ZF module, allowing zf-component-installer to auto-inject it into
24+
application configuration.
25+
-[#12](https://github.com/zfcampus/zf-http-cache/pull/12) adds more
26+
capabilities around matching routed controllers, including the ability to
27+
match:
28+
- the route name
29+
-`controller::action` concatenations
30+
- just the controller
31+
- a regular expression (based on concatenating the controller and action)
32+
- wildcards
33+
See the README.md file and the`config/module.config.php` for examples.
34+
35+
###Deprecated
36+
37+
- Nothing.
38+
39+
###Removed
40+
41+
-[#14](https://github.com/zfcampus/zf-http-cache/pull/14) removes support for
42+
PHP 5.5.
43+
44+
###Fixed
45+
46+
- Nothing.
47+
548
##1.2.4 - TBD
649

750
###Added

‎README.md‎

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ key:
3333

3434

3535
```php
36-
returnarray(
36+
return[
3737
/* ... */
38-
'modules' =>array(
38+
'modules' =>[
3939
/* ... */
4040
'ZF\HttpCache',
41-
),
41+
],
4242
/* ... */
43-
);
43+
];
4444
```
4545

4646
Configuration
@@ -56,33 +56,48 @@ The `config/module.config.php` file contains a self-explanative example of confi
5656

5757
####Key:`controllers`
5858

59-
The`controllers` key is utilized for mapping a combination of a controller and a HTTP method (see below) to a cache header configuration.
59+
The`controllers` key is utilized for mapping any of
60+
61+
- a route name
62+
- a concatenated`controller::action`
63+
- a controller
64+
- a regexp
65+
- a wildcard
66+
67+
Each is case sensitive, and will map one or more HTTP methods to the cache
68+
header configuration specific to the given rule.
6069

6170
Example:
6271

6372
```php
6473
// See the `config/application.config.php` for a complete commented example
65-
'zf-http-cache' =>array(
74+
'zf-http-cache' =>[
6675
/* ... */
67-
'controllers' =>array(
68-
'<controller>' =>array(
69-
'<http-method>' =>array(
70-
'<cache-header-name>' =>array(
76+
'controllers' =>[
77+
'<controller>' =>[
78+
'<http-method>' =>[
79+
'<cache-header-name>' =>[
7180
'override' => true,
7281
'value' => '<cache-header-value>',
73-
),
74-
),
75-
),
76-
),
82+
],
83+
],
84+
],
85+
],
7786
/* ... */
78-
),
87+
],
7988
```
8089

8190
#####Key:`<controller>`
8291

83-
Either a controller name (as returned by`Zend\Mvc\MvcEvent::getRouteMatch()->getParam('controller')`, case-sensitive) or a wildcard.
92+
Either
93+
94+
- a concatenation of`$controller::$action`
95+
- a controller name (as returned by`Zend\Mvc\MvcEvent::getRouteMatch()->getParam('controller')`;
96+
the value is case-sensitive)
97+
- a regexp (see`<regex_delimiter>` key)
98+
- a wildcard
8499

85-
A wildcardstands for all the non-specified controllers.
100+
A wildcardmatches any unspecified controllers.
86101

87102
#####Key:`<http-method>`
88103

@@ -92,7 +107,21 @@ A wildcard stands for all the non-specified HTTP methods.
92107

93108
#####Key:`<cache-header-name>`
94109

95-
A http cache header name (`Cache-control`,`Expires`, etc.).
110+
An HTTP cache header name (`Cache-control`,`expires`,`etag` etc.).
111+
112+
######ETags
113+
114+
For ETags you can specify a custom generator in the configuration:
115+
116+
```
117+
'etag' => [
118+
'override' => true,
119+
'generator' => 'Your\Own\ETagGenerator',
120+
],
121+
```
122+
123+
A generator example can be found in`\ZF\HttpCache\DefaultETagGenerator`.
124+
96125

97126
#####Key:`<cache-header-value>`
98127

@@ -113,11 +142,11 @@ If you no longer need this module, rather consider removing the module from the
113142
Example:
114143

115144
```php
116-
'zf-http-cache' =>array(
145+
'zf-http-cache' =>[
117146
/* ... */
118147
'enable' => true, // Cache module is enabled.
119148
/* ... */
120-
),
149+
],
121150
```
122151

123152
####Key:`http_codes_black_list`
@@ -128,11 +157,11 @@ Defaults to all others than `200`.
128157
Example:
129158

130159
```php
131-
'zf-http-cache' =>array(
160+
'zf-http-cache' =>[
132161
/* ... */
133-
'http_codes_black_list' =>array('201', '304', '400', '500'), // Whatever the other configurations, the responses with these HTTP codes won't be cached.
162+
'http_codes_black_list' =>['201', '304', '400', '500'], // Whatever the other configurations, the responses with these HTTP codes won't be cached.
134163
/* ... */
135-
),
164+
],
136165
```
137166

138167
####Key:`regex_delimiter`
@@ -152,29 +181,29 @@ Regexp wins over wildcard.
152181
Example:
153182

154183
```php
155-
'zf-http-cache' =>array(
184+
'zf-http-cache' =>[
156185
/* ... */
157186
'regex_delimiter' => '~',
158187
/* ... */
159-
'controllers' =>array(
160-
'~.*~' =>array( // Acts as a wildcard.
188+
'controllers' =>[
189+
'~.*~' =>[ // Acts as a wildcard.
161190
/* ... */
162-
),
163-
),
191+
],
192+
],
164193
/* ... */
165-
),
194+
],
166195
```
167196

168197
###System Configuration
169198

170199
The following configuration is provided in`config/module.config.php`:
171200

172201
```php
173-
'service_manager' =>array(
174-
'factories' =>array(
202+
'service_manager' =>[
203+
'factories' =>[
175204
'ZF\HttpCache\HttpCacheListener' => 'ZF\HttpCache\HttpCacheListenerFactory',
176-
)
177-
),
205+
],
206+
],
178207
```
179208

180209
ZF2 Events

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp