mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
Compare commits
1 commit
e5f510d60d
...
247c8bcb1c
Author | SHA1 | Date | |
---|---|---|---|
|
247c8bcb1c |
1 changed files with 19 additions and 17 deletions
|
@ -145,29 +145,31 @@ 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))
|
||||||
{
|
{
|
||||||
if (!is_resource($fp = @fopen($path, 'w')))
|
$fp = @fopen($path, 'w');
|
||||||
|
@fclose($fp);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
$exists = $writable = false;
|
$this->filesystem->phpbb_chmod($path,
|
||||||
|
\phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
|
||||||
|
);
|
||||||
|
$exists = true;
|
||||||
}
|
}
|
||||||
else
|
catch (\phpbb\filesystem\exception\filesystem_exception $e)
|
||||||
{
|
{
|
||||||
@fclose($fp);
|
// Do nothing
|
||||||
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))
|
||||||
{
|
{
|
||||||
$writable = false;
|
if (!$this->filesystem->is_writable($path))
|
||||||
|
{
|
||||||
|
$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