-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docbot] Reviewed some component chapters #5550
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
.. index:: | ||
single: Config; Caching based on resources | ||
|
||
Caching Based on Resources | ||
Caching based on Resources | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the twisted logic behind title casing, but are we sure about this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah looks odd to me too (isn't "based" derived from "to base (sth. on sth.)"?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looked odd to me at first, looks ok to me now - and I verified that lowercase makes sense from one quick source. Mostly, I don't care either way :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really get the feeling that we should think again about our capitalisation rule. :) |
||
========================== | ||
|
||
When all configuration resources are loaded, you may want to process the configuration | ||
values and combine them all in one file. This file acts like a cache. Its | ||
contents don’t have to be regenerated every time the application runs – only | ||
when the configuration resources are modified. | ||
When all configuration resources are loaded, you may want to process the | ||
configuration values and combine them all in one file. This file acts | ||
like a cache. Its contents don’t have to be regenerated every time the | ||
application runs – only when the configuration resources are modified. | ||
|
||
For example, the Symfony Routing component allows you to load all routes, | ||
and then dump a URL matcher or a URL generator based on these routes. In | ||
this case, when one of the resources is modified (and you are working in a | ||
development environment), the generated file should be invalidated and regenerated. | ||
This can be accomplished by making use of the :class:`Symfony\\Component\\Config\\ConfigCache` | ||
class. | ||
|
||
The example below shows you how to collect resources, then generate some code | ||
based on the resources that were loaded, and write this code to the cache. The | ||
cache also receives the collection of resources that were used for generating | ||
the code. By looking at the "last modified" timestamp of these resources, | ||
the cache can tell if it is still fresh or that its contents should be regenerated:: | ||
this case, when one of the resources is modified (and you are working | ||
in a development environment), the generated file should be invalidated | ||
and regenerated. This can be accomplished by making use of the | ||
:class:`Symfony\\Component\\Config\\ConfigCache` class. | ||
|
||
The example below shows you how to collect resources, then generate some | ||
code based on the resources that were loaded and write this code to the | ||
cache. The cache also receives the collection of resources that were used | ||
for generating the code. By looking at the "last modified" timestamp of | ||
these resources, the cache can tell if it is still fresh or that its contents | ||
should be regenerated:: | ||
|
||
use Symfony\Component\Config\ConfigCache; | ||
use Symfony\Component\Config\Resource\FileResource; | ||
|
@@ -52,8 +53,8 @@ the cache can tell if it is still fresh or that its contents should be regenerat | |
// you may want to require the cached code: | ||
require $cachePath; | ||
|
||
In debug mode, a ``.meta`` file will be created in the same directory as the | ||
cache file itself. This ``.meta`` file contains the serialized resources, | ||
whose timestamps are used to determine if the cache is still fresh. When not | ||
in debug mode, the cache is considered to be "fresh" as soon as it exists, | ||
In debug mode, a ``.meta`` file will be created in the same directory as | ||
the cache file itself. This ``.meta`` file contains the serialized resources, | ||
whose timestamps are used to determine if the cache is still fresh. When | ||
not in debug mode, the cache is considered to be "fresh" as soon as it exists, | ||
and therefore no ``.meta`` file will be generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think
methods
should bemethod
@wouterjThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 (even though it's unrelated to the PR)