Changeset View
Changeset View
Standalone View
Standalone View
src/error/PhutilErrorHandler.php
Show First 20 Lines • Show All 454 Lines • ▼ Show 20 Lines | public static function adjustFilePath($path) { | ||||
$bootloader = PhutilBootloader::getInstance(); | $bootloader = PhutilBootloader::getInstance(); | ||||
$libraries = $bootloader->getAllLibraries(); | $libraries = $bootloader->getAllLibraries(); | ||||
$roots = array(); | $roots = array(); | ||||
foreach ($libraries as $library) { | foreach ($libraries as $library) { | ||||
$root = $bootloader->getLibraryRoot($library); | $root = $bootloader->getLibraryRoot($library); | ||||
// For these libraries, the effective root is one level up. | // For these libraries, the effective root is one level up. | ||||
switch ($library) { | switch ($library) { | ||||
case 'arcanist': | case 'arcanist': | ||||
case 'phorge': | |||||
case 'phabricator': | case 'phabricator': | ||||
$root = dirname($root); | $root = dirname($root); | ||||
break; | break; | ||||
} | } | ||||
if (!strncmp($root, $path, strlen($root))) { | if (!strncmp($root, $path, strlen($root))) { | ||||
return '<'.$library.'>'.substr($path, strlen($root)); | return '<'.$library.'>'.substr($path, strlen($root)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |