CoreFiles by mySites.guru
PhpHttpDriver.php70 lines, 1,250 bytes, from Joomla_5.2.3-Stable-Full_Package.zip
Raw History Compare with 5.2.2
md5
618c661ace3e69a64143877a527743aa
sha1
17b8ffb19283f3f74522930eaefaacc51efc97ce
sha256
03b7a24959e4f3525735856a6230c48e1b178d96e7d10cc9eeabfc8c14681aae
<?php
/*
 * This file is part of the DebugBar package.
 *
 * (c) 2013 Maxime Bouroumeau-Fuseau
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace DebugBar;

/**
 * HTTP driver for native php
 */
class PhpHttpDriver implements HttpDriverInterface
{
    /**
     * @param array $headers
     */
    function setHeaders(array $headers)
    {
        foreach ($headers as $name => $value) {
            header("$name: $value");
        }
    }

    /**
     * @return bool
     */
    function isSessionStarted()
    {
        return isset($_SESSION);
    }

    /**
     * @param string $name
     * @param string $value
     */
    function setSessionValue($name, $value)
    {
        $_SESSION[$name] = $value;
    }

    /**
     * @param string $name
     * @return bool
     */
    function hasSessionValue($name)
    {
        return array_key_exists($name, $_SESSION);
    }

    /**
     * @param string $name
     * @return mixed
     */
    function getSessionValue($name)
    {
        return $_SESSION[$name];
    }

    /**
     * @param string $name
     */
    function deleteSessionValue($name)
    {
        unset($_SESSION[$name]);
    }
}

The same content is in 200 releases, Joomla 4.0.0-alpha5 to 5.3.0-alpha3. See them all, or every version of this file.