Neos\Flow\Package\PackageManagerInterface::isPackageKeyValid PHP Метод

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

Check the conformance of the given package key
public isPackageKeyValid ( string $packageKey )
$packageKey string The package key to validate
    public function isPackageKeyValid($packageKey);

Usage Example

 /**
  * Kickstart a new site package
  *
  * This command generates a new site package with basic TypoScript and Sites.xml
  *
  * @param string $packageKey The packageKey for your site
  * @param string $siteName The siteName of your site
  * @return string
  */
 public function siteCommand($packageKey, $siteName)
 {
     if (!$this->packageManager->isPackageKeyValid($packageKey)) {
         $this->outputLine('Package key "%s" is not valid. Only UpperCamelCase in the format "Vendor.PackageKey", please!', array($packageKey));
         $this->quit(1);
     }
     if ($this->packageManager->isPackageAvailable($packageKey)) {
         $this->outputLine('Package "%s" already exists.', array($packageKey));
         $this->quit(1);
     }
     $generatedFiles = $this->generatorService->generateSitePackage($packageKey, $siteName);
     $this->outputLine(implode(PHP_EOL, $generatedFiles));
 }
All Usage Examples Of Neos\Flow\Package\PackageManagerInterface::isPackageKeyValid