laurent
laurent

Reputation: 90824

Where is default cache directory for FilesystemAdapter in Symfony 3?

I'm on Windows and looking for the location of the cache generated by FileSystemAdapter. I thought it would be in var/cache of the application directory but it doesn't look like as when I clear it, it's still using the cache.

Any idea where it could be?

Upvotes: 5

Views: 6201

Answers (2)

l'L'l
l'L'l

Reputation: 47274

Filesystem Cache Adapter

use Symfony\Component\Cache\Adapter\FilesystemAdapter;

$cache = new FilesystemAdapter(
    // the subdirectory of the main cache directory where cache items are stored
    $namespace = '',
    // in seconds; applied to cache items that don't define their own lifetime
    // 0 means to store the cache items indefinitely (i.e. until the files are deleted)
    $defaultLifetime = 0,
    // the main cache directory (the application needs read-write permissions on it)
    // if none is specified, a directory is created inside the system temporary directory
    $directory = null
);

note: if none is specified, a directory is created inside the system temporary directory.

Also see: Removing Cache Items

Upvotes: 5

Matteo
Matteo

Reputation: 39420

Checking in the source code of the class, the class use this trait and if you don't specify a directory, it will use the function sys_get_temp_dir that return directory path used for temporary files.

For a Windows-based system could be:

C:\Windows\Temp

Hope this help

Upvotes: 5

Related Questions