本文整理汇总了PHP中Composer\Util\Filesystem::removeDirectoryPhp方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::removeDirectoryPhp方法的具体用法?PHP Filesystem::removeDirectoryPhp怎么用?PHP Filesystem::removeDirectoryPhp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Util\Filesystem
的用法示例。
在下文中一共展示了Filesystem::removeDirectoryPhp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemoveDirectoryPhp
/**
* @group GH-1339
*/
public function testRemoveDirectoryPhp()
{
@mkdir($this->workingDir . "/level1/level2", 0777, true);
file_put_contents($this->workingDir . "/level1/level2/hello.txt", "hello world");
$fs = new Filesystem();
$this->assertTrue($fs->removeDirectoryPhp($this->workingDir));
$this->assertFalse(file_exists($this->workingDir . "/level1/level2/hello.txt"));
}
示例2: tearDown
protected function tearDown()
{
$fs = new Filesystem();
$dirs = glob(__DIR__ . '/../_fixtures/*/*/vendor');
foreach ($dirs as $dir) {
$fs->removeDirectoryPhp($dir);
}
}
示例3: testRemoveDirectoryPhp
/**
* @group GH-1339
*/
public function testRemoveDirectoryPhp()
{
$tmp = sys_get_temp_dir();
@mkdir($tmp . "/composer_testdir/level1/level2", 0777, true);
file_put_contents($tmp . "/composer_testdir/level1/level2/hello.txt", "hello world");
$fs = new Filesystem();
$this->assertTrue($fs->removeDirectoryPhp($tmp . "/composer_testdir"));
$this->assertFalse(file_exists($tmp . "/composer_testdir/level1/level2/hello.txt"));
}
示例4: cleanTempDir
/**
* Remove directories / files that should not be copied
*/
protected function cleanTempDir()
{
foreach ($this->filesToIgnore as $fileToIgnore) {
$this->fileSystem->unlink($this->rubedoRootDir . '/' . $fileToIgnore);
}
foreach ($this->dirsToIgnore as $dirToIgnore) {
$this->fileSystem->removeDirectoryPhp($this->rubedoRootDir . '/' . $dirToIgnore);
}
}