Skip to content

Commit 5956454

Browse files
oliverkleeSam Tuke
authored andcommitted
[BUGFIX] Do no depend on a valid configuration for clearing the caches (#235)
This also fixes composer create-project. Fixes #194
1 parent 9f1a79c commit 5956454

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

Classes/Composer/ScriptHandler.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,14 @@ private static function createAndInitializeModuleFinder(Event $event): ModuleFin
246246
}
247247

248248
/**
249-
* Clears the caches of all environments.
250-
*
251-
* @param Event $event
249+
* Clears the caches of all environments. This does not warm the caches.
252250
*
253251
* @return void
254252
*/
255-
public static function clearAllCaches(Event $event)
253+
public static function clearAllCaches()
256254
{
257-
$environments = ['test', 'dev', 'prod'];
258-
$consoleDir = self::getConsoleDir($event, 'clear the cache');
259-
if ($consoleDir === null) {
260-
return;
261-
}
262-
263-
foreach ($environments as $environment) {
264-
self::executeCommand($event, $consoleDir, 'cache:clear --no-warmup -e ' . $environment);
265-
}
255+
$fileSystem = new Filesystem();
256+
$fileSystem->remove(self::getApplicationRoot() . '/var/cache');
266257
}
267258

268259
/**

0 commit comments

Comments
 (0)