You are here

function _wingsuit_companion_canonicalize in Gin Layout Builder 8.2

Canonicalize relative dist folder.

Parameters

$path: The relative dist path.

Return value

string The absolute path.

1 call to _wingsuit_companion_canonicalize()
wingsuit_companion_update_8001 in ./wingsuit_companion.install
Install Wingsuit UI Patterns sub module.

File

./wingsuit_companion.install, line 32
Provides install/uninstall for wingsuit_companion module.

Code

function _wingsuit_companion_canonicalize($path) {
  $path = explode('/', $path);
  $keys = array_keys($path, '..');
  foreach ($keys as $keypos => $key) {
    array_splice($path, $key - ($keypos * 2 + 1), 2);
  }
  $path = implode('/', $path);
  $path = str_replace('./', '', $path);
  return $path;
}