Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/15871] Fix PHP 7.1+ warning in ACP extensions module #5442

Merged
merged 3 commits into from Nov 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions phpBB/includes/acp/acp_extensions.php
Expand Up @@ -35,11 +35,13 @@ class acp_extensions
private $request;
private $phpbb_dispatcher;
private $ext_manager;
private $phpbb_container;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the $php_ini property

private $php_ini;

function main()
{
// Start the page
global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpbb_log, $phpbb_dispatcher;
global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpbb_log, $phpbb_dispatcher, $phpbb_container;

$this->config = $config;
$this->template = $template;
Expand All @@ -48,6 +50,8 @@ function main()
$this->log = $phpbb_log;
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->ext_manager = $phpbb_extension_manager;
$this->phpbb_container = $phpbb_container;
$this->php_ini = $this->phpbb_container->get('php_ini');

$this->user->add_lang(array('install', 'acp/extensions', 'migrator'));

Expand All @@ -57,7 +61,7 @@ function main()
$ext_name = $this->request->variable('ext_name', '');

// What is a safe limit of execution time? Half the max execution time should be safe.
$safe_time_limit = (ini_get('max_execution_time') / 2);
$safe_time_limit = ($this->php_ini->getNumeric('max_execution_time') / 2);
$start_time = time();

// Cancel action
Expand Down