public function resolvePath($path, $suffix = '', $relativePath = false)
{
$path = preg_replace('/:+/', '/', $path);
$root = realpath($this->rootDir . '/../');
if ($bundle = $this->getBundleFromPath($path, $bundleName)) {
$path = substr($path, strlen($bundleName) + 1);
$bundlePath = $bundle->getPath();
$suffix = trim($suffix, '/');
$path = trim($path, '/');
$bundlePath = '/' . trim($bundlePath, '/');
$path = $bundlePath . ($suffix ? '/' . $suffix : '') . '/' . $path;
} else {
$path = $root . $path;
}
if ($relativePath) {
return Tools::getRelativePath($path, $root);
}
return $path;
}