mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/11150] Disable if directories not writable
PHPBB3-11150
This commit is contained in:
committed by
Tristan Darricau
parent
0a809fb90e
commit
cc0a762866
@@ -77,7 +77,13 @@ class installer
|
||||
{
|
||||
if ($config)
|
||||
{
|
||||
$this->repositories = (array) unserialize($config['exts_composer_repositories']);
|
||||
$repositories = unserialize($config['exts_composer_repositories']);
|
||||
|
||||
if (!is_array($repositories) && !empty($repositories))
|
||||
{
|
||||
$this->repositories = (array) $repositories;
|
||||
}
|
||||
|
||||
$this->packagist = (bool) $config['exts_composer_packagist'];
|
||||
$this->composer_filename = $config['exts_composer_json_file'];
|
||||
$this->packages_vendor_dir = $config['exts_composer_vendor_dir'];
|
||||
@@ -395,6 +401,22 @@ class installer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the requirements of the manager and returns true if it can be used.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function check_requirements()
|
||||
{
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
|
||||
return $filesystem->is_writable([
|
||||
$this->root_path . $this->composer_filename,
|
||||
$this->root_path . $this->packages_vendor_dir,
|
||||
$this->root_path . substr($this->composer_filename, 0, -5) . '.lock',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates $compatible_packages with the versions of $versions compatibles with the $core_constraint
|
||||
*
|
||||
|
Reference in New Issue
Block a user