{"id":21823535,"url":"https://github.com/jbzoo/path","last_synced_at":"2025-04-14T04:31:36.303Z","repository":{"id":3080169,"uuid":"48378360","full_name":"JBZoo/Path","owner":"JBZoo","description":"Create memory based aliases for your project file system","archived":false,"fork":false,"pushed_at":"2024-01-28T11:05:40.000Z","size":146,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T14:19:28.982Z","etag":null,"topics":["files","filesystem","jbzoo","path","virtual"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBZoo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-21T15:13:40.000Z","updated_at":"2024-01-29T07:59:36.000Z","dependencies_parsed_at":"2024-06-19T22:51:12.416Z","dependency_job_id":"7e1ba71b-6cc1-4ec2-b1fb-9de66631a939","html_url":"https://github.com/JBZoo/Path","commit_stats":{"total_commits":98,"total_committers":7,"mean_commits":14.0,"dds":0.6020408163265306,"last_synced_commit":"dbd22f2f5c9d11edee6c9001a2e682e9bd6872a8"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FPath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FPath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FPath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FPath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBZoo","download_url":"https://codeload.github.com/JBZoo/Path/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248821717,"owners_count":21166946,"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":["files","filesystem","jbzoo","path","virtual"],"created_at":"2024-11-27T17:33:16.691Z","updated_at":"2025-04-14T04:31:36.279Z","avatar_url":"https://github.com/JBZoo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JBZoo / Path\n\n[![CI](https://github.com/JBZoo/Path/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Path/actions/workflows/main.yml?query=branch%3Amaster)    [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Path/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Path?branch=master)    [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Path/coverage.svg)](https://shepherd.dev/github/JBZoo/Path)    [![Psalm Level](https://shepherd.dev/github/JBZoo/Path/level.svg)](https://shepherd.dev/github/JBZoo/Path)    [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/path/badge)](https://www.codefactor.io/repository/github/jbzoo/path/issues)    \n[![Stable Version](https://poser.pugx.org/jbzoo/path/version)](https://packagist.org/packages/jbzoo/path/)    [![Total Downloads](https://poser.pugx.org/jbzoo/path/downloads)](https://packagist.org/packages/jbzoo/path/stats)    [![Dependents](https://poser.pugx.org/jbzoo/path/dependents)](https://packagist.org/packages/jbzoo/path/dependents?order_by=downloads)    [![GitHub License](https://img.shields.io/github/license/jbzoo/path)](https://github.com/JBZoo/Path/blob/master/LICENSE)\n\n\n\nCreate memory based aliases for your project file system.\n\n\n### Usage\n\n```php\nuse JBZoo\\Path\\Path;\n\n//  Get path instance.\n$path = new Path();\n\n//  Setup root directory.\n$path-\u003esetRoot(__DIR__);\n\n//  Add paths.\n$path\n    -\u003eadd(__DIR__ . '/styles/css', 'css')\n    -\u003eadd(__DIR__ . '/simple/styles/css', 'css')\n    //  Add array paths.\n    -\u003eadd([\n        __DIR__ . 'styles/folder/less',\n        __DIR__ . 'theme/styles/less',\n    ], 'less');\n\n/**\n * Add paths by virtual.\n * If you already added at least one one way, you can use the virtual paths\n */\n$path-\u003eadd('less:assets/less');\n$path-\u003eadd('css:assets/less');\n\n//  Get added path list by key.\nvar_dump($path-\u003egetPaths('css:'));\nvar_dump($path-\u003egetPaths('less:'));\n\n/**\n * Get full path for the first file found, if file exits.\n */\necho $path-\u003eget('css:styles.css');           //  result: /jbzoo/styles/css/styles.css\necho $path-\u003eget('less:path/to/styles.less'); //  result: /jbzoo/styles/folder/less/path/to/styles.less\n\n/**\n * Get url for the first file found, if file exits.\n * If - \"C:/Server/jbzoo\" is root dir we have...\n */\n$path-\u003eurl('css:styles.css');               //  http://my-site.com/styles/css/styles.css\n$path-\u003eurl('less:path/to/styles.less');     //  http://my-site.com/styles/css/folder/less/path/to/styles.less\n\necho '\u003clink rel=\"stylesheet\" href=\"' . $path-\u003eurl('css:styles.css') . '\"\u003e';\n\n//  Clean path.\nPath::clean('path\\\\to//simple\\\\folder');    //  result: 'path/to/simple/folder'\n```\n\n### Summary benchmark info (execution time)\n\nSee details [here](tests/phpbench/CompareWithRealpath.php)\n\nsubject | groups | its | revs | mean | stdev | rstdev | mem_real | diff\n --- | --- | --- | --- | --- | --- | --- | --- | --- \nbenchBaseline |  | 3 | 10000 | 2.53μs | 0.11μs | 4.39% | 6,291,456b | 1.00x\nbenchNative |  | 3 | 10000 | 138.22μs | 0.46μs | 0.33% | 6,291,456b | 54.64x\nbenchJBZooPath |  | 3 | 10000 | 192.58μs | 0.87μs | 0.45% | 6,291,456b | 76.13x\n\n\n## Unit tests and check code style\n```sh\nmake update\nmake test-all\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbzoo%2Fpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbzoo%2Fpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbzoo%2Fpath/lists"}