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

[FrameworkBundle] add option to disable the class cache cache warmer#17619

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
xabbuh wants to merge1 commit intosymfony:2.8fromxabbuh:issue-17439
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,6 +163,7 @@ public function getConfigTreeBuilder()
->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
->prototype('scalar')->end()
->end()
->booleanNode('warm_up_class_cache')->defaultTrue()->end()
->end()
;

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -164,6 +164,10 @@ public function load(array $configs, ContainerBuilder $container)
$definition->replaceArgument(1, null);
}

if (!$config['warm_up_class_cache']) {
$container->removeDefinition('kernel.class_cache.cache_warmer');
}

$this->addClassesToCompile(array(
'Symfony\\Component\\Config\\FileLocator',

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@
<xsd:attribute name="secret" type="xsd:string" />
<xsd:attribute name="default-locale" type="xsd:string" />
<xsd:attribute name="test" type="xsd:boolean" />
<xsd:attribute name="warm-up-class-cache" type="xsd:boolean" />
</xsd:complexType>

<xsd:complexType name="form">
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -190,6 +190,7 @@ protected static function getBundleDefaultConfig()
'base_urls' => array(),
'packages' => array(),
),
'warm_up_class_cache' => true,
);
}
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
<?php

$container->loadFromExtension('framework', array(
'warm_up_class_cache' => false,
));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config warm-up-class-cache="false" />
</container>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
framework:
warm_up_class_cache: false
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -499,6 +499,18 @@ public function testPropertyInfoEnabled()
$this->assertTrue($container->has('property_info'));
}

public function testClassCacheCacheWarmerEnabled()
{
$container = $this->createContainerFromFile('default_config');
$this->assertTrue($container->has('kernel.class_cache.cache_warmer'));
}

public function testClassCacheCacheWarmerDisabled()
{
$container = $this->createContainerFromFile('class_cache_cache_warmer');
$this->assertFalse($container->has('kernel.class_cache.cache_warmer'));
}

protected function createContainer(array $data = array())
{
return new ContainerBuilder(new ParameterBag(array_merge(array(
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp