PHP Class Neos\Neos\Command\SiteCommandController

Inheritance: extends Neos\Flow\Cli\CommandController
Show file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$nodeContextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$nodeService Neos\ContentRepository\Domain\Service\NodeService
$nodeTypeManager Neos\ContentRepository\Domain\Service\NodeTypeManager
$packageManager Neos\Flow\Package\PackageManagerInterface
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$siteExportService Neos\Neos\Domain\Service\SiteExportService
$siteImportService Neos\Neos\Domain\Service\SiteImportService
$siteRepository Neos\Neos\Domain\Repository\SiteRepository
$siteService Neos\Neos\Domain\Service\SiteService
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
activateCommand ( string $siteNode ) : void Activate a site
createCommand ( string $name, string $packageKey, string $nodeType = 'Neos.Neos.NodeTypes:Page', string $nodeName = null, boolean $inactive = false ) : void Create a new site
deactivateCommand ( string $siteNode ) : void Deactivate a site
exportCommand ( string $siteNode = null, boolean $tidy = true, string $filename = null, string $packageKey = null, string $nodeTypeFilter = null ) : void Export sites content (e.g. site:export --package-key "Neos.Demo")
importCommand ( string $packageKey = null, string $filename = null ) : void Import sites content
listCommand ( ) : void List available sites
pruneCommand ( string $siteNode = null, string $siteNodeName = null ) : void Remove all content and related data - for now. In the future we need some more sophisticated cleanup.

Method Details

activateCommand() public method

This command activates the specified site.
public activateCommand ( string $siteNode ) : void
$siteNode string The node name of the site to activate
return void

createCommand() public method

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. If no nodeType option is specified the command will use Neos.Neos.NodeTypes:Page as fallback. The node type 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.
public createCommand ( string $name, string $packageKey, string $nodeType = 'Neos.Neos.NodeTypes:Page', string $nodeName = null, boolean $inactive = false ) : void
$name string The name of the site
$packageKey string The site package
$nodeType string The node type to use for the site node. (Default = Neos.Neos.NodeTypes:Page)
$nodeName string The name of the site node. If no nodeName is given it will be determined from the siteName.
$inactive boolean The new site is not activated immediately (default = false).
return void

deactivateCommand() public method

This command deactivates the specified site.
public deactivateCommand ( string $siteNode ) : void
$siteNode string The node name of the site to deactivate
return void

exportCommand() public method

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.
public exportCommand ( string $siteNode = null, boolean $tidy = true, string $filename = null, string $packageKey = null, string $nodeTypeFilter = null ) : void
$siteNode string the node name of the site to be exported; if none given will export all sites
$tidy boolean Whether to export formatted XML. This is defaults to true
$filename string relative path and filename to the XML file to create. Any resource will be stored in a sub folder "Resources".
$packageKey string Package to store the XML file in. Any resource will be stored in a sub folder "Resources".
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text")
return void

importCommand() public method

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).
public importCommand ( string $packageKey = null, string $filename = null ) : void
$packageKey string Package key specifying the package containing the sites content
$filename string relative path and filename to the XML file containing the sites content
return void

listCommand() public method

List available sites
public listCommand ( ) : void
return void

pruneCommand() public method

Remove all content and related data - for now. In the future we need some more sophisticated cleanup.
public pruneCommand ( string $siteNode = null, string $siteNodeName = null ) : void
$siteNode string Name of a site root node to clear only content of this site.
$siteNodeName string This option is deprecated, use --site-node instead
return void

Property Details

$nodeContextFactory protected property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $nodeContextFactory
return Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$nodeService protected property

protected NodeService,Neos\ContentRepository\Domain\Service $nodeService
return Neos\ContentRepository\Domain\Service\NodeService

$nodeTypeManager protected property

protected NodeTypeManager,Neos\ContentRepository\Domain\Service $nodeTypeManager
return Neos\ContentRepository\Domain\Service\NodeTypeManager

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$persistenceManager protected property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$siteExportService protected property

protected SiteExportService,Neos\Neos\Domain\Service $siteExportService
return Neos\Neos\Domain\Service\SiteExportService

$siteImportService protected property

protected SiteImportService,Neos\Neos\Domain\Service $siteImportService
return Neos\Neos\Domain\Service\SiteImportService

$siteRepository protected property

protected SiteRepository,Neos\Neos\Domain\Repository $siteRepository
return Neos\Neos\Domain\Repository\SiteRepository

$siteService protected property

protected SiteService,Neos\Neos\Domain\Service $siteService
return Neos\Neos\Domain\Service\SiteService

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface