Overview

Namespaces

  • MatthiasMullie
    • Minify
      • Exceptions
    • PathConverter
  • None
  • ReCaptcha
    • RequestMethod
  • TOTP

Classes

  • Converter
  • Overview
  • Namespace
  • Class

Class Converter

Convert paths relative from 1 file to another.

E.g. ../../images/icon.jpg relative to /css/imports/icons.css becomes ../images/icon.jpg relative to /css/minified.css

Please report bugs on https://github.com/matthiasmullie/path-converter/issues

Namespace: MatthiasMullie\PathConverter
Copyright: Copyright (c) 2015, Matthias Mullie. All rights reserved.
License: License
Author: Matthias Mullie pathconverter@mullie.eu
Located at Sources/minify/path-converter/src/Converter.php
Methods summary
public
# __construct( string $from, string $to )

Parameters

$from
The original base path (directory, not file!)
$to
The new base path (directory, not file!)
protected string
# normalize( string $path )

Normalize path.

Normalize path.

Parameters

$path

Returns

string
protected string
# shared( string $path1, string $path2 )

Figure out the shared path of 2 locations.

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

$path1
$path2

Returns

string
public string
# convert( string $path )

Convert paths relative from 1 file to another.

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

$path
The relative path that needs to be converted.

Returns

string
The new relative path.
public string
# dirname( string $path )

Attempt to get the directory name from a path.

Attempt to get the directory name from a path.

Parameters

$path

Returns

string
Properties summary
protected string $from
#
protected string $to
#
API documentation generated by ApiGen