mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 11:44:08 +02:00
[ticket/16345] Small improvements
PHPBB3-16346
This commit is contained in:
@@ -24,7 +24,7 @@ class managed_with_clean_error_exception extends managed_with_error_exception
|
||||
* @param string $prefix The language string prefix
|
||||
* @param string $message The Exception message to throw (must be a language variable).
|
||||
* @param array $parameters The parameters to use with the language var.
|
||||
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param integer $code The Exception code.
|
||||
*/
|
||||
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)
|
||||
|
@@ -24,7 +24,7 @@ class managed_with_enable_error_exception extends managed_with_error_exception
|
||||
* @param string $prefix The language string prefix
|
||||
* @param string $message The Exception message to throw (must be a language variable).
|
||||
* @param array $parameters The parameters to use with the language var.
|
||||
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param integer $code The Exception code.
|
||||
*/
|
||||
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)
|
||||
|
@@ -24,7 +24,7 @@ class managed_with_error_exception extends runtime_exception
|
||||
* @param string $prefix The language string prefix
|
||||
* @param string $message The Exception message to throw (must be a language variable).
|
||||
* @param array $parameters The parameters to use with the language var.
|
||||
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param integer $code The Exception code.
|
||||
*/
|
||||
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)
|
||||
|
@@ -26,7 +26,7 @@ class runtime_exception extends base
|
||||
* @param string $prefix The language string prefix
|
||||
* @param string $message The Exception message to throw (must be a language variable).
|
||||
* @param array $parameters The parameters to use with the language var.
|
||||
* @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param \Exception|null $previous The previous runtime_exception used for the runtime_exception chaining.
|
||||
* @param integer $code The Exception code.
|
||||
*/
|
||||
public function __construct($prefix, $message = '', array $parameters = [], \Exception $previous = null, $code = 0)
|
||||
|
@@ -38,6 +38,11 @@ class extension_manager extends manager
|
||||
*/
|
||||
protected $filesystem;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $root_path;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -61,7 +66,7 @@ class extension_manager extends manager
|
||||
* @param string $package_type Composer type of managed packages
|
||||
* @param string $exception_prefix Exception prefix to use
|
||||
* @param string $root_path phpBB root path
|
||||
* @param config $config Config object
|
||||
* @param config|null $config Config object
|
||||
*/
|
||||
public function __construct(installer $installer, driver_interface $cache, ext_manager $extension_manager, filesystem $filesystem, $package_type, $exception_prefix, $root_path, config $config = null)
|
||||
{
|
||||
|
@@ -69,12 +69,12 @@ class installer
|
||||
protected $root_path;
|
||||
|
||||
/**
|
||||
* @var string Stores the original working directory in case it has been changed through move_to_root()
|
||||
* @var string|null Stores the original working directory in case it has been changed through move_to_root()
|
||||
*/
|
||||
private $original_cwd;
|
||||
|
||||
/**
|
||||
* @var array Stores the content of the ext json file before generate_ext_json_file() overrides it
|
||||
* @var array|null Stores the content of the ext json file before generate_ext_json_file() overrides it
|
||||
*/
|
||||
private $ext_json_file_backup;
|
||||
|
||||
@@ -83,11 +83,16 @@ class installer
|
||||
*/
|
||||
private $request;
|
||||
|
||||
/**
|
||||
* @var filesystem phpBB filesystem
|
||||
*/
|
||||
private $filesystem;
|
||||
|
||||
/**
|
||||
* @param string $root_path phpBB root path
|
||||
* @param filesystem $filesystem Filesystem object
|
||||
* @param request $request phpBB request object
|
||||
* @param config $config Config object
|
||||
* @param config|null $config Config object
|
||||
*/
|
||||
public function __construct($root_path, filesystem $filesystem, request $request, config $config = null)
|
||||
{
|
||||
@@ -108,6 +113,7 @@ class installer
|
||||
|
||||
$this->root_path = $root_path;
|
||||
$this->request = $request;
|
||||
$this->filesystem = $filesystem;
|
||||
|
||||
putenv('COMPOSER_HOME=' . filesystem_helper::realpath($root_path) . '/store/composer');
|
||||
}
|
||||
@@ -118,7 +124,7 @@ class installer
|
||||
* @param array $packages Packages to install.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param array $whitelist White-listed packages (packages that can be installed/updated/removed)
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*
|
||||
* @throws runtime_exception
|
||||
*/
|
||||
@@ -137,7 +143,7 @@ class installer
|
||||
* @param array $packages Packages to install.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param array $whitelist White-listed packages (packages that can be installed/updated/removed)
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*
|
||||
* @throws runtime_exception
|
||||
*/
|
||||
@@ -402,9 +408,7 @@ class installer
|
||||
*/
|
||||
public function check_requirements()
|
||||
{
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
|
||||
return $filesystem->is_writable([
|
||||
return $this->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',
|
||||
|
@@ -26,7 +26,7 @@ class web_io extends BufferIO implements io_interface
|
||||
* @param language $language Language object
|
||||
* @param string $input Input string
|
||||
* @param int $verbosity Verbosity level
|
||||
* @param OutputFormatterInterface $formatter Output formatter
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter
|
||||
*/
|
||||
public function __construct(language $language, $input = '', $verbosity = StreamOutput::VERBOSITY_NORMAL, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
|
@@ -43,17 +43,17 @@ class manager implements manager_interface
|
||||
protected $exception_prefix;
|
||||
|
||||
/**
|
||||
* @var array Caches the managed packages list (for the current type)
|
||||
* @var array|null Caches the managed packages list (for the current type)
|
||||
*/
|
||||
private $managed_packages;
|
||||
|
||||
/**
|
||||
* @var array Caches the managed packages list (for all phpBB types)
|
||||
* @var array|null Caches the managed packages list (for all phpBB types)
|
||||
*/
|
||||
private $all_managed_packages;
|
||||
|
||||
/**
|
||||
* @var array Caches the available packages list
|
||||
* @var array|null Caches the available packages list
|
||||
*/
|
||||
private $available_packages;
|
||||
|
||||
@@ -101,7 +101,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function pre_install(array $packages, IOInterface $io = null)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function post_install(array $packages, IOInterface $io = null)
|
||||
{
|
||||
@@ -146,7 +146,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function pre_update(array $packages, IOInterface $io = null)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function post_update(array $packages, IOInterface $io = null)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function pre_remove(array $packages, IOInterface $io = null)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ class manager implements manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*/
|
||||
protected function post_remove(array $packages, IOInterface $io = null)
|
||||
{
|
||||
|
@@ -26,7 +26,7 @@ interface manager_interface
|
||||
*
|
||||
* @param array $packages Packages to install.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*
|
||||
* @throws runtime_exception
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ interface manager_interface
|
||||
*
|
||||
* @param array $packages Packages to update.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*
|
||||
* @throws runtime_exception
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ interface manager_interface
|
||||
*
|
||||
* @param array $packages Packages to remove.
|
||||
* Each entry may be a name or an array associating a version constraint to a name
|
||||
* @param IOInterface $io IO object used for the output
|
||||
* @param IOInterface|null $io IO object used for the output
|
||||
*
|
||||
* @throws runtime_exception
|
||||
*/
|
||||
|
Reference in New Issue
Block a user