TYPO3\Surf\Application\Neos\Flow

class Flow

A Neos Flow application template

constant DEFAULT_SHARED_DIR

default directory name for shared directory

property context

protected string

The production context

property version

protected string

The Neos Flow major and minor version of this application

protected array

Symlinks, which should be created for each release.

property directories

protected array

Directories which should be created on deployment. E.g. shared folders.

property options

protected array

Basic application specific options

packageMethod: How to prepare the application assets (code and files) locally before transfer

“git” Make a local git checkout and transfer files to the server none Default, do not prepare anything locally

transferMethod: How to transfer the application assets to a node

“git” Make a checkout of the application assets remotely on the node

updateMethod: How to prepare and update the application assets on the node after transfer

lockDeployment: Locked deployments can only run once at a time

property name

protected string

The name

property nodes

protected array

The nodes for this application

property deploymentPath

protected string

The deployment path for this application on a node

property releasesDirectory

protected string

The relative releases directory for this application on a node

__construct($name = 'Neos Flow')

Constructor

Parameters:
  • $name (string) –
registerTasks(Workflow $workflow, Deployment $deployment)

Register tasks for this application

Parameters:
registerTasksForUpdateMethod(Workflow $workflow, $updateMethod)

Add support for updateMethod “composer”

Parameters:
  • $workflow (Workflow) –
  • $updateMethod (string) –
setContext($context)

Set the application production context

Parameters:
  • $context (string) –
Returns:

Flow

getContext()

Get the application production context

Returns:string
setVersion($version)
Parameters:
  • $version (string) –
getVersion()
Returns:string
getBuildEssentialsDirectoryName()

Get the directory name for build essentials (e.g. to run unit tests)

The value depends on the Flow version of the application.

Returns:string
getFlowScriptName()

Get the name of the Flow script (flow or flow3)

The value depends on the Flow version of the application.

Returns:string
getCommandPackageKey($command = '')

Get the package key to prefix the command

Parameters:
  • $command (string) –
Returns:

string

buildCommand($targetPath, $command, $arguments = [], $phpBinaryPathAndFilename = 'php')

Returns a executable flow command including the context

Parameters:
  • $targetPath (string) – the path where the command should be executed
  • $command (string) – the actual command for example cache:flush
  • $arguments (array) – list of arguments which will be appended to the command
  • $phpBinaryPathAndFilename (string) – the path to the php binary
Returns:

string

Override all symlinks to be created with the given array of symlinks.

Parameters:
  • $symlinks (array) –
Returns:

TYPO3SurfApplicationBaseApplication

Get all symlinks to be created for the application

Returns:array

Register an additional symlink to be created for the application

Parameters:
  • $linkPath (string) – The link to create
  • $sourcePath (string) – The file/directory where the link should point to
Returns:

TYPO3SurfApplicationBaseApplication

Register an array of additional symlinks to be created for the application

Parameters:
  • $symlinks (array) –
Returns:

TYPO3SurfApplicationBaseApplication

setDirectories($directories)

Override all directories to be created for the application

Parameters:
  • $directories (array) –
Returns:

TYPO3SurfApplicationBaseApplication

getDirectories()

Get directories to be created for the application

Returns:array
addDirectory($path)

Register an additional directory to be created for the application

Parameters:
  • $path (string) –
Returns:

TYPO3SurfApplicationBaseApplication

addDirectories($directories)

Register an array of additional directories to be created for the application

Parameters:
  • $directories (array) –
Returns:

TYPO3SurfApplicationBaseApplication

registerTasksForPackageMethod(Workflow $workflow, $packageMethod)
Parameters:
  • $workflow (Workflow) –
  • $packageMethod (string) –
registerTasksForTransferMethod(Workflow $workflow, $transferMethod)
Parameters:
  • $workflow (Workflow) –
  • $transferMethod (string) –
getName()

Get the application name

Returns:string
setName($name)

Sets the application name

Parameters:
  • $name (string) –
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

getNodes()

Get the nodes where this application should be deployed

Returns:Node[] The application nodes
setNodes($nodes)

Set the nodes where this application should be deployed

Parameters:
  • $nodes (array) – The application nodes
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

addNode(Node $node)

Add a node where this application should be deployed

Parameters:
  • $node (Node) – The node to add
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

hasNode(Node $node)

Return TRUE if the given node is registered for this application

Parameters:
  • $node (Node) – The node to test
Returns:

bool TRUE if the node is registered for this application

getDeploymentPath()

Get the deployment path for this application

This is the path for an application pointing to the root of the Surf deployment:

[deploymentPath] |– $this->getReleasesDirectory() |– cache |– shared

Returns:string The deployment path
getSharedPath()

Get the path for shared resources for this application

This path defaults to a directory “shared” below the deployment path.

Returns:string The shared resources path
getSharedDirectory()

Returns the shared directory

takes directory name from option “sharedDirectory” if option is not set or empty constant DEFAULT_SHARED_DIR “shared” is used

Returns:string
setDeploymentPath($deploymentPath)

Sets the deployment path

Parameters:
  • $deploymentPath (string) – The deployment path
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

getReleasesDirectory()

Returns the releases directory

Returns:string $releasesDirectory
setReleasesDirectory($releasesDirectory)

Sets the releases directory

Parameters:
  • $releasesDirectory (string) –
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

getReleasesPath()

Returns path to the directory with releases

Returns:string Path to the releases directory
getOptions()

Get all options defined on this application instance

The options will include the deploymentPath and sharedPath for unified option handling.

Returns:array An array of options indexed by option key
getOption($key)

Get an option defined on this application instance

Parameters:
  • $key (string) –
Returns:

mixed

hasOption($key)

Test if an option was set for this application

Parameters:
  • $key (string) – The option key
Returns:

bool TRUE If the option was set

setOptions($options)

Sets all options for this application instance

Parameters:
  • $options (array) – The options to set indexed by option key
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining

setOption($key, $value)

Set an option for this application instance

Parameters:
  • $key (string) – The option key
  • $value (mixed) – The option value
Returns:

TYPO3SurfDomainModelApplication The current instance for chaining