feature #15905 [3.0][Config] Removed isFresh() related functionality (WouterJ)
This PR was merged into the 3.0-dev branch.
Discussion
----------
[3.0][Config] Removed isFresh() related functionality
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
4cdae98
Removed Resource#isFresh() related functionality
This commit is contained in:
commit
30fc4eea13
@ -49,12 +49,5 @@
|
|||||||
<tag name="config_cache.resource_checker" priority="-990" />
|
<tag name="config_cache.resource_checker" priority="-990" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<!--
|
|
||||||
This service is deprecated and will be removed in 3.0.
|
|
||||||
-->
|
|
||||||
<service class="Symfony\Component\Config\Resource\BCResourceInterfaceChecker" public="false">
|
|
||||||
<tag name="config_cache.resource_checker" priority="-1000" />
|
|
||||||
</service>
|
|
||||||
|
|
||||||
</services>
|
</services>
|
||||||
</container>
|
</container>
|
||||||
|
@ -5,6 +5,8 @@ CHANGELOG
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
* removed `ReferenceDumper` class
|
* removed `ReferenceDumper` class
|
||||||
|
* removed the `ResourceInterface::isFresh()` method
|
||||||
|
* removed `BCResourceInterfaceChecker` class
|
||||||
|
|
||||||
2.8.0
|
2.8.0
|
||||||
-----
|
-----
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Config;
|
namespace Symfony\Component\Config;
|
||||||
|
|
||||||
use Symfony\Component\Config\Resource\BCResourceInterfaceChecker;
|
|
||||||
use Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
|
use Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,11 +20,6 @@ use Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
|
|||||||
* \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will
|
* \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will
|
||||||
* be used to check cache freshness.
|
* be used to check cache freshness.
|
||||||
*
|
*
|
||||||
* During a transition period, also instances of
|
|
||||||
* \Symfony\Component\Config\Resource\ResourceInterface will be checked
|
|
||||||
* by means of the isFresh() method. This behaviour is deprecated since 2.8
|
|
||||||
* and will be removed in 3.0.
|
|
||||||
*
|
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
* @author Matthias Pigulla <mp@webfactory.de>
|
* @author Matthias Pigulla <mp@webfactory.de>
|
||||||
*/
|
*/
|
||||||
@ -41,7 +35,6 @@ class ConfigCache extends ResourceCheckerConfigCache
|
|||||||
{
|
{
|
||||||
parent::__construct($file, array(
|
parent::__construct($file, array(
|
||||||
new SelfCheckingResourceChecker(),
|
new SelfCheckingResourceChecker(),
|
||||||
new BCResourceInterfaceChecker(),
|
|
||||||
));
|
));
|
||||||
$this->debug = (bool) $debug;
|
$this->debug = (bool) $debug;
|
||||||
}
|
}
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of the Symfony package.
|
|
||||||
*
|
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Symfony\Component\Config\Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resource checker for the ResourceInterface. Exists for BC.
|
|
||||||
*
|
|
||||||
* @author Matthias Pigulla <mp@webfactory.de>
|
|
||||||
*
|
|
||||||
* @deprecated since 2.8, to be removed in 3.0.
|
|
||||||
*/
|
|
||||||
class BCResourceInterfaceChecker extends SelfCheckingResourceChecker
|
|
||||||
{
|
|
||||||
public function supports(ResourceInterface $metadata)
|
|
||||||
{
|
|
||||||
/* As all resources must be instanceof ResourceInterface,
|
|
||||||
we support them all. */
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isFresh(ResourceInterface $resource, $timestamp)
|
|
||||||
{
|
|
||||||
@trigger_error('Resource checking through ResourceInterface::isFresh() is deprecated since 2.8 and will be removed in 3.0', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return parent::isFresh($resource, $timestamp); // For now, $metadata features the isFresh() method, so off we go (quack quack)
|
|
||||||
}
|
|
||||||
}
|
|
@ -31,18 +31,6 @@ interface ResourceInterface
|
|||||||
*/
|
*/
|
||||||
public function __toString();
|
public function __toString();
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the resource has not been updated since the given timestamp.
|
|
||||||
*
|
|
||||||
* @param int $timestamp The last time the resource was loaded
|
|
||||||
*
|
|
||||||
* @return bool True if the resource has not been updated, false otherwise
|
|
||||||
*
|
|
||||||
* @deprecated since 2.8, to be removed in 3.0. If your resource can check itself for
|
|
||||||
* freshness implement the SelfCheckingResourceInterface instead.
|
|
||||||
*/
|
|
||||||
public function isFresh($timestamp);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the tied resource.
|
* Returns the tied resource.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user