Differential D19801 Diff 47306 src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | public static function lookupOrCreatePaths(array $paths) { | ||||
if ($missing_paths) { | if ($missing_paths) { | ||||
foreach (array_chunk($missing_paths, 128) as $path_chunk) { | foreach (array_chunk($missing_paths, 128) as $path_chunk) { | ||||
$sql = array(); | $sql = array(); | ||||
foreach ($path_chunk as $path) { | foreach ($path_chunk as $path) { | ||||
$sql[] = qsprintf($conn_w, '(%s, %s)', $path, md5($path)); | $sql[] = qsprintf($conn_w, '(%s, %s)', $path, md5($path)); | ||||
} | } | ||||
queryfx( | queryfx( | ||||
$conn_w, | $conn_w, | ||||
'INSERT IGNORE INTO %T (path, pathHash) VALUES %Q', | 'INSERT IGNORE INTO %T (path, pathHash) VALUES %LQ', | ||||
PhabricatorRepository::TABLE_PATH, | PhabricatorRepository::TABLE_PATH, | ||||
implode(', ', $sql)); | $sql); | ||||
} | } | ||||
$result_map += self::lookupPaths($missing_paths); | $result_map += self::lookupPaths($missing_paths); | ||||
} | } | ||||
return $result_map; | return $result_map; | ||||
} | } | ||||
private static function lookupPaths(array $paths) { | private static function lookupPaths(array $paths) { | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |