コード例 #1
0
 /**
  * Removes a package from registry and deletes it from filesystem
  *
  * @param string $packageKey package to remove
  * @throws \F3\FLOW3\Package\Exception\UnknownPackageException if the specified package is not known
  * @author Thomas Hempel <*****@*****.**>
  * @api
  */
 public function deletePackage($packageKey)
 {
     if ($this->isPackageKeyProtected($packageKey)) {
         throw new \F3\FLOW3\Package\Exception\ProtectedPackageKeyException('The package "' . $packageKey . '" is protected and can not be removed.', 1220722120);
     }
     if (!$this->isPackageAvailable($packageKey)) {
         throw new \F3\FLOW3\Package\Exception\UnknownPackageException('Package "' . $packageKey . '" is not available and can not be removed though.', 1166543253);
     }
     if ($this->isPackageActive($packageKey)) {
         $this->deactivatePackage($packageKey);
     }
     $packagePath = $this->getPackage($packageKey)->getPackagePath();
     \F3\FLOW3\Utility\Files::removeDirectoryRecursively($packagePath);
     unset($this->packages[$packageKey]);
     unset($this->packageKeys[strtolower($packageKey)]);
 }
コード例 #2
0
 /**
  * Clean up after the tests
  *
  * @return void
  * @author Karsten Dambekalns <*****@*****.**>
  */
 public function tearDown()
 {
     if ($this->fixtureDB) {
         \F3\FLOW3\Utility\Files::removeDirectoryRecursively($this->fixtureFolder);
     }
 }