CoreFiles by mySites.guru
CliContextProvider.php32 lines, 810 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
e8e96144d6cf95d4a8c57b1fc470934d
sha1
06998ac3cb63922992dd63a07cee9d1c79f53660
sha256
95e13f65601da217a266e0235d59aab875555185da0c3616c307e09164b35e8a
<?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('xxh128', $commandLine.'@'.$_SERVER['REQUEST_TIME_FLOAT']),
        ];
    }
}

The same content is in 73 releases, Joomla 5.4.0-rc1 to 6.3.0-alpha1. See them all, or every version of this file.