{"id":19357721,"url":"https://github.com/joomla-framework/uri","last_synced_at":"2025-04-05T23:08:29.280Z","repository":{"id":7094618,"uuid":"8385913","full_name":"joomla-framework/uri","owner":"joomla-framework","description":"Joomla Framework URI Package","archived":false,"fork":false,"pushed_at":"2024-12-10T07:15:48.000Z","size":5484,"stargazers_count":6,"open_issues_count":2,"forks_count":10,"subscribers_count":13,"default_branch":"3.x-dev","last_synced_at":"2025-03-29T22:06:45.519Z","etag":null,"topics":["joomla","joomla-framework","php","uri"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joomla-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"joomla","custom":"https://community.joomla.org/sponsorship-campaigns.html"}},"created_at":"2013-02-24T03:36:43.000Z","updated_at":"2024-12-10T07:15:51.000Z","dependencies_parsed_at":"2024-11-24T09:02:38.188Z","dependency_job_id":"85556ef9-f157-4730-800e-bc081eb80c28","html_url":"https://github.com/joomla-framework/uri","commit_stats":{"total_commits":121,"total_committers":20,"mean_commits":6.05,"dds":0.578512396694215,"last_synced_commit":"42862cc99be6dc75587e6ce6eb29e0c33de6ffa2"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Furi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Furi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Furi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Furi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joomla-framework","download_url":"https://codeload.github.com/joomla-framework/uri/tar.gz/refs/heads/3.x-dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411234,"owners_count":20934653,"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":["joomla","joomla-framework","php","uri"],"created_at":"2024-11-10T07:08:57.889Z","updated_at":"2025-04-05T23:08:29.233Z","avatar_url":"https://github.com/joomla-framework.png","language":"PHP","funding_links":["https://github.com/sponsors/joomla","https://community.joomla.org/sponsorship-campaigns.html"],"categories":[],"sub_categories":[],"readme":"## The Uri Package [![Build Status](https://ci.joomla.org/api/badges/joomla-framework/uri/status.svg?ref=refs/heads/3.x-dev)](https://ci.joomla.org/joomla-framework/uri)\n\n[![Latest Stable Version](https://poser.pugx.org/joomla/uri/v/stable)](https://packagist.org/packages/joomla/uri)\n[![Total Downloads](https://poser.pugx.org/joomla/uri/downloads)](https://packagist.org/packages/joomla/uri)\n[![Latest Unstable Version](https://poser.pugx.org/joomla/uri/v/unstable)](https://packagist.org/packages/joomla/uri)\n[![License](https://poser.pugx.org/joomla/uri/license)](https://packagist.org/packages/joomla/uri)\n\n### Introduction\n\nThe Joomla Framework includes a Uri package that allows for manipulating pieces of the Uri string with a number of useful methods to set and get values while dealing with the uri.\n\nThe classes that are included with the Uri package are `Uri`, which extends the `UriAbstract` class, an implementation of the `UriInterface`. Another class is the `UriHelper`class.\n\nThe Uri class is a mutable object which you'd use to manipulate an Uri.\n\nTo pass along an uri as value use `UriImmutable`, this object guarantees that the code you pass the object into can't manipulate it and, causing bugs in your code.\n\nIf only read access is required it's recommended to type hint against the `UriInterface`. This way either an `Uri` or an `UriImmutable` object can be passed.\n\nThe `UriHelper` class only contains one method parse_url() that's an UTF-8 safe replacement for PHP's parse_url().\n\nYou can use the `Uri` class a number of different ways when dealing with Uris. It is very easy to construct a uri programmatically using the methods provided in the `Uri` class.\n\n\n### Usage\n\nThe methods provided in the `Uri` class allow you to manipulate all aspects of a uri. For example, suppose you wanted to set a new uri, add in a port, and then also post a username and password to authenticate a .htaccess security file. You could use the following syntax:\n\n```php\n\u003c?php\n// new uri object\n$uri = new Joomla\\Uri\\Uri;\n\n$uri-\u003esetHost('http://localhost');\n$uri-\u003esetPort('8888');\n$uri-\u003esetUser('myUser');\n$uri-\u003esetPass('myPass');\n\necho $uri-\u003e__toString();\n```\nThis will output:\n\n`myUser:myPass@http://localhost:8888`\n\nIf you wanted to add a specific filepath after the host you could use the `setPath()` method:\n\n```php\n\u003c?php\n// set path\n$uri-\u003esetPath('path/to/file.php');\n```\n\nWhich will output\n   myUser:myPass@http://localhost:8888path/to/file.php\n\nAdding a URL query:\n```php\n\u003c?php\n// url query\n$uri-\u003esetQuery('foo=bar');\n```\n\nOutput:\n\n`myUser:myPass@http://localhost:8888path/to/file.php?foo=bar`\n\n## Installation via Composer\n\nAdd `\"joomla/uri\": \"~3.0\"` to the require block in your composer.json and then run `composer install`.\n\n```json\n{\n\t\"require\": {\n\t\t\"joomla/uri\": \"~3.0\"\n\t}\n}\n```\n\nAlternatively, you can simply run the following from the command line:\n\n```sh\ncomposer require joomla/uri \"~3.0\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Furi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoomla-framework%2Furi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Furi/lists"}