mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/17529] Fix installer config.php availability checks
PHPBB-17529
This commit is contained in:
parent
4f10e6e212
commit
6ccc6f0383
1 changed files with 16 additions and 16 deletions
|
@ -145,32 +145,32 @@ class check_filesystem extends \phpbb\install\task_base
|
||||||
// Try to create file if it does not exists
|
// Try to create file if it does not exists
|
||||||
if (!file_exists($path))
|
if (!file_exists($path))
|
||||||
{
|
{
|
||||||
$fp = @fopen($path, 'w');
|
if (!is_resource($fp = @fopen($path, 'w')))
|
||||||
@fclose($fp);
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
$this->filesystem->phpbb_chmod($path,
|
$exists = $writable = false;
|
||||||
\phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
|
|
||||||
);
|
|
||||||
$exists = true;
|
|
||||||
}
|
}
|
||||||
catch (\phpbb\filesystem\exception\filesystem_exception $e)
|
else
|
||||||
{
|
{
|
||||||
// Do nothing
|
@fclose($fp);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->filesystem->phpbb_chmod($path,
|
||||||
|
\phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
|
||||||
|
);
|
||||||
|
$exists = true;
|
||||||
|
}
|
||||||
|
catch (\phpbb\filesystem\exception\filesystem_exception $e)
|
||||||
|
{
|
||||||
|
$writable = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!$this->filesystem->is_writable($path))
|
||||||
if (file_exists($path))
|
|
||||||
{
|
{
|
||||||
if (!$this->filesystem->is_writable($path))
|
|
||||||
{
|
{
|
||||||
$writable = false;
|
$writable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$exists = $writable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->set_test_passed(($exists && $writable) || $failable);
|
$this->set_test_passed(($exists && $writable) || $failable);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue