An open API service indexing awesome lists of open source software.

https://github.com/germaniakg/pathprefixer

Recursively prepends a path prefix to path string, array or StdClass objects.
https://github.com/germaniakg/pathprefixer

array-manipulations prefix prepend stdclass-objects string-manipulation

Last synced: about 2 months ago
JSON representation

Recursively prepends a path prefix to path string, array or StdClass objects.

Awesome Lists containing this project

README

        

# Germania KG · PathPrefixer

**Recursively prepends a path prefix to path string, array or StdClass objects.**

[![Packagist](https://img.shields.io/packagist/v/germania-kg/pathprefixer.svg?style=flat)](https://packagist.org/packages/germania-kg/pathprefixer)
[![PHP version](https://img.shields.io/packagist/php-v/germania-kg/pathprefixer.svg)](https://packagist.org/packages/germania-kg/pathprefixer)
[![Build Status](https://img.shields.io/travis/GermaniaKG/PathPrefixer.svg?label=Travis%20CI)](https://travis-ci.org/GermaniaKG/PathPrefixer)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/build-status/master)

## Installation with Composer

```bash
$ composer require germania-kg/pathprefixer
```

## Usage

```php
'includes',
'bar' => 'templates'
]);
// Result:
// 'foo' => '/path/to/root/includes',
// 'bar' => '/path/to/root/templates'
```

### Custom path separators

Per default, the `DIRECTORY_SEPARATOR` constant will be used for glueing the prefix and the path.
You may pass a custom seperator as well:

```php