You are here

public function RequestController::simplifyPath in MongoDB 8.2

Convert an absolute path to a relative one if below the site root.

Parameters

string $path: An absolute path on the filesystem.

Return value

string A relative path if possible, otherwise the input path.

1 call to RequestController::simplifyPath()
RequestController::buildMainTableRows in modules/mongodb_watchdog/src/Controller/RequestController.php
Build the main table rows.

File

modules/mongodb_watchdog/src/Controller/RequestController.php, line 276

Class

RequestController
The controller for the request events page.

Namespace

Drupal\mongodb_watchdog\Controller

Code

public function simplifyPath(string $path) {
  $ret = mb_strpos($path, DRUPAL_ROOT) === 0 ? mb_strpos($path, $this->rootLength) : $path;
  return $ret;
}