Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Deletes a file
<?php unlink(string $filename, ?resource $context = null): bool
<?php         $headers = get_headers($resolvedUrl);



        unlink($tmp);



        return (! $headers || strpos($headers[0], '404')) == false;

    }
<?php         foreach ($files as $lockFile) {

            if (is_file($lockFile)) {

                unlink($lockFile);

            }

        }

    }
<?php     public function it_gracefully_fails_when_lock_file_does_not_exist()

    {

        unlink($this->basePath('composer.lock'));



        $installed = Composer::installed();
<?php         $this->assertFalse($date->eq($entry->lastModified()));

        $this->assertTrue($valueBasedDate->eq($entry->lastModified()));



        @unlink($path);

    }
<?php             $path = __DIR__.'/__fixtures__/content/collections/new.yaml',

            "title: 'New Collection'\nrevisions: true\ndate: true\ndefault_status: draft\ninject:\n  foo: bar\n"

        );

        @unlink($path);

    }
<?php             $path = __DIR__.'/__fixtures__/content/assets/new.yaml',

            "title: 'New Container'\n"

        );

        @unlink($path);

    }
<?php             $path = __DIR__.'/__fixtures__/content/taxonomies/new.yaml',

            "title: 'New Taxonomy'\n"

        );

        @unlink($path);

    }
<?php             $path = __DIR__.'/__fixtures__/content/globals/new.yaml',

            "title: 'New Global Set'\ndata:\n  foo: bar\n"

        );

        @unlink($path);

    }
<?php         $this->assertNotNull($item = $this->repo->findByHandle('new'));

        $this->assertEquals($container, $item);

        $this->assertTrue(file_exists($this->directory.'/new.yaml'));

        @unlink($this->directory.'/new.yaml');

    }

}
<?php         $this->assertNotNull($item = $this->repo->findByHandle('new'));

        $this->assertEquals(['foo' => 'bar'], $item->cascade()->all());

        $this->assertTrue(file_exists($this->directory.'/new.yaml'));

        @unlink($this->directory.'/new.yaml');

    }

}
<?php         $this->assertNotNull($item = $this->repo->find('new'));

        $this->assertEquals(['foo' => 'bar', 'baz' => 'qux'], $item->in('en')->data()->all());

        $this->assertFileExists($this->directory.'/new.yaml');

        @unlink($this->directory.'/new.yaml');

    }

}
<?php         $this->assertNotNull($this->repo->findByHandle('new'));

        $this->assertFileExists($this->directory.'/new.yaml');

        @unlink($this->directory.'/new.yaml');

    }

}
<?php         $this->assertNotNull($item = $this->repo->findByHandle('new'));

        $this->assertEquals(['foo' => 'bar'], $item->cascade()->all());

        $this->assertTrue(file_exists($this->directory.'/new.yaml'));

        @unlink($this->directory.'/new.yaml');

    }

}
<?php         $this->parent->store('blog')->save($entry);



        $this->assertFileEqualsString($path = $this->directory.'/blog/2017-07-04.test.md', $entry->fileContents());

        @unlink($path);

        $this->assertFileNotExists($path);



        $this->assertEquals($path, $this->parent->store('blog')->paths()->get('123'));
<?php         $this->assertFileEqualsString($path = $this->directory.'/blog/2017-07-04.updated.md', $entry->fileContents());

        $this->assertEquals($path, $this->parent->store('blog')->paths()->get('123'));



        @unlink($initialPath);

        @unlink($path);

    }