Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Clears file status cache
clearstatcache(bool $clear_realpath_cache = false, string $filename = ""): void
if ($handle) {
try {
if (flock($handle, LOCK_SH)) {
clearstatcache(true, $path);
$contents = fread($handle, $this->size($path) ?: 1);
try {
if (flock($handle, LOCK_SH)) {
clearstatcache(true, $path);
$contents = fread($handle, $this->size($path) ?: 1);
public function replace($path, $content)
{
clearstatcache(true, $path);
$path = realpath($path) ?: $path;
{
clearstatcache(true, $path);
$path = realpath($path) ?: $path;
foreach ($paths as $path) {
try {
if (@unlink($path)) {
clearstatcache(false, $path);
} else {
$success = false;
}
try {
if (@unlink($path)) {
clearstatcache(false, $path);
} else {
$success = false;
}
public function assertExists($path, $content = null)
{
clearstatcache();
$paths = Arr::wrap($path);
{
clearstatcache();
$paths = Arr::wrap($path);
public function assertMissing($path)
{
clearstatcache();
$paths = Arr::wrap($path);
{
clearstatcache();
$paths = Arr::wrap($path);
public function read($length = null)
{
clearstatcache(true, $this->path);
return fread($this->handle, $length ?? ($this->size() ?: 1));
}
{
clearstatcache(true, $this->path);
return fread($this->handle, $length ?? ($this->size() ?: 1));
}
while ($process->isRunning()) {
if ($hasEnvironment) {
clearstatcache(false, $environmentFile);
}
if (! $this->option('no-reload') &&
if ($hasEnvironment) {
clearstatcache(false, $environmentFile);
}
if (! $this->option('no-reload') &&
Process::fromShellCommandline("rm {$this->stubFile}")->run();
clearstatcache(true, $this->stubFile);
$this->assertFalse(File::exists($this->stubFile));
}
clearstatcache(true, $this->stubFile);
$this->assertFalse(File::exists($this->stubFile));
}
Process::fromShellCommandline("rm {$this->stubFile}")->run();
clearstatcache(true, $this->stubFile);
$this->assertFalse(File::isFile($this->stubFile));
}
}
clearstatcache(true, $this->stubFile);
$this->assertFalse(File::isFile($this->stubFile));
}
}
Process::fromShellCommandline("rm {$this->stubFile}")->run();
clearstatcache(true, $this->stubFile);
Storage::disk('public')->assertMissing('StardewTaylor.png');
$this->assertFalse(Storage::disk('public')->exists('StardewTaylor.png'));
}
clearstatcache(true, $this->stubFile);
Storage::disk('public')->assertMissing('StardewTaylor.png');
$this->assertFalse(Storage::disk('public')->exists('StardewTaylor.png'));
}