public function freezeCommand(string $packageKey = 'all')
    {
        if (!$this->bootstrap->getContext()->isDevelopment()) {
            $this->outputLine('Package freezing is only supported in Development context.');
            $this->quit(3);
        }

        $packagesToFreeze = [];

        if ($packageKey === 'all') {
            foreach (array_keys($this->packageManager->getAvailablePackages()) as $packageKey) {
                if (!$this->packageManager->isPackageFrozen($packageKey)) {
                    $packagesToFreeze[] = $packageKey;
                }
            }
            if ($packagesToFreeze === []) {
                $this->outputLine('Nothing to do, all packages were already frozen.');
                $this->quit(0);
            }
        } elseif ($packageKey === 'blackberry') {
            $this->outputLine('http://bit.ly/freeze-blackberry');
            $this->quit(42);
        } else {
            if (!$this->packageManager->isPackageAvailable($packageKey)) {
                $this->outputLine('Package "%s" is not available.', [$packageKey]);
                $this->quit(2);
            }

            if ($this->packageManager->isPackageFrozen($packageKey)) {
                $this->outputLine('Package "%s" was already frozen.', [$packageKey]);
                $this->quit(0);
            }

            $packagesToFreeze = [$packageKey];
        }

        foreach ($packagesToFreeze as $packageKey) {
            $this->packageManager->freezePackage($packageKey);
            $this->outputLine('Froze package "%s".', [$packageKey]);
        }
    }
public function freezeCommand(string $packageKey = 'all')
    {
        if (!$this->bootstrap->getContext()->isDevelopment()) {
            $this->outputLine('Package freezing is only supported in Development context.');
            $this->quit(3);
        }

        $packagesToFreeze = [];

        if ($packageKey === 'all') {
            foreach (array_keys($this->packageManager->getAvailablePackages()) as $packageKey) {
                if (!$this->packageManager->isPackageFrozen($packageKey)) {
                    $packagesToFreeze[] = $packageKey;
                }
            }
            if ($packagesToFreeze === []) {
                $this->outputLine('Nothing to do, all packages were already frozen.');
                $this->quit(0);
            }
        } elseif ($packageKey === 'blackberry') {
            $this->outputLine('http://bit.ly/freeze-blackberry');
            $this->quit(42);
        } else {
            if (!$this->packageManager->isPackageAvailable($packageKey)) {
                $this->outputLine('Package "%s" is not available.', [$packageKey]);
                $this->quit(2);
            }

            if ($this->packageManager->isPackageFrozen($packageKey)) {
                $this->outputLine('Package "%s" was already frozen.', [$packageKey]);
                $this->quit(0);
            }

            $packagesToFreeze = [$packageKey];
        }

        foreach ($packagesToFreeze as $packageKey) {
            $this->packageManager->freezePackage($packageKey);
            $this->outputLine('Froze package "%s".', [$packageKey]);
        }
    }
public function freezeCommand ( string $ packageKey = 'all' ) { if ( ! $ this -> bootstrap -> getContext ( ) -> isDevelopment ( ) ) { $ this -> outputLine ( 'Package freezing is only supported in Development context.' ) ; $ this -> quit ( 3 ) ; } $ packagesToFreeze = [ ] ; if ( $ packageKey === 'all' ) { foreach ( array_keys ( $ this -> packageManager -> getAvailablePackages ( ) ) as $ packageKey ) { if ( ! $ this -> packageManager -> isPackageFrozen ( $ packageKey ) ) { $ packagesToFreeze [ ] = $ packageKey ; } } if ( $ packagesToFreeze === [ ] ) { $ this -> outputLine ( 'Nothing to do, all packages were already frozen.' ) ; $ this -> quit ( 0 ) ; } } elseif ( $ packageKey === 'blackberry' ) { $ this -> outputLine ( 'http://bit.ly/freeze-blackberry' ) ; $ this -> quit ( 42 ) ; } else { if ( ! $ this -> packageManager -> isPackageAvailable ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" is not available.' , [ $ packageKey ] ) ; $ this -> quit ( 2 ) ; } if ( $ this -> packageManager -> isPackageFrozen ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" was already frozen.' , [ $ packageKey ] ) ; $ this -> quit ( 0 ) ; } $ packagesToFreeze = [ $ packageKey ] ; } foreach ( $ packagesToFreeze as $ packageKey ) { $ this -> packageManager -> freezePackage ( $ packageKey ) ; $ this -> outputLine ( 'Froze package "%s".' , [ $ packageKey ] ) ; } }
Freeze a package

This function marks a package as <b>frozen</b> in order to improve performance
in a development context. While a package is frozen, any modification of files
within that package won't be tracked and can lead to unexpected behavior.

File monitoring won't consider the given package. Further more, reflection
data for classes contained in the package is cached persistently and loaded
directly on the first request after caches have been flushed. The precompiled
reflection data is stored in the <b>Configuration</b> directory of the
respective package.

By specifying <b>all</b> as a package key, all currently frozen packages are
frozen (the default).

@param string $packageKey Key of the package to freeze
@return void
@see neos.flow:package:unfreeze
@see neos.flow:package:refreeze
Freeze a package