mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/14891] Use filesystem classes for checking on tmp dir
The cache dir will now also only be used if tmp dir does not exist or if it's not writable. PHPBB3-14891
This commit is contained in:
parent
5f56e9025b
commit
6a568719d0
1 changed files with 6 additions and 2 deletions
|
@ -13,7 +13,8 @@
|
||||||
|
|
||||||
namespace phpbb\di;
|
namespace phpbb\di;
|
||||||
|
|
||||||
use \bantu\IniGetWrapper\IniGetWrapper;
|
use bantu\IniGetWrapper\IniGetWrapper;
|
||||||
|
use phpbb\filesystem\filesystem;
|
||||||
use ProxyManager\Configuration;
|
use ProxyManager\Configuration;
|
||||||
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
|
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
|
||||||
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
|
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
|
||||||
|
@ -45,7 +46,10 @@ class proxy_instantiator implements InstantiatorInterface
|
||||||
// Prevent trying to write to system temp dir in case of open_basedir
|
// Prevent trying to write to system temp dir in case of open_basedir
|
||||||
// restrictions being in effect
|
// restrictions being in effect
|
||||||
$ini_wrapper = new IniGetWrapper();
|
$ini_wrapper = new IniGetWrapper();
|
||||||
if ($ini_wrapper->getString('open_basedir') || !file_exists(sys_get_temp_dir()))
|
$filesystem = new filesystem();
|
||||||
|
$tmp_dir = sys_get_temp_dir();
|
||||||
|
if ($ini_wrapper->getString('open_basedir') &&
|
||||||
|
(!$filesystem->exists($tmp_dir) || !$filesystem->is_writable($tmp_dir)))
|
||||||
{
|
{
|
||||||
$config->setProxiesTargetDir($cache_dir);
|
$config->setProxiesTargetDir($cache_dir);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue