Example #1
0
 public function unlink()
 {
     $f = new Folder($this->temp);
     $f->create();
     $f->unlink();
     $this->assertFalse($f->exists());
 }
 /**
  * Removes a given module version
  *
  * @param  io.Folder $cwd The working directory
  * @param  io.collections.FileCollection $version The version
  * @return bool whether the module was active
  */
 protected function remove($cwd, FileCollection $version)
 {
     $versioned = basename($version->getURI());
     $vendor = basename($version->getOrigin()->getURI());
     Console::writeLine('Removing ', $vendor, '/', $versioned, ' -> ', $version);
     // Remove corresponding .pth file
     $pth = new File($cwd, '.' . $vendor . '.' . $versioned . '.pth');
     if ($pth->exists()) {
         $active = true;
         $pth->unlink();
     } else {
         $active = false;
     }
     // Remove folder
     $fld = new Folder($version->getURI());
     $fld->unlink();
     return $active;
 }