|
| | __construct ($from, $to, $root='') |
| |
| | convert ($path) |
| | Convert paths relative from 1 file to another.
|
| |
|
| | dirname ($path) |
| | Attempt to get the directory name from a path.
|
| |
| | normalize ($path) |
| | Normalize path.
|
| |
| | shared ($path1, $path2) |
| | Figure out the shared path of 2 locations.
|
| |
◆ __construct()
| MatthiasMullie\PathConverter\Converter::__construct |
( |
| $from, |
|
|
| $to, |
|
|
| $root = '' ) |
- Parameters
-
| string | $from | The original base path (directory, not file!) |
| string | $to | The new base path (directory, not file!) |
| string | $root | Root directory (defaults to getcwd) |
◆ convert()
| MatthiasMullie\PathConverter\Converter::convert |
( |
| $path | ) |
|
Convert paths relative from 1 file to another.
E.g. ../images/img.gif relative to /home/forkcms/frontend/core/layout/css should become: ../../core/layout/images/img.gif relative to /home/forkcms/frontend/cache/minified_css
- Parameters
-
| string | $path | The relative path that needs to be converted |
- Return values
-
| string | The new relative path |
Implements MatthiasMullie\PathConverter\ConverterInterface.
◆ dirname()
| MatthiasMullie\PathConverter\Converter::dirname |
( |
| $path | ) |
|
|
protected |
Attempt to get the directory name from a path.
- Parameters
-
- Return values
-
◆ normalize()
| MatthiasMullie\PathConverter\Converter::normalize |
( |
| $path | ) |
|
|
protected |
Normalize path.
- Parameters
-
- Return values
-
◆ shared()
| MatthiasMullie\PathConverter\Converter::shared |
( |
| $path1, |
|
|
| $path2 ) |
|
protected |
Figure out the shared path of 2 locations.
Example: /home/forkcms/frontend/core/layout/images/img.gif and /home/forkcms/frontend/cache/minified_css share /home/forkcms/frontend
- Parameters
-
| string | $path1 | |
| string | $path2 | |
- Return values
-
The documentation for this class was generated from the following file:
- lib/minify/matthiasmullie-pathconverter/src/Converter.php