Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Data/Import/LdifCommand.php
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | protected function loadFromFile(): void | ||||
$fh = fopen($file, 'r'); | $fh = fopen($file, 'r'); | ||||
$inserts = []; | $inserts = []; | ||||
$entry = []; | $entry = []; | ||||
$lastAttr = null; | $lastAttr = null; | ||||
$insertFunc = function ($limit = 0) use (&$entry, &$inserts) { | $insertFunc = function ($limit = 0) use (&$entry, &$inserts) { | ||||
// @phpstan-ignore-next-line | |||||
if (!empty($entry)) { | if (!empty($entry)) { | ||||
if ($entry = $this->parseLDAPEntry($entry)) { | if ($entry = $this->parseLDAPEntry($entry)) { | ||||
$inserts[] = $entry; | $inserts[] = $entry; | ||||
} | } | ||||
$entry = []; | $entry = []; | ||||
} | } | ||||
if (count($inserts) > $limit) { | if (count($inserts) > $limit) { | ||||
▲ Show 20 Lines • Show All 878 Lines • Show Last 20 Lines |