Пример #1
0
 public function testGetPath()
 {
     $file = new \r8\FileSys\File();
     $this->assertNull($file->getPath());
     $file->setDir("dir/to");
     $this->assertSame("dir/to/", $file->getPath());
     $file->setDir("/dir/to/");
     $this->assertSame("/dir/to/", $file->getPath());
     $file->setExt("php");
     $this->assertSame("/dir/to/", $file->getPath());
     $file->setFilename("Example");
     $this->assertSame("/dir/to/Example.php", $file->getPath());
     $file->clearExt();
     $this->assertSame("/dir/to/Example", $file->getPath());
     $file->clearDir();
     $this->assertSame("Example", $file->getPath());
     $file->setExt("php");
     $this->assertSame("Example.php", $file->getPath());
     $file->clearFilename()->clearExt();
     $this->assertNull($file->getPath());
 }
Пример #2
0
    }
    $result = system("cp -R " . escapeshellarg($base . $source) . " " . escapeshellarg($dest->getSubPath($destination)->getPath()));
    if ($result === FALSE) {
        die("Failed");
    }
    echo "complete\n";
}
// Remove the config file from pooled directory
if ($dest->contains("tests/config.php")) {
    $dest->getSubPath("tests/config.php")->delete();
    echo "test config file deleted\n";
}
$zipFile = new \r8\FileSys\File($base . "tools/RoundEights-" . r8_VERSION . ".zip");
$targzFile = new \r8\FileSys\File($base . "tools/RoundEights-" . r8_VERSION . ".tar.gz");
if ($zipFile->exists()) {
    echo "Removing existing zip file\n";
    $zipFile->delete();
}
if ($targzFile->exists()) {
    echo "Removing existing tar.gz file\n";
    $targzFile->delete();
}
// Create the archives archive
echo "Creating zip archive\n";
system("cd " . escapeshellarg($tempDir) . "; " . "zip -r " . escapeshellarg($zipFile->getPath()) . " " . escapeshellarg("RoundEights"));
echo "Creating tar.gz archive\n";
system("cd " . escapeshellarg($tempDir) . "; " . "tar -cvzf " . escapeshellarg($targzFile->getPath()) . " " . escapeshellarg("RoundEights"));
// Purge and remove the temporary dir
echo "Removing temporary directory\n";
$tempDir->purge()->delete();
echo "End of script\n";