class Scripts (View source)

Initialization scripts for modules of the Flow package

Properties

static protected string $builtPhpCommand

Methods

static void
initializeClassLoader(Bootstrap $bootstrap)

Initializes the Class Loader

static void
registerClassLoaderInAnnotationRegistry(Bootstrap $bootstrap)

Register the class loader into the Doctrine AnnotationRegistry so the DocParser is able to load annation classes from packages.

static void
initializeClassLoaderClassesCache(Bootstrap $bootstrap)

Injects the classes cache to the already initialized class loader

static void
forceFlushCachesIfNecessary(Bootstrap $bootstrap)

Does some emergency, forced, low level flush caches if the user told to do so through the command line.

static void
initializeSignalSlot(Bootstrap $bootstrap)

Initializes the Signal Slot module

static void
initializePackageManagement(Bootstrap $bootstrap)

Initializes the package system and loads the package configuration and settings provided by the packages.

static void
initializeConfiguration(Bootstrap $bootstrap, bool $enableCache = true)

Initializes the Configuration Manager, the Flow settings and the Environment service

static void
initializeSystemLogger(Bootstrap $bootstrap)

Initializes the System Logger

initializeExceptionStorage(Bootstrap $bootstrap, array $settings)

Initialize the exception storage

static void
initializeErrorHandling(Bootstrap $bootstrap)

Initializes the error handling

static void
initializeCacheManagement(Bootstrap $bootstrap)

Initializes the cache framework

static void
initializeProxyClasses(Bootstrap $bootstrap)

Runs the compile step if necessary

static void
recompileClasses(Bootstrap $bootstrap)

Recompile classes after file monitoring was executed and class files have been changed.

static 
initializeObjectManagerCompileTimeCreate(Bootstrap $bootstrap)

Initializes the Compiletime Object Manager (phase 1)

static void
initializeObjectManagerCompileTimeFinalize(Bootstrap $bootstrap)

Initializes the Compiletime Object Manager (phase 2)

static void
initializeObjectManager(Bootstrap $bootstrap)

Initializes the runtime Object Manager

static void
initializeReflectionServiceFactory(Bootstrap $bootstrap)

Initializes the Reflection Service Factory

static 
initializeReflectionService(Bootstrap $bootstrap)

Initializes the Reflection Service

static void
initializeSystemFileMonitor(Bootstrap $bootstrap)

Checks if classes (i.e. php files containing classes), Policy.yaml, Objects.yaml or localization files have been altered and if so flushes the related caches.

static array
static void
monitorDirectoryIfItExists(FileMonitor $fileMonitor, string $path, string $filenamePattern = null)

Let the given file monitor track changes of the specified directory if it exists.

static void
compileDoctrineProxies(Bootstrap $bootstrap)

Update Doctrine 2 proxy classes

static void
initializeResources(Bootstrap $bootstrap)

Initialize the stream wrappers.

static bool
executeCommand(string $commandIdentifier, array $settings, bool $outputResults = true, array $commandArguments = [])

Executes the given command as a sub-request to the Flow CLI system.

static void
executeCommandAsync(string $commandIdentifier, array $settings, array $commandArguments = [])

Executes the given command as a sub-request to the Flow CLI system without waiting for the output.

static string
buildSubprocessCommand(string $commandIdentifier, array $settings, array $commandArguments = [])

No description

static string
buildPhpCommand(array $settings)

No description

static 
ensureCLISubrequestsUseCurrentlyRunningPhpBinary(string $phpBinaryPathAndFilename)

Compares the realpath of the configured PHP binary (if any) with the one flow was called with in a CLI request.

static 
ensureWebSubrequestsUseCurrentlyRunningPhpVersion(string $phpCommand)

Compares the actual version of the configured PHP binary (if any) with the one flow was called with in a non-CLI request.

static bool
useClassLoader(Bootstrap $bootstrap)

Check if the old fallback classloader should be used.

Details

static void initializeClassLoader(Bootstrap $bootstrap)

Initializes the Class Loader

Parameters

Bootstrap $bootstrap

Return Value

void

static void registerClassLoaderInAnnotationRegistry(Bootstrap $bootstrap)

Register the class loader into the Doctrine AnnotationRegistry so the DocParser is able to load annation classes from packages.

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeClassLoaderClassesCache(Bootstrap $bootstrap)

Injects the classes cache to the already initialized class loader

Parameters

Bootstrap $bootstrap

Return Value

void

static void forceFlushCachesIfNecessary(Bootstrap $bootstrap)

Does some emergency, forced, low level flush caches if the user told to do so through the command line.

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeSignalSlot(Bootstrap $bootstrap)

Initializes the Signal Slot module

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializePackageManagement(Bootstrap $bootstrap)

Initializes the package system and loads the package configuration and settings provided by the packages.

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeConfiguration(Bootstrap $bootstrap, bool $enableCache = true)

Initializes the Configuration Manager, the Flow settings and the Environment service

Parameters

Bootstrap $bootstrap
bool $enableCache

Return Value

void

Exceptions

Exception

static void initializeSystemLogger(Bootstrap $bootstrap)

Initializes the System Logger

Parameters

Bootstrap $bootstrap

Return Value

void

Exceptions

Exception
InvalidConfigurationTypeException

static protected ThrowableStorageInterface initializeExceptionStorage(Bootstrap $bootstrap, array $settings)

Initialize the exception storage

Parameters

Bootstrap $bootstrap
array $settings

The Neos.Flow settings

Return Value

ThrowableStorageInterface

Exceptions

Exception
InvalidConfigurationTypeException

static void initializeErrorHandling(Bootstrap $bootstrap)

Initializes the error handling

Parameters

Bootstrap $bootstrap

Return Value

void

Exceptions

Exception
InvalidConfigurationTypeException

static void initializeCacheManagement(Bootstrap $bootstrap)

Initializes the cache framework

Parameters

Bootstrap $bootstrap

Return Value

void

Exceptions

Exception
InvalidConfigurationTypeException

static void initializeProxyClasses(Bootstrap $bootstrap)

Runs the compile step if necessary

Parameters

Bootstrap $bootstrap

Return Value

void

Exceptions

Exception

static void recompileClasses(Bootstrap $bootstrap)

Recompile classes after file monitoring was executed and class files have been changed.

Parameters

Bootstrap $bootstrap

Return Value

void

Exceptions

Exception

static initializeObjectManagerCompileTimeCreate(Bootstrap $bootstrap)

Initializes the Compiletime Object Manager (phase 1)

Parameters

Bootstrap $bootstrap

static void initializeObjectManagerCompileTimeFinalize(Bootstrap $bootstrap)

Initializes the Compiletime Object Manager (phase 2)

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeObjectManager(Bootstrap $bootstrap)

Initializes the runtime Object Manager

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeReflectionServiceFactory(Bootstrap $bootstrap)

Initializes the Reflection Service Factory

Parameters

Bootstrap $bootstrap

Return Value

void

static initializeReflectionService(Bootstrap $bootstrap)

Initializes the Reflection Service

Parameters

Bootstrap $bootstrap

Exceptions

Exception

static void initializeSystemFileMonitor(Bootstrap $bootstrap)

Checks if classes (i.e. php files containing classes), Policy.yaml, Objects.yaml or localization files have been altered and if so flushes the related caches.

This function only triggers the detection of changes in the file monitors. The actual cache flushing is handled by other functions which are triggered by the file monitor through a signal. For Flow, those signal-slot connections are defined in the class \Neos\Flow\Package.

Parameters

Bootstrap $bootstrap

Return Value

void

static protected array getListOfPackagesWithConfiguredObjects(Bootstrap $bootstrap)

No description

Parameters

Bootstrap $bootstrap

Return Value

array

static protected void monitorDirectoryIfItExists(FileMonitor $fileMonitor, string $path, string $filenamePattern = null)

Let the given file monitor track changes of the specified directory if it exists.

Parameters

FileMonitor $fileMonitor
string $path
string $filenamePattern

Optional pattern for filenames to consider for file monitoring (regular expression). FileMonitor::monitorDirectory()

Return Value

void

static protected void compileDoctrineProxies(Bootstrap $bootstrap)

Update Doctrine 2 proxy classes

This is not simply bound to the finishedCompilationRun signal because it needs the advised proxy classes to run. When that signal is fired, they have been written, but not loaded.

Parameters

Bootstrap $bootstrap

Return Value

void

static void initializeResources(Bootstrap $bootstrap)

Initialize the stream wrappers.

Parameters

Bootstrap $bootstrap

Return Value

void

static bool executeCommand(string $commandIdentifier, array $settings, bool $outputResults = true, array $commandArguments = [])

Executes the given command as a sub-request to the Flow CLI system.

Parameters

string $commandIdentifier

E.g. neos.flow:cache:flush

array $settings

The Neos.Flow settings

bool $outputResults

Echo the commands output on success

array $commandArguments

Command arguments

Return Value

bool

Legacy return value. Will always be true. A failure is expressed as a thrown exception

Exceptions

SubProcessException

static void executeCommandAsync(string $commandIdentifier, array $settings, array $commandArguments = [])

Executes the given command as a sub-request to the Flow CLI system without waiting for the output.

Note: As the command execution is done in a separate thread potential exceptions or failures will not be reported

Parameters

string $commandIdentifier

E.g. neos.flow:cache:flush

array $settings

The Neos.Flow settings

array $commandArguments

Command arguments

Return Value

void

static protected string buildSubprocessCommand(string $commandIdentifier, array $settings, array $commandArguments = [])

No description

Parameters

string $commandIdentifier

E.g. neos.flow:cache:flush

array $settings

The Neos.Flow settings

array $commandArguments

Command arguments

Return Value

string

A command line command ready for being exec()uted

static string buildPhpCommand(array $settings)

No description

Parameters

array $settings

The Neos.Flow settings

Return Value

string

A command line command for PHP, which can be extended and then exec()uted

Exceptions

SubProcessException

static protected ensureCLISubrequestsUseCurrentlyRunningPhpBinary(string $phpBinaryPathAndFilename)

Compares the realpath of the configured PHP binary (if any) with the one flow was called with in a CLI request.

This avoids config errors where users forget to set Neos.Flow.core.phpBinaryPathAndFilename in CLI.

Parameters

string $phpBinaryPathAndFilename

Exceptions

SubProcessException

static protected ensureWebSubrequestsUseCurrentlyRunningPhpVersion(string $phpCommand)

Compares the actual version of the configured PHP binary (if any) with the one flow was called with in a non-CLI request.

This avoids config errors where users forget to set Neos.Flow.core.phpBinaryPathAndFilename in connection with a web server.

Parameters

string $phpCommand

the completely build php string that is used to execute subrequests

Exceptions

SubProcessException

static protected bool useClassLoader(Bootstrap $bootstrap)

Check if the old fallback classloader should be used.

The old class loader is used only in a testing context.

Parameters

Bootstrap $bootstrap

Return Value

bool