Skip to content

Commit

Permalink
TASK: Adjust to use site:importall
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Dec 13, 2024
1 parent fcb1fe0 commit 76e6a05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
29 changes: 10 additions & 19 deletions Classes/Infrastructure/Healthcheck/SiteHealthcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,19 @@ public function execute(HealthcheckEnvironment $environment): Health
}

if (!$environment->isSafeToLeakTechnicalDetails()) {
// TODO adjust to 9.0
return new Health('No Neos site was created. Please visit the documentation how setup a site.', Status::WARNING());
return new Health('No Neos site was created. Please look into <code>{{flowCommand}} site:importall</code> or <code>{{flowCommand}} site:create</code>.', Status::WARNING());
}

$availableSitePackagesToBeImported = [];
foreach ($this->packageManager->getFilteredPackages('available', 'neos-site') as $sitePackage) {
$possibleSiteContentToImport = sprintf('resource://%s/Private/Content/events.jsonl', $sitePackage->getPackageKey());
$possibleSiteContentToImport = sprintf('resource://%s/Private/Content', $sitePackage->getPackageKey());
if (file_exists($possibleSiteContentToImport)) {
$availableSitePackagesToBeImported[] = $sitePackage->getPackageKey();
}
}

if (count($availableSitePackagesToBeImported) === 0) {
if (!$this->packageManager->isPackageAvailable('Neos.SiteKickstarter')) {
// TODO adjust to 9.0
return new Health(<<<MSG
No Neos site was created. You might want to install the site kickstarter: <code>composer require neos/site-kickstarter</code>.
Or you can create a new site package completely from scratch via <code>{{flowCommand}} package:create My.Site --package-type=neos-site</code>.
Expand All @@ -66,24 +64,17 @@ public function execute(HealthcheckEnvironment $environment): Health
MSG, Status::WARNING());
}

// TODO adjust to 9.0
return new Health(<<<MSG
No Neos site was created. You can kickstart a new site package via <code>{{flowCommand}} kickstart:site My.Site my-site</code>
and import it via <code>{{flowCommand}} site:import --package-key My.Site</code>
No Neos site was created. You can kickstart a new site package via <code>{{flowCommand}} kickstart:site My.Site</code>
and use it to create a site via <code>{{flowCommand}} site:create my-site My.Site My.Site:Document.Homepage</code>
MSG, Status::WARNING());
}

if (count($availableSitePackagesToBeImported) === 1 && $availableSitePackagesToBeImported[0] === 'Neos.Demo') {
// TODO adjust to 9.0 (make less specific to neos demo)
return new Health(<<<MSG
No Neos site was created. To import the site from Neos.Demo you can run <code>{{flowCommand}} site:create neosdemo Neos.Demo Neos.Demo:Document.Homepage</code> and <code>{{flowCommand}} cr:prune</code> and <code>{{flowCommand}} cr:import resource://Neos.Demo/Private/Content</code>
MSG, Status::WARNING());
}

// TODO adjust to 9.0
$availableSitePackages = join(', ', $availableSitePackagesToBeImported);
return new Health(<<<MSG
No Neos site was created. To import from one of the available site packages ($availableSitePackages) follow the steps from the documentation.
MSG, Status::WARNING());
$firstAvailableSitePackageKey = array_shift($availableSitePackagesToBeImported);
return new Health(sprintf(
'No Neos site was created. To import the site from %1$s you can run <code>{{flowCommand}} site:importall --package-key %1$s</code>.%2$s',
$firstAvailableSitePackageKey,
$availableSitePackagesToBeImported === [] ? '' : sprintf(' Or import one of the other available site packages: %s', join(', ', $availableSitePackagesToBeImported))
), Status::WARNING());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ImageHandlerService
public function __construct()
{
//
// FIXME: It seems there is this hack and in the image factory there is a hack too now (: https://github.com/neos/imagine/pull/11
// Hack. We instantiate the unproxied class without injected settings.
// This is to allow to still reconfigure the image driver, even if it is disabled.
// The "driver" Gd for Imagine must be enabled by settings, check Neos.Imagine.enabledDrivers. Or use ./flow setup:imagehandler
Expand Down

0 comments on commit 76e6a05

Please sign in to comment.