Fix PHP 7.4 deprecation warnings in ldap-sync script.

This commit is contained in:
Brady Wetherington 2020-08-24 21:35:00 -07:00
parent 262a964760
commit b721a977c0

View file

@ -110,6 +110,8 @@ class LdapSync extends Command
{
ini_set('max_execution_time', '600'); //600 seconds = 10 minutes
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')) {
$this->dryrun = true;
@ -132,6 +134,7 @@ class LdapSync extends Command
$this->table($headers, $this->summary->toArray());
}
error_reporting($old_error_reporting); // re-enable deprecation warnings.
return $this->getSummary();
}