The relative path is created relative to the given base path:
php
echo Path::makeRelative("/webmozart/style.css", "/webmozart/puli");
=> ../style.css
If a relative path is passed and the base path is absolute, the relative
path is returned unchanged:
php
Path::makeRelative("style.css", "/webmozart/puli/css");
=> style.css
If both paths are relative, the relative path is created with the
assumption that both paths are relative to the same directory:
php
Path::makeRelative("style.css", "webmozart/puli/css");
=> ../../../style.css
If both paths are absolute, their root directory must be the same,
otherwise an exception is thrown:
php
Path::makeRelative("C:/webmozart/style.css", "/webmozart/puli");
InvalidArgumentException
If the passed path is absolute, but the base path is not, an exception
is thrown as well:
php
Path::makeRelative("/webmozart/style.css", "webmozart/puli");
InvalidArgumentException
If the base path is not an absolute path, an exception is thrown.
The result is a canonical path.