Updated Rector to commit 7d4d120e2d

7d4d120e2d [Cache] Avoid to remove non empty cache directories on cache clearing (#1007)
This commit is contained in:
Tomas Votruba 2021-10-18 16:50:10 +00:00
parent b32a8b1d6d
commit a91fc19e43
6 changed files with 38 additions and 20 deletions

View File

@ -84,7 +84,25 @@ final class FileCacheStorage implements \Rector\Caching\Contract\ValueObject\Sto
public function clean($key) : void
{
$cacheFilePaths = $this->getCacheFilePaths($key);
$this->smartFileSystem->remove([$cacheFilePaths->getFirstDirectory(), $cacheFilePaths->getSecondDirectory(), $cacheFilePaths->getFilePath()]);
if (!$this->smartFileSystem->exists($cacheFilePaths->getFilePath())) {
return;
}
$this->smartFileSystem->remove($cacheFilePaths->getFilePath());
if (!$this->smartFileSystem->exists($cacheFilePaths->getSecondDirectory())) {
return;
}
// FilesystemIterator will initially point to the first file in the folder - if there are no files in the folder, valid() will return false
$secondDirectoryFileSystemIterator = new \FilesystemIterator($cacheFilePaths->getSecondDirectory());
if (!$secondDirectoryFileSystemIterator->valid()) {
$this->smartFileSystem->remove($cacheFilePaths->getSecondDirectory());
}
if (!$this->smartFileSystem->exists($cacheFilePaths->getFirstDirectory())) {
return;
}
$firstDirectoryFileSystemIterator = new \FilesystemIterator($cacheFilePaths->getFirstDirectory());
if (!$firstDirectoryFileSystemIterator->valid()) {
$this->smartFileSystem->remove($cacheFilePaths->getFirstDirectory());
}
}
public function clear() : void
{

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '34b254affb2faa6152d9db717803320b9916082d';
public const PACKAGE_VERSION = '7d4d120e2d0507236381171db434e6e803d70c99';
/**
* @var string
*/
public const RELEASE_DATE = '2021-10-18 14:57:23';
public const RELEASE_DATE = '2021-10-18 23:36:56';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211018\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf::getLoader();
return ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf
class ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8a23179ad92d10336d9c6116b2605abf::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit8a23179ad92d10336d9c6116b2605abf::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire8a23179ad92d10336d9c6116b2605abf($fileIdentifier, $file);
composerRequire562f58b6f9ed0b52c1e9b515a5069c9c($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire8a23179ad92d10336d9c6116b2605abf($fileIdentifier, $file)
function composerRequire562f58b6f9ed0b52c1e9b515a5069c9c($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit8a23179ad92d10336d9c6116b2605abf
class ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3894,9 +3894,9 @@ class ComposerStaticInit8a23179ad92d10336d9c6116b2605abf
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8a23179ad92d10336d9c6116b2605abf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8a23179ad92d10336d9c6116b2605abf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8a23179ad92d10336d9c6116b2605abf::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit562f58b6f9ed0b52c1e9b515a5069c9c::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20211018\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf', false) && !interface_exists('ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf', false) && !trait_exists('ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf', false)) {
spl_autoload_call('RectorPrefix20211018\ComposerAutoloaderInit8a23179ad92d10336d9c6116b2605abf');
if (!class_exists('ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c', false) && !interface_exists('ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c', false) && !trait_exists('ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c', false)) {
spl_autoload_call('RectorPrefix20211018\ComposerAutoloaderInit562f58b6f9ed0b52c1e9b515a5069c9c');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20211018\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211018\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire8a23179ad92d10336d9c6116b2605abf')) {
function composerRequire8a23179ad92d10336d9c6116b2605abf() {
return \RectorPrefix20211018\composerRequire8a23179ad92d10336d9c6116b2605abf(...func_get_args());
if (!function_exists('composerRequire562f58b6f9ed0b52c1e9b515a5069c9c')) {
function composerRequire562f58b6f9ed0b52c1e9b515a5069c9c() {
return \RectorPrefix20211018\composerRequire562f58b6f9ed0b52c1e9b515a5069c9c(...func_get_args());
}
}
if (!function_exists('parseArgs')) {