Skip to content

Commit

Permalink
!!! TASK: Remove siteName from site package kickstarter
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaeslich committed Jun 14, 2024
1 parent 316a62b commit 331761d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ class KickstartCommandController extends CommandController
* This command generates a new site package with basic Fusion
*
* @param string $packageKey The packageKey for your site
* @param string $siteName The siteName of your site
*/
public function siteCommand($packageKey, $siteName): void
public function siteCommand($packageKey): void
{
if (!$this->packageManager->isPackageKeyValid($packageKey)) {
$this->outputLine('Package key "%s" is not valid. Only UpperCamelCase in the format "Vendor.PackageKey", please!', [$packageKey]);
Expand Down Expand Up @@ -83,7 +82,7 @@ public function siteCommand($packageKey, $siteName): void

$generatorService = $this->objectManager->get($generatorClass);

$generatedFiles = $generatorService->generateSitePackage($packageKey, $siteName);
$generatedFiles = $generatorService->generateSitePackage($packageKey);
$this->outputLine(implode(PHP_EOL, $generatedFiles));
}
}
19 changes: 6 additions & 13 deletions Neos.SiteKickstarter/Classes/Generator/AfxTemplateGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class AfxTemplateGenerator extends GeneratorService implements SitePackageGenera
* Generate a site package and fill it with boilerplate data.
*
* @param string $packageKey
* @param string $siteName
* @return list<string>
* @throws \Neos\Flow\Composer\Exception\InvalidConfigurationException
* @throws \Neos\Flow\Package\Exception
Expand All @@ -54,7 +53,7 @@ class AfxTemplateGenerator extends GeneratorService implements SitePackageGenera
* @throws \Neos\FluidAdaptor\Core\Exception
* @throws \Neos\Utility\Exception\FilesException
*/
public function generateSitePackage(string $packageKey, string $siteName) : array
public function generateSitePackage(string $packageKey) : array
{
$package = $this->packageManager->createPackage($packageKey, [
'type' => 'neos-site',
Expand All @@ -67,7 +66,7 @@ public function generateSitePackage(string $packageKey, string $siteName) : arra
throw new \RuntimeException('Expected to generate flow site package for "' . $packageKey . '" but got ' . get_class($package));
}

$this->generateSitesFusionDirectory($package, $siteName);
$this->generateSitesFusionDirectory($package);
$this->generateNodeTypesConfiguration($package);
$this->generateAdditionalFolders($package);

Expand All @@ -77,17 +76,11 @@ public function generateSitePackage(string $packageKey, string $siteName) : arra
/**
* Render the whole directory of the fusion part
*/
protected function generateSitesFusionDirectory(FlowPackageInterface $package, string $siteName) : void
protected function generateSitesFusionDirectory(FlowPackageInterface $package) : void
{
$packageKey = $package->getPackageKey();
$contextVariables = [];
$contextVariables['packageKey'] = $packageKey;
$contextVariables['siteName'] = $siteName;
$packageKeyDomainPart = $packageKey;
if ($lastPackagePartWithDot = strrchr($packageKey, '.')) {
$packageKeyDomainPart = substr($lastPackagePartWithDot, 1) ?: $packageKey;
}
$contextVariables['siteNodeName'] = $packageKeyDomainPart;
$contextVariables = [
'packageKey' => $package->getPackageKey(),
];

$fusionRecursiveDirectoryRenderer = new FusionRecursiveDirectoryRenderer();
$fusionRecursiveDirectoryRenderer->renderDirectory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ interface SitePackageGeneratorInterface
* returns generated files as an array
*
* @param string $packageKey
* @param string $siteName
* @return list<string>
*/
public function generateSitePackage(string $packageKey, string $siteName): array;
public function generateSitePackage(string $packageKey): array;

/**
* returns the human readable name of the generator
* returns the human-readable name of the generator
*
* @return string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class BlankSitePackageGenerator implements SitePackageGeneratorInterface
{
public function generateSitePackage(string $packageKey, string $siteName): array
public function generateSitePackage(string $packageKey): array
{
// just a dummy
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class NamedSitePackageGenerator implements SitePackageGeneratorInterface
{
public function generateSitePackage(string $packageKey, string $siteName): array
public function generateSitePackage(string $packageKey): array
{
// just a dummy
}
Expand Down

0 comments on commit 331761d

Please sign in to comment.