PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / matthiasmullie / path-converter / README.md

README.md in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/matthiasmullie/path-converter/README.md

53 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 # Path converter
2
3 [](https://travis-ci.org/matthiasmullie/path-converter![Build status](https://api.travis-ci.org/matthiasmullie/path-converter.svg?branch=master)](https://travis-ci.org/matthiasmullie/path-converter](https://travis-ci.org/matthiasmullie/path-converter)
4 [](https://codecov.io/github/matthiasmullie/path-converter![Code coverage](http://img.shields.io/codecov/c/github/matthiasmullie/path-converter.svg)](https://codecov.io/github/matthiasmullie/path-converter](https://codecov.io/github/matthiasmullie/path-converter)
5 [](https://scrutinizer-ci.com/g/matthiasmullie/path-converter![Code quality](http://img.shields.io/scrutinizer/g/matthiasmullie/path-converter.svg)](https://scrutinizer-ci.com/g/matthiasmullie/path-converter](https://scrutinizer-ci.com/g/matthiasmullie/path-converter)
6 [](https://packagist.org/packages/matthiasmullie/path-converter![Latest version](http://img.shields.io/packagist/v/matthiasmullie/path-converter.svg)](https://packagist.org/packages/matthiasmullie/path-converter](https://packagist.org/packages/matthiasmullie/path-converter)
7 [](https://packagist.org/packages/matthiasmullie/path-converter![Downloads total](http://img.shields.io/packagist/dt/matthiasmullie/path-converter.svg)](https://packagist.org/packages/matthiasmullie/path-converter](https://packagist.org/packages/matthiasmullie/path-converter)
8 [](https://github.com/matthiasmullie/path-converter/blob/master/LICENSE![License](http://img.shields.io/packagist/l/matthiasmullie/path-converter.svg)](https://github.com/matthiasmullie/path-converter/blob/master/LICENSE](https://github.com/matthiasmullie/path-converter/blob/master/LICENSE)
9
10
11 ## Usage
12
13 ```php
14 use MatthiasMullie\PathConverter\Converter;
15
16 $from = '/css/imports/icons.css';
17 $to = '/css/minified.css';
18
19 $converter = new Converter($from, $to);
20 $result = $converter->convert('../../images/icon.jpg');
21 // $result is now '../images/icon.jpg'
22 ```
23
24
25 ## Methods
26
27 ### __construct($from, $to)
28
29 The object constructor accepts 2 paths: the source path your file(s) is/are
30 currently relative to, and the target path to convert to.
31
32 ### convert($path): string
33
34 $path is the relative file, which is currently relative to $from (in
35 constructor). The return value will be the relative path of this same file, but
36 now relative to $to (in constructor)
37
38
39 ## Installation
40
41 Simply add a dependency on matthiasmullie/path-converter to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:
42
43 ```sh
44 composer require matthiasmullie/path-converter
45 ```
46
47 Although it's recommended to use Composer, you can actually include these files anyway you want.
48
49
50 ## License
51
52 PathConverter is [](http://opensource.org/licenses/MITMIT](http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT) licensed.
53