Your IP : 127.0.0.1


Current Path : /home/dev2.destoffenstraat.com/vendor-1/magento/framework/Session/
Upload File :
Current File : /home/dev2.destoffenstraat.com/vendor-1/magento/framework/Session/SessionStartChecker.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

namespace Magento\Framework\Session;

/**
 * Class to check if session can be started or not.
 */
class SessionStartChecker
{
    /**
     * @var bool
     */
    private $checkSapi;

    /**
     * @param bool $checkSapi
     */
    public function __construct(bool $checkSapi = true)
    {
        $this->checkSapi = $checkSapi;
    }

    /**
     * Can session be started or not.
     *
     * @return bool
     */
    public function check() : bool
    {
        return !($this->checkSapi && PHP_SAPI === 'cli');
    }
}