phpbb\di\proxy_instantiator::__construct PHP Method

__construct() public method

proxy_instantiator constructor
public __construct ( string $cache_dir )
$cache_dir string Cache dir for fall back when using open_basedir
    public function __construct($cache_dir)
    {
        $config = new Configuration();
        // Prevent trying to write to system temp dir in case of open_basedir
        // restrictions being in effect
        $ini_wrapper = new IniGetWrapper();
        $filesystem = new filesystem();
        $tmp_dir = function_exists('sys_get_temp_dir') ? sys_get_temp_dir() : '';
        if (empty($tmp_dir) || $ini_wrapper->getString('open_basedir') && (!$filesystem->exists($tmp_dir) || !$filesystem->is_writable($tmp_dir))) {
            $config->setProxiesTargetDir($cache_dir);
        }
        $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
        $this->factory = new LazyLoadingValueHolderFactory($config);
    }