2017 © Pedro Peláez
 

library pathprefixer

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

image

germania-kg/pathprefixer

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

  • Thursday, April 12, 2018
  • by germania-kg
  • Repository
  • 2 Watchers
  • 0 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Germania KG · PathPrefixer

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

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status, (*2)

Installation with Composer

$ composer require germania-kg/pathprefixer

Usage

<?php
use Germania\PathPrefixer\PathPrefixer;

// Root will default to getcwd()
$prefixer = new PathPrefixer( '/path/to/root' );

echo $prefixer('templates');
// Result: "/path/to/root/templates"


// Try on array:
$result = $prefixer([
    'foo' => '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:, (*3)

<?php
$prefixer = new PathPrefixer( '/path/to/root', "@" );

echo $prefixer('templates');
// Result: "/path/to/root@templates"

Issues

See issues list., (*4)

Development

$ git clone https://github.com/GermaniaKG/PathPrefixer.git
$ cd PathPrefixer
$ composer install

Unit tests

Either copy phpunit.xml.dist to phpunit.xml and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:, (*5)

$ composer test
# or
$ vendor/bin/phpunit

The Versions

12/04 2018

dev-develop

dev-develop

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

12/04 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

12/04 2018

1.0.9

1.0.9.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

06/04 2018

1.0.8

1.0.8.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

06/04 2018

1.0.7

1.0.7.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

31/08 2017

1.0.6

1.0.6.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

11/05 2017

1.0.5

1.0.5.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

11/05 2017

1.0.4

1.0.4.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

11/05 2017

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

10/01 2017

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

10/01 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt

10/01 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Carsten Witt