class SiteCommandController extends CommandController (View source)

The Site Command Controller

Properties

protected SiteImportService $siteImportService
protected SiteExportService $siteExportService
protected SiteRepository $siteRepository
protected SiteService $siteService
protected PackageManager $packageManager
protected ContextFactoryInterface $nodeContextFactory
protected NodeTypeManager $nodeTypeManager
protected NodeService $nodeService
protected PersistenceManagerInterface $persistenceManager

Methods

injectLogger(LoggerInterface $logger)

No description

injectThrowableStorage(ThrowableStorageInterface $throwableStorage)

No description

void
createCommand(string $name, string $packageKey, string $nodeType, string $nodeName = null, bool $inactive = false)

Create a new site

void
importCommand(string $packageKey = null, string $filename = null)

Import sites content

void
exportCommand(string $siteNode = null, bool $tidy = true, string $filename = null, string $packageKey = null, string $nodeTypeFilter = null)

Export sites content (e.g. site:export --package-key "Neos.Demo")

void
pruneCommand(string $siteNode)

Remove site with content and related data (with globbing)

void
listCommand()

List available sites

void
activateCommand(string $siteNode)

Activate a site (with globbing)

void
deactivateCommand(string $siteNode)

Deactivate a site (with globbing)

Site[]
findSitesByNodeNamePattern(string $siteNodePattern)

Find all sites the match the given site-node-name-pattern with support for globbing

Details

injectLogger(LoggerInterface $logger)

No description

Parameters

LoggerInterface $logger

injectThrowableStorage(ThrowableStorageInterface $throwableStorage)

No description

Parameters

ThrowableStorageInterface $throwableStorage

void createCommand(string $name, string $packageKey, string $nodeType, string $nodeName = null, bool $inactive = false)

Create a new site

This command allows to create a blank site with just a single empty document in the default dimension. The name of the site, the packageKey must be specified.

The node type given with the nodeType option must already exists and have the superType Neos.Neos:Document.

If no nodeName option is specified the command will create a unique node-name from the name of the site. If a node name is given it has to be unique for the setup.

If the flag activate is set to false new site will not be activated.

Parameters

string $name

The name of the site

string $packageKey

The site package

string $nodeType

The node type to use for the site node, e.g. Amce.Com:Page

string $nodeName

The name of the site node. If no nodeName is given it will be determined from the siteName.

bool $inactive

The new site is not activated immediately (default = false)

Return Value

void

void importCommand(string $packageKey = null, string $filename = null)

Import sites content

This command allows for importing one or more sites or partial content from an XML source. The format must be identical to that produced by the export command.

If a filename is specified, this command expects the corresponding file to contain the XML structure. The filename php://stdin can be used to read from standard input.

If a package key is specified, this command expects a Sites.xml file to be located in the private resources directory of the given package (Resources/Private/Content/Sites.xml).

Parameters

string $packageKey

Package key specifying the package containing the sites content

string $filename

relative path and filename to the XML file containing the sites content

Return Value

void

void exportCommand(string $siteNode = null, bool $tidy = true, string $filename = null, string $packageKey = null, string $nodeTypeFilter = null)

Export sites content (e.g. site:export --package-key "Neos.Demo")

This command exports all or one specific site with all its content into an XML format.

If the package key option is given, the site(s) will be exported to the given package in the default location Resources/Private/Content/Sites.xml.

If the filename option is given, any resources will be exported to files in a folder named "Resources" alongside the XML file.

If neither the filename nor the package key option are given, the XML will be printed to standard output and assets will be embedded into the XML in base64 encoded form.

Parameters

string $siteNode

the node name of the site to be exported; if none given will export all sites

bool $tidy

Whether to export formatted XML. This is defaults to true

string $filename

relative path and filename to the XML file to create. Any resource will be stored in a sub folder "Resources".

string $packageKey

Package to store the XML file in. Any resource will be stored in a sub folder "Resources".

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text")

Return Value

void

void pruneCommand(string $siteNode)

Remove site with content and related data (with globbing)

In the future we need some more sophisticated cleanup.

Parameters

string $siteNode

Name for site root nodes to clear only content of this sites (globbing is supported)

Return Value

void

void listCommand()

List available sites

Return Value

void

void activateCommand(string $siteNode)

Activate a site (with globbing)

This command activates the specified site.

Parameters

string $siteNode

The node name of the sites to activate (globbing is supported)

Return Value

void

void deactivateCommand(string $siteNode)

Deactivate a site (with globbing)

This command deactivates the specified site.

Parameters

string $siteNode

The node name of the sites to deactivate (globbing is supported)

Return Value

void

protected Site[] findSitesByNodeNamePattern(string $siteNodePattern)

Find all sites the match the given site-node-name-pattern with support for globbing

Parameters

string $siteNodePattern

nodeName patterns for sites to find

Return Value

Site[]