CoreFiles by mySites.guru
CliContextProvider.php32 lines, 806 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
de5f1c3dddc8312b9be0f388177e97fc
sha1
6196d28a2b403ac75157495bd620daa6c54c6217
sha256
61dbbcae038a04fb690cd351e10112250bd5ac3c632f1cdaff2a3d4f46ffa3d9
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Dumper\ContextProvider;

/**
 * Tries to provide context on CLI.
 *
 * @author Maxime Steinhausser <[email protected]>
 */
final class CliContextProvider implements ContextProviderInterface
{
    public function getContext(): ?array
    {
        if ('cli' !== \PHP_SAPI) {
            return null;
        }

        return [
            'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []),
            'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']),
        ];
    }
}

The same content is in 216 releases, Joomla 4.0.0-beta to 6.0.0-alpha3. See them all, or every version of this file.