diff --git a/Neos.Neos/Classes/Setup/Step/AdministratorStep.php b/Neos.Neos/Classes/Setup/Step/AdministratorStep.php deleted file mode 100644 index b3e280f0d45..00000000000 --- a/Neos.Neos/Classes/Setup/Step/AdministratorStep.php +++ /dev/null @@ -1,106 +0,0 @@ -createPage('page1'); - $page1->setRenderingOption('header', 'Create administrator account'); - - $introduction = $page1->createElement('introduction', 'Neos.Form:StaticText'); - $introduction->setProperty('text', 'Enter the personal data and credentials for your backend account:'); - - $personalSection = $page1->createElement('personalSection', 'Neos.Form:Section'); - $personalSection->setLabel('Personal Data'); - - $firstName = $personalSection->createElement('firstName', 'Neos.Form:SingleLineText'); - $firstName->setLabel('First name'); - $firstName->addValidator(new NotEmptyValidator()); - $firstName->addValidator(new StringLengthValidator(['minimum' => 1, 'maximum' => 255])); - - $lastName = $personalSection->createElement('lastName', 'Neos.Form:SingleLineText'); - $lastName->setLabel('Last name'); - $lastName->addValidator(new NotEmptyValidator()); - $lastName->addValidator(new StringLengthValidator(['minimum' => 1, 'maximum' => 255])); - - $credentialsSection = $page1->createElement('credentialsSection', 'Neos.Form:Section'); - $credentialsSection->setLabel('Credentials'); - - $username = $credentialsSection->createElement('username', 'Neos.Form:SingleLineText'); - $username->setLabel('Username'); - $username->addValidator(new NotEmptyValidator()); - $username->addValidator(new UserDoesNotExistValidator()); - - $password = $credentialsSection->createElement('password', 'Neos.Form:PasswordWithConfirmation'); - $password->addValidator(new NotEmptyValidator()); - $password->addValidator(new StringLengthValidator(['minimum' => 6, 'maximum' => 255])); - $password->setLabel('Password'); - $password->setProperty('passwordDescription', 'At least 6 characters'); - - $formDefinition->setRenderingOption('skipStepNotice', 'If you skip this step make sure that you have an existing user or create one with the user:create command'); - } - - /** - * This method is called when the form of this step has been submitted - * - * @param array $formValues - * @return void - */ - public function postProcessFormValues(array $formValues) - { - $this->userService->createUser($formValues['username'], $formValues['password'], $formValues['firstName'], $formValues['lastName'], ['Neos.Neos:Administrator']); - } -} diff --git a/Neos.Neos/Classes/Setup/Step/FinalStep.php b/Neos.Neos/Classes/Setup/Step/FinalStep.php deleted file mode 100644 index 4d0a94c9143..00000000000 --- a/Neos.Neos/Classes/Setup/Step/FinalStep.php +++ /dev/null @@ -1,81 +0,0 @@ -createPage('page1'); - $page1->setRenderingOption('header', 'Setup complete'); - - $congratulations = $page1->createElement('congratulationsSection', 'Neos.Form:Section'); - $congratulations->setLabel('Congratulations'); - - $success = $congratulations->createElement('success', 'Neos.Form:StaticText'); - $success->setProperty('text', 'You have successfully installed Neos! If you need help getting started, please refer to the Neos documentation.'); - $success->setProperty('elementClassAttribute', 'alert alert-success'); - - $docs = $congratulations->createElement('docsLink', 'Neos.Setup:LinkElement'); - $docs->setLabel('Read the documentation'); - $docs->setProperty('href', 'https://neos.readthedocs.org/'); - $docs->setProperty('target', '_blank'); - - $contextEnv = Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development'; - $applicationContext = new ApplicationContext($contextEnv); - if (!$applicationContext->isProduction()) { - $context = $page1->createElement('contextSection', 'Neos.Form:Section'); - $context->setLabel('Define application context'); - $contextInfo = $context->createElement('contextInfo', 'Neos.Form:StaticText'); - $contextInfo->setProperty('text', 'Your Neos installation is currently not running in "Production" context. If you want to experience Neos with its full speed, you should now change your FLOW_CONTEXT environment variable to "Production".'); - $contextDocs = $context->createElement('contextDocsLink', 'Neos.Setup:LinkElement'); - $contextDocs->setLabel('Read about application contexts'); - $contextDocs->setProperty('href', 'http://flowframework.readthedocs.org/en/stable/TheDefinitiveGuide/PartIII/Bootstrapping.html#the-typo3-flow-application-context'); - $contextDocs->setProperty('target', '_blank'); - } - - $frontend = $page1->createElement('frontendSection', 'Neos.Form:Section'); - $frontend->setLabel('View the site'); - - $link = $frontend->createElement('link', 'Neos.Setup:LinkElement'); - $link->setLabel('Go to the frontend'); - $link->setProperty('href', '/'); - $link->setProperty('elementClassAttribute', 'btn btn-large btn-primary'); - - $backend = $page1->createElement('backendSection', 'Neos.Form:Section'); - $backend->setLabel('Start editing'); - - $backendLink = $backend->createElement('backendLink', 'Neos.Setup:LinkElement'); - $backendLink->setLabel('Go to the backend'); - $backendLink->setProperty('href', '/neos'); - $backendLink->setProperty('elementClassAttribute', 'btn btn-large btn-primary'); - - $loggedOut = $page1->createElement('loggedOut', 'Neos.Form:StaticText'); - $loggedOut->setProperty('text', 'You have automatically been logged out for security reasons since this is the final step. Refresh the page to log in again if you missed something.'); - $loggedOut->setProperty('elementClassAttribute', 'alert alert-info'); - } -} diff --git a/Neos.Neos/Classes/Setup/Step/NeosSpecificRequirementsStep.php b/Neos.Neos/Classes/Setup/Step/NeosSpecificRequirementsStep.php deleted file mode 100644 index 0ff75408aab..00000000000 --- a/Neos.Neos/Classes/Setup/Step/NeosSpecificRequirementsStep.php +++ /dev/null @@ -1,144 +0,0 @@ -createPage('page1'); - $page1->setRenderingOption('header', 'Neos requirements check'); - - $imageSection = $page1->createElement('connectionSection', 'Neos.Form:Section'); - $imageSection->setLabel('Image Manipulation'); - - $formElement = $imageSection->createElement('imageLibrariesInfo', 'Neos.Form:StaticText'); - $formElement->setProperty('text', 'We checked for supported image manipulation libraries on your server. - Only one is needed and we select the best one available for you. - Using GD in production environment is not recommended as it has some issues and can easily lead to blank pages due to memory exhaustion.'); - $formElement->setProperty('elementClassAttribute', 'alert alert-primary'); - - $foundImageHandler = false; - foreach (['gd', 'gmagick', 'imagick'] as $extensionName) { - $formElement = $imageSection->createElement($extensionName, 'Neos.Form:StaticText'); - - if (extension_loaded($extensionName)) { - $unsupportedFormats = $this->findUnsupportedImageFormats($extensionName); - if (count($unsupportedFormats) === 0) { - $formElement->setProperty('text', 'PHP extension "' . $extensionName .'" is installed'); - $formElement->setProperty('elementClassAttribute', 'alert alert-info'); - $foundImageHandler = $extensionName; - } else { - $formElement->setProperty('text', 'PHP extension "' . $extensionName . '" is installed but lacks support for ' . implode(', ', $unsupportedFormats)); - $formElement->setProperty('elementClassAttribute', 'alert alert-default'); - } - } else { - $formElement->setProperty('text', 'PHP extension "' . $extensionName . '" is not installed'); - $formElement->setProperty('elementClassAttribute', 'alert alert-default'); - } - } - - if ($foundImageHandler === false) { - $formElement = $imageSection->createElement('noImageLibrary', 'Neos.Form:StaticText'); - $formElement->setProperty('text', 'No suitable PHP extension for image manipulation was found. Please install one of the required PHP extensions and restart the php process. Then proceed with the setup.'); - $formElement->setProperty('elementClassAttribute', 'alert alert-error'); - } else { - $formElement = $imageSection->createElement('configuredImageLibrary', 'Neos.Form:StaticText'); - $formElement->setProperty('text', 'Neos will be configured to use extension "' . $foundImageHandler . '"'); - $formElement->setProperty('elementClassAttribute', 'alert alert-success'); - $hiddenField = $imageSection->createElement('imagineDriver', 'Neos.Form:HiddenField'); - $hiddenField->setDefaultValue(ucfirst($foundImageHandler)); - } - } - - /** - * @param string $driver - * @return array Not supported image format - */ - protected function findUnsupportedImageFormats($driver) - { - $this->imagineFactory->injectSettings(['driver' => ucfirst($driver)]); - $imagine = $this->imagineFactory->create(); - $unsupportedFormats = []; - - foreach (['jpg', 'gif', 'png'] as $imageFormat) { - $imagePath = Files::concatenatePaths([$this->packageManager->getPackage('Neos.Neos')->getResourcesPath(), 'Private/Installer/TestImages/Test.' . $imageFormat]); - - try { - $imagine->open($imagePath); - } catch (\Exception $exception) { - $unsupportedFormats[] = sprintf('"%s"', $imageFormat); - } - } - - return $unsupportedFormats; - } - - /** - * {@inheritdoc} - */ - public function postProcessFormValues(array $formValues) - { - $this->distributionSettings = Arrays::setValueByPath($this->distributionSettings, 'Neos.Imagine.driver', $formValues['imagineDriver']); - $this->configurationSource->save(FLOW_PATH_CONFIGURATION . ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->distributionSettings); - - $this->configurationManager->refreshConfiguration(); - } -} diff --git a/Neos.Neos/Classes/Setup/Step/SiteImportStep.php b/Neos.Neos/Classes/Setup/Step/SiteImportStep.php deleted file mode 100644 index a107bd187db..00000000000 --- a/Neos.Neos/Classes/Setup/Step/SiteImportStep.php +++ /dev/null @@ -1,263 +0,0 @@ -logger = $logger; - } - - /** - * @param ThrowableStorageInterface $throwableStorage - */ - public function injectThrowableStorage(ThrowableStorageInterface $throwableStorage) - { - $this->throwableStorage = $throwableStorage; - } - - /** - * Returns the form definitions for the step - * - * @param FormDefinition $formDefinition - * @return void - */ - protected function buildForm(FormDefinition $formDefinition) - { - $page1 = $formDefinition->createPage('page1'); - $page1->setRenderingOption('header', 'Create a new site'); - - $introduction = $page1->createElement('introduction', 'Neos.Form:StaticText'); - $introduction->setProperty('text', 'There are two ways of creating a site. Choose between the following:'); - - $importSection = $page1->createElement('import', 'Neos.Form:Section'); - /** @var Section $importSection */ - $importSection->setLabel('Import a site from an existing site package'); - - $sitePackages = []; - foreach ($this->packageManager->getFilteredPackages('available', null, 'neos-site') as $package) { - /** @var PackageInterface $package */ - $sitePackages[$package->getPackageKey()] = $package->getPackageKey(); - } - - if (count($sitePackages) > 0) { - $site = $importSection->createElement('site', 'Neos.Form:SingleSelectDropdown'); - $site->setLabel('Select a site package'); - $site->setProperty('options', $sitePackages); - $site->addValidator(new NotEmptyValidator()); - - $sites = $this->siteRepository->findAll(); - if ($sites->count() > 0) { - $prune = $importSection->createElement('prune', 'Neos.Form:Checkbox'); - $prune->setLabel('Delete existing sites'); - } - } else { - $error = $importSection->createElement('noSitePackagesError', 'Neos.Form:StaticText'); - $error->setProperty('text', 'No site packages were available, make sure you have an active site package'); - $error->setProperty('elementClassAttribute', 'alert alert-warning'); - } - - if ($this->packageManager->isPackageAvailable('Neos.SiteKickstarter')) { - $separator = $page1->createElement('separator', 'Neos.Form:StaticText'); - $separator->setProperty('elementClassAttribute', 'section-separator'); - - $newPackageSection = $page1->createElement('newPackageSection', 'Neos.Form:Section'); - /** @var Section $newPackageSection */ - $newPackageSection->setLabel('Create a new site package with a dummy site'); - $packageName = $newPackageSection->createElement('packageKey', 'Neos.Form:SingleLineText'); - $packageName->setLabel('Package Name (in form "Vendor.DomainCom")'); - $packageName->addValidator(new PackageKeyValidator()); - - $siteName = $newPackageSection->createElement('siteName', 'Neos.Form:SingleLineText'); - $siteName->setLabel('Site Name (e.g. "domain.com")'); - } else { - $error = $importSection->createElement('neosKickstarterUnavailableError', 'Neos.Form:StaticText'); - $error->setProperty('text', 'The Neos Kickstarter package (Neos.SiteKickstarter) is not installed, install it for kickstarting new sites (using "composer require typo3/neos-kickstarter")'); - $error->setProperty('elementClassAttribute', 'alert alert-warning'); - } - - $sitePackageExplanation = $page1->createElement('sitePackageExplanation', 'Neos.Form:StaticText'); - $sitePackageExplanation->setProperty('text', 'Notice the difference between a site package and a site. A site package is a Flow package that can be used for creating multiple site instances.'); - $sitePackageExplanation->setProperty('elementClassAttribute', 'alert alert-info'); - - if (count($sitePackages) > 0) { - $sitePackageAlreadyAvailableExplanation = $page1->createElement('sitePackageAlreadyAvailableExplanation', 'Neos.Form:StaticText'); - $sitePackageAlreadyAvailableExplanation->setProperty('text', sprintf('There are already other site packages available (%s). Some configuration like dimensions and node type configurations are shared between all sites packages. Make sure you remove the site packages you don\'t want to interfere with your newly created package.', implode(array_keys($sitePackages)))); - $sitePackageAlreadyAvailableExplanation->setProperty('elementClassAttribute', 'alert alert-info'); - } - - $step = $this; - $callback = function (FinisherContext $finisherContext) use ($step) { - $step->importSite($finisherContext); - }; - $this->closureFinisher = new ClosureFinisher(); - $this->closureFinisher->setOption('closure', $callback); - $formDefinition->addFinisher($this->closureFinisher); - - $formDefinition->setRenderingOption('skipStepNotice', 'You can always import a site using the site:import command'); - } - - /** - * @param FinisherContext $finisherContext - * @return void - * @throws Exception - */ - public function importSite(FinisherContext $finisherContext) - { - $formValues = $finisherContext->getFormRuntime()->getFormState()->getFormValues(); - - if (isset($formValues['prune']) && intval($formValues['prune']) === 1) { - $this->nodeDataRepository->removeAll(); - $this->workspaceRepository->removeAll(); - $this->domainRepository->removeAll(); - $this->siteRepository->removeAll(); - $this->persistenceManager->persistAll(); - } - - if (!empty($formValues['packageKey'])) { - if ($this->packageManager->isPackageAvailable($formValues['packageKey'])) { - throw new Exception(sprintf('The package key "%s" already exists.', $formValues['packageKey']), 1346759486); - } - $packageKey = $formValues['packageKey']; - $siteName = $formValues['siteName']; - - $generatorService = $this->objectManager->get(GeneratorService::class); - $generatorService->generateSitePackage($packageKey, $siteName); - } elseif (!empty($formValues['site'])) { - $packageKey = $formValues['site']; - } - - if (!empty($packageKey)) { - try { - $this->siteImportService->importFromPackage($packageKey); - } catch (\Exception $exception) { - $finisherContext->cancel(); - $logMessage = $this->throwableStorage->logThrowable($exception); - $this->logger->error($logMessage, LogEnvironment::fromMethodName(__METHOD__)); - throw new SetupException(sprintf('Error: During the import of the "Sites.xml" from the package "%s" an exception occurred: %s', $packageKey, $exception->getMessage()), 1351000864); - } - } - } -} diff --git a/Neos.Neos/Configuration/Settings.yaml b/Neos.Neos/Configuration/Settings.yaml index c4db4de091e..41ae7f9ec8b 100755 --- a/Neos.Neos/Configuration/Settings.yaml +++ b/Neos.Neos/Configuration/Settings.yaml @@ -531,31 +531,6 @@ Neos: Neos.Rendering: Neos\Neos\Fusion\Helper\RenderingHelper Neos.Caching: Neos\Neos\Fusion\Helper\CachingHelper - Setup: - stepOrder: - - neosRequirements - - database - - administrator - - siteimport - - final - steps: - neosRequirements: - className: Neos\Neos\Setup\Step\NeosSpecificRequirementsStep - administrator: - className: Neos\Neos\Setup\Step\AdministratorStep - requiredConditions: - - - className: Neos\Setup\Condition\DatabaseConnectionCondition - siteimport: - className: Neos\Neos\Setup\Step\SiteImportStep - requiredConditions: - - - className: Neos\Setup\Condition\DatabaseConnectionCondition - final: - className: Neos\Neos\Setup\Step\FinalStep - view: - title: 'Neos Setup' - # DocTools is a tool used by Neos Developers to help with a variety of documentation tasks. # These settings are only used in generating Documentation. DocTools: diff --git a/Neos.Neos/composer.json b/Neos.Neos/composer.json index 18eab8ff041..e4706b74d90 100644 --- a/Neos.Neos/composer.json +++ b/Neos.Neos/composer.json @@ -10,7 +10,6 @@ "neos/flow": "*", "neos/media-browser": "*", "neos/party": "*", - "neos/setup": "*", "neos/twitter-bootstrap": "*", "neos/content-repository": "*", "neos/fusion": "*", diff --git a/composer.json b/composer.json index 75989858b7c..2a5cb30eba5 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "doctrine/dbal": "^2.8", "neos/party": "*", "neos/setup": "*", + "neos/neos-setup": "*", "neos/twitter-bootstrap": "*", "neos/form": "*", "neos/kickstarter": "*"