I have seen this: How to clear APC cache entries?
And I have this working per file:
$filename = '/home/testing_code/abc.php';
if (apc_compile_file($filename)) {
if (apc_delete_file($filename)) {
echo "Successfully deleted file $filename from APC cache.<br>", PHP_EOL;
}
}
No matter how I play with it, I cant find a way to clear based on a Directory, anyone know how to do this?
i.e. something like this:
$filename = '/home/testing_code/*.php';
if (apc_compile_file($filename)) {
if (apc_delete_file($filename)) {
echo "Successfully deleted file $filename from APC cache.<br>", PHP_EOL;
}
}
Use apc_cache_info to get the list of cached files. Call apc_delete_file
on any files that match your mask.
You can also use an APCIterator to find all files that match your mask and then delete them. Note that you'll want to move the iterator to the next file before you delete the previous one. Or make an array of all matching filenames using the iterator and then delete them from your own array. Modifying a collection while traversing it is tricky.
There is no single call that does this.