{"id":23058339,"url":"https://github.com/germaniakg/pathprefixer","last_synced_at":"2025-04-03T06:17:10.833Z","repository":{"id":62510236,"uuid":"78516911","full_name":"GermaniaKG/PathPrefixer","owner":"GermaniaKG","description":"Recursively prepends a path prefix to path string, array or StdClass objects.","archived":false,"fork":false,"pushed_at":"2022-05-30T14:33:40.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T20:12:44.346Z","etag":null,"topics":["array-manipulations","prefix","prepend","stdclass-objects","string-manipulation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GermaniaKG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-10T09:16:03.000Z","updated_at":"2022-03-30T10:08:02.000Z","dependencies_parsed_at":"2022-11-02T13:16:27.723Z","dependency_job_id":null,"html_url":"https://github.com/GermaniaKG/PathPrefixer","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermaniaKG%2FPathPrefixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermaniaKG%2FPathPrefixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermaniaKG%2FPathPrefixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GermaniaKG%2FPathPrefixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GermaniaKG","download_url":"https://codeload.github.com/GermaniaKG/PathPrefixer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944385,"owners_count":20858772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array-manipulations","prefix","prepend","stdclass-objects","string-manipulation"],"created_at":"2024-12-16T02:15:08.362Z","updated_at":"2025-04-03T06:17:10.800Z","avatar_url":"https://github.com/GermaniaKG.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Germania KG · PathPrefixer\n\n**Recursively prepends a path prefix to path string, array or StdClass objects.**\n\n[![Packagist](https://img.shields.io/packagist/v/germania-kg/pathprefixer.svg?style=flat)](https://packagist.org/packages/germania-kg/pathprefixer)\n[![PHP version](https://img.shields.io/packagist/php-v/germania-kg/pathprefixer.svg)](https://packagist.org/packages/germania-kg/pathprefixer)\n[![Build Status](https://img.shields.io/travis/GermaniaKG/PathPrefixer.svg?label=Travis%20CI)](https://travis-ci.org/GermaniaKG/PathPrefixer)\n[![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)\n[![Code Coverage](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/GermaniaKG/PathPrefixer/build-status/master)\n\n\n## Installation with Composer\n\n```bash\n$ composer require germania-kg/pathprefixer\n```\n\n\n## Usage\n\n```php\n\u003c?php\nuse Germania\\PathPrefixer\\PathPrefixer;\n\n// Root will default to getcwd()\n$prefixer = new PathPrefixer( '/path/to/root' );\n\necho $prefixer('templates');\n// Result: \"/path/to/root/templates\"\n\n\n// Try on array:\n$result = $prefixer([\n\t'foo' =\u003e 'includes',\n\t'bar' =\u003e 'templates'\n]);\n// Result: \n//\t'foo' =\u003e '/path/to/root/includes',\n//\t'bar' =\u003e '/path/to/root/templates'\n```\n\n### Custom path separators\n\nPer default, the `DIRECTORY_SEPARATOR` constant will be used for glueing the prefix and the path.\nYou may pass a custom seperator as well:\n\n```php\n\u003c?php\n$prefixer = new PathPrefixer( '/path/to/root', \"@\" );\n\necho $prefixer('templates');\n// Result: \"/path/to/root@templates\"\n```\n\n## Issues\n\nSee [issues list.][i0]\n\n[i0]: https://github.com/GermaniaKG/PathPrefixer/issues \n\n## Development\n\n```bash\n$ git clone https://github.com/GermaniaKG/PathPrefixer.git\n$ cd PathPrefixer\n$ composer install\n```\n\n## Unit tests\n\nEither copy `phpunit.xml.dist` to `phpunit.xml` and adapt to your needs, or leave as is. Run [PhpUnit](https://phpunit.de/) test or composer scripts like this:\n\n```bash\n$ composer test\n# or\n$ vendor/bin/phpunit\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermaniakg%2Fpathprefixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgermaniakg%2Fpathprefixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgermaniakg%2Fpathprefixer/lists"}