Neos\Flow\Package\PackageManager::isPackageActive PHP Метод

isPackageActive() публичный Метод

Returns TRUE if a package is activated or FALSE if it's not.
public isPackageActive ( string $packageKey ) : boolean
$packageKey string The key of the package to check
Результат boolean TRUE if package is active, otherwise FALSE
    public function isPackageActive($packageKey)
    {
        return isset($this->activePackages[$packageKey]);
    }

Usage Example

 /**
  * @test
  */
 public function deletePackageRemovesPackageFromAvailableAndActivePackagesAndDeletesThePackageDirectory()
 {
     $package = $this->packageManager->createPackage('Acme.YetAnotherTestPackage');
     $packagePath = $package->getPackagePath();
     $this->assertTrue(is_dir($packagePath . PackageInterface::DIRECTORY_CONFIGURATION), 'The package configuration directory does not exist.');
     $this->assertTrue($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'), 'The package is not active.');
     $this->assertTrue($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'), 'The package is not available.');
     $this->packageManager->deletePackage('Acme.YetAnotherTestPackage');
     $this->assertFalse(is_dir($packagePath . PackageInterface::DIRECTORY_CONFIGURATION), 'The package configuration directory does still exist.');
     $this->assertFalse($this->packageManager->isPackageActive('Acme.YetAnotherTestPackage'), 'The package is still active.');
     $this->assertFalse($this->packageManager->isPackageAvailable('Acme.YetAnotherTestPackage'), 'The package is still available.');
 }