mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Fix PHP 7.4 deprecation warnings in ldap-sync script.
This commit is contained in:
parent
262a964760
commit
b721a977c0
|
@ -110,6 +110,8 @@ class LdapSync extends Command
|
||||||
{
|
{
|
||||||
ini_set('max_execution_time', '600'); //600 seconds = 10 minutes
|
ini_set('max_execution_time', '600'); //600 seconds = 10 minutes
|
||||||
ini_set('memory_limit', '500M');
|
ini_set('memory_limit', '500M');
|
||||||
|
$old_error_reporting = error_reporting(); // grab old error_reporting .ini setting, for later re-enablement
|
||||||
|
error_reporting($old_error_reporting & ~E_DEPRECATED); // disable deprecation warnings, for LDAP in PHP 7.4 (and greater)
|
||||||
|
|
||||||
if ($this->option('dryrun')) {
|
if ($this->option('dryrun')) {
|
||||||
$this->dryrun = true;
|
$this->dryrun = true;
|
||||||
|
@ -132,6 +134,7 @@ class LdapSync extends Command
|
||||||
$this->table($headers, $this->summary->toArray());
|
$this->table($headers, $this->summary->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_reporting($old_error_reporting); // re-enable deprecation warnings.
|
||||||
return $this->getSummary();
|
return $this->getSummary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue