From 5d6b7c85d71d42e88c91418057f93a9f94590a7e Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Mon, 7 Aug 2017 14:51:27 +1200 Subject: [PATCH] Deprecate SS_TemplateManifest --- .../01_Templates/05_Template_Inheritance.md | 22 +++++-------------- .../05_Extending/05_Injector.md | 10 ++++----- .../08_Performance/01_Caching.md | 1 - .../16_Execution_Pipeline/02_Manifests.md | 4 ++-- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/docs/en/02_Developer_Guides/01_Templates/05_Template_Inheritance.md b/docs/en/02_Developer_Guides/01_Templates/05_Template_Inheritance.md index 280aa8614..35c0374db 100644 --- a/docs/en/02_Developer_Guides/01_Templates/05_Template_Inheritance.md +++ b/docs/en/02_Developer_Guides/01_Templates/05_Template_Inheritance.md @@ -30,24 +30,14 @@ As we've added a new file, make sure you flush your SilverStripe cache by visiti Template inheritance works on more than email templates. All files within the `templates` directory including `includes`, `layout` or anything else from core (or add-on's) template directory can be overridden by being located inside your `mysite/templates` directory. SilverStripe keeps an eye on what templates have been overridden and the location of the -correct template through a [SS_TemplateManifest](api:SS_TemplateManifest). +correct template through a [ThemeResourceLoader](api:SilverStripe\View\ThemeResourceLoader). -## Template Manifest +## ThemeResourceLoader -The location of each template and the hierarchy of what template to use is stored within a [SS_TemplateManifest](api:SS_TemplateManifest) -instance. This is a serialized object containing a map of template names, paths and other meta data for each template -and is cached in your applications `TEMP_FOLDER` for performance. For SilverStripe to find the `GenericEmail` template -it does not check all your `template` folders on the fly, it simply asks the `manifest`. - -The manifest is created whenever you flush your SilverStripe cache by appending `?flush=1` to any SilverStripe URL. For -example by visiting `http://yoursite.com/?flush=1`. When your include the `flush=1` flag, the manifest class will search -your entire project for the appropriate `.ss` files located in `template` directory and save that information for later. - -
-Whenever you add or remove template files, rebuild the manifest by visiting `http://yoursite.com/?flush=1`. You can -flush the cache from any page, (.com/home?flush=1, .com/admin?flush=1, etc.). Flushing the cache can be slow, so you -only need to do it when you're developing new templates. -
+The location of each template and the hierarchy of what template to use is stored within a [ThemeResourceLoader](api:SilverStripe\View\ThemeResourceLoader) +instance. This is a serialized object containing a map of [ThemeManifest](api:SilverStripe\View\ThemeManifest) instances. For SilverStripe to find the `GenericEmail` template +it does not check all your `template` folders on the fly, it simply asks the manifests. The manifests are created and added to the loader when the +[kernel](api:SilverStripe\Core\CoreKernel) is instantiated. ## Template Priority diff --git a/docs/en/02_Developer_Guides/05_Extending/05_Injector.md b/docs/en/02_Developer_Guides/05_Extending/05_Injector.md index f81a1be48..4a0639914 100644 --- a/docs/en/02_Developer_Guides/05_Extending/05_Injector.md +++ b/docs/en/02_Developer_Guides/05_Extending/05_Injector.md @@ -197,12 +197,12 @@ An example using the `MyFactory` service to create instances of the `MyService` To override the `$dependency` declaration for a class, define the following configuration file. **mysite/_config/app.yml** - +```yml MyController: dependencies: textProperty: a string value permissions: %$PermissionService - +``` ## Managed objects Simple dependencies can be specified by the `$dependencies`, but more complex configurations are possible by specifying @@ -281,8 +281,8 @@ named services, which may not be actual classes, and thus should not behave as t Thus if you want an object to have the injected dependencies of a service of another name, you must assign a reference to that service. -```yaml +```yaml Injector: JSONServiceDefinition: class: JSONServiceImplementor @@ -299,13 +299,13 @@ If class is not specified, then the class will be inherited from the outer servi For example with this config: - :::yaml +```yml Injector: Connector: properties: AsString: true ServiceConnector: %$Connector - +``` Both `Connector` and `ServiceConnector` will have the `AsString` property set to true, but the resulting instances will be classes which match their respective service names, due to the lack of a `class` specification. diff --git a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md index 715a6fc39..95c5017eb 100644 --- a/docs/en/02_Developer_Guides/08_Performance/01_Caching.md +++ b/docs/en/02_Developer_Guides/08_Performance/01_Caching.md @@ -9,7 +9,6 @@ By default, the storage mechanism chooses the most performant adapter available The most common caches are manifests of various resources: * PHP class locations ([ClassManifest](api:SilverStripe\Core\Manifest\ClassManifest)) - * Template file locations and compiled templates ([SS_TemplateManifest](api:SS_TemplateManifest)) * Configuration settings from YAML files ([ConfigManifest](api:ConfigManifest)) * Language files ([i18n](api:SilverStripe\i18n\i18n)) diff --git a/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md b/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md index b99705573..b040b27e6 100644 --- a/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md +++ b/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md @@ -53,9 +53,9 @@ excluded from manifests by creating a blank `_manifest_exclude` file in the modu By default, the finder implementation will exclude any classes stored in files within a `tests/` folder, unless tests are executed. -## Template Manifest +## Theme Manifests -The [SS_TemplateManifest](api:SS_TemplateManifest) class builds a manifest of all templates present in a directory, +The [ThemeManifest](api:SilverStripe\View\ThemeManifest) class builds a manifest of all templates present in a directory, in both modules and themes. Templates in `tests/` folders are automatically excluded. The chapter on [template inheritance](../templates/template_inheritance) provides more details on its operation.