{"id":37014313,"url":"https://github.com/maximgrynykha/urling","last_synced_at":"2026-01-14T01:25:10.534Z","repository":{"id":46287104,"uuid":"345319747","full_name":"maximgrynykha/urling","owner":"maximgrynykha","description":"🎯 URL parser \u0026 constructor in PHP","archived":false,"fork":false,"pushed_at":"2021-11-02T03:08:21.000Z","size":875,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-05T22:34:47.600Z","etag":null,"topics":["create-uri","create-url","php","uri","uri-builder","uri-constructor","uri-extend","uri-manipulation","uri-parser","uris","url","url-builder","url-constructor","url-extend","url-manipulation","url-parser","urling","urls"],"latest_commit_sha":null,"homepage":"https://github.com/ismaxim/urling","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/maximgrynykha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-07T10:42:36.000Z","updated_at":"2023-09-08T18:19:27.000Z","dependencies_parsed_at":"2022-09-22T14:38:39.837Z","dependency_job_id":null,"html_url":"https://github.com/maximgrynykha/urling","commit_stats":null,"previous_names":["ismaxim/urling","mxgy/urling","maximgrynykha/urling"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/maximgrynykha/urling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Furling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Furling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Furling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Furling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximgrynykha","download_url":"https://codeload.github.com/maximgrynykha/urling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximgrynykha%2Furling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["create-uri","create-url","php","uri","uri-builder","uri-constructor","uri-extend","uri-manipulation","uri-parser","uris","url","url-builder","url-constructor","url-extend","url-manipulation","url-parser","urling","urls"],"created_at":"2026-01-14T01:25:07.449Z","updated_at":"2026-01-14T01:25:10.525Z","avatar_url":"https://github.com/maximgrynykha.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Urling - url parser \u0026 constructor](https://raw.githubusercontent.com/ismaxim/urling/master/assets/hero-image.png \"Urling\")](https://github.com/ismaxim/urling#%EF%B8%8F-installation)\n\n![Build Status](https://img.shields.io/github/workflow/status/ismaxim/urling/Build?label=build\u0026logo=github\u0026logoColor=white\u0026style=for-the-badge)\n\n\u003c!-- \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/ismaxim/urling/Build?label=build\u0026logo=github\u0026 logoColor=white\u0026style=for-the-badge\" alt=\"Build Status\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/samsonasik/mezzio-authentication-with-authorization?color=codecov\u0026logo=codecov\u0026style=for-the-badge\" alt=\"Tests Coverage\"\u003e\n    \u003cimg src=\"https://img.shields.io/packagist/l/ismaxim/urling?color=1384C4\u0026style=for-the-badge\" alt=\"Packagist License\"\u003e\n    \u003cimg src=\"https://img.shields.io/packagist/v/laravel/laravel?label=version\u0026style=for-the-badge\" alt=\"Packagist Version\"\u003e\n\u003c/p\u003e --\u003e\n\n# __Urling__\n\n\u003e 🌐 \u003ca href=\"https://github.com/ismaxim/urling/blob/master/assets/README-RU.md\"\u003eДокументация на русском →\u003c/a\u003e | \u003ca href=\"https://github.com/ismaxim/urling/blob/master/assets/README-UA.md\"\u003eДокументація на українській →\u003c/a\u003e\n\n## ⚙️ Installation\n\nTo install this library - run the command below in your terminal:\n\n```shell\ncomposer require ismaxim/urling\n```\n\n## 🧙 Usage\n\n### 📖 Concept\n\n#### Three major ideas\n\n📗 1. Two modes to work with URL: parser mode \u0026 constructor mode.  \n📘 2. Accessing to concrete part of URL with using aliases (see [ACCESSING TABLE](#accessing-table), column [Aliases](#aliases)).  \n📙 3. Base editors for processing complete URL and each part separately (see section [Basic usage](https://github.com/ismaxim/urling#-basic-usage)).  \n\n***\n\n### 🚀 Start\n\n```php\n# Url parser mode\n\nuse Urling\\Urling;\n\n$urling = new Urling(\"https://github.com/ismaxim/urling#start\");\n\n$url_part_values = [\n    \"protocol_value\" =\u003e $urling-\u003eurl-\u003eprotocol-\u003eget(),\n    \"domain_value\"   =\u003e $urling-\u003eurl-\u003edomain-\u003eget(),\n    \"routes_value\"   =\u003e $urling-\u003eurl-\u003eroutes-\u003eget(),\n    \"anchor_value\"   =\u003e $urling-\u003eurl-\u003eanchor-\u003eget(),\n];\n\nprint_r($url_part_values);\n\n/* \n    RESULT: \n\n    [\n        \"protocol_value\" =\u003e \"https\",\n        \"domain_value\"   =\u003e \"github.com\",\n        \"routes_value\"   =\u003e \"ismaxim/urling\",\n        \"anchor_value\"   =\u003e \"start\",\n    ] \n*/\n```\n\n```php\n# Url constructor mode\n\nuse Urling\\Urling;\n        \n$urling = new Urling();\n\n$urling-\u003eurl-\u003econstruct([\n    \"protocol\" =\u003e \"https\",\n    \"domain\"   =\u003e \"github.com\",\n    \"routes\"   =\u003e \"ismaxim/urling\",\n    \"anchor\"   =\u003e \"start\",\n]);\n\n// Either you can set the value for each distinct part \n// in the url by accessing it directly, for example:\n\n$urling-\u003eurl-\u003eprotocol-\u003eadd(\"https\");\n$urling-\u003eurl-\u003edomain-\u003eadd(\"github.com\");\n$urling-\u003eurl-\u003eroutes-\u003eadd(\"ismaxim/urling\");\n$urling-\u003eurl-\u003eanchor-\u003eadd(\"start\");\n\nprint_r($urling-\u003eurl-\u003eget());\n\n/* \n    RESULT:\n    \n    \"https://github.com/ismaxim/urling#start\"\n*/\n```\n\n#### 🔑 Accessing\n\n***\n\nYou can access to concrete URL part to parse it by using its basename (see [ACCESSING TABLE](#accessing-table), column [Url Part](#url-part)) or ask for its alias (see [ACCESSING TABLE](#accessing-table), column [Aliases](#aliases)) like: \n\n```php\n$urling-\u003eurl-\u003escheme-\u003e... | $urling-\u003eurl-\u003eprotocol-\u003e... (other parts of url in a similar way).\n```\n\u003ca id=\"accessing-table\"\u003e\u003c/a\u003e__ACCESSING TABLE__\n\n| \u003ca id=\"url-part\"\u003e\u003c/a\u003eUrl Part | \u003ca id=\"aliases\"\u003e\u003c/a\u003eAliases | \u003ca id=\"parser\"\u003e\u003c/a\u003eParser               |\n| ----------------------------- | --------------------------- | --------------------------------------- |\n| scheme                        | protocol                    | [SchemeParser](https://bit.ly/3vOpzbs)  |\n| user                          | username                    | [UserParser](https://bit.ly/2NLCWYQ)    |\n| pass                          | password                    | [PassParser](https://bit.ly/3lPdkXG)    |\n| host                          | hostname, domain            | [HostParser](https://bit.ly/394KA8c)    |\n| port                          |                             | [PortParser](https://bit.ly/39aiMz0)    |\n| path                          | routes                      | [PathParser](https://bit.ly/3lEZS8H)    |\n| query                         | params, attributes          | [QueryParser](https://bit.ly/3d0VaOu)   |\n| fragment                      | anchor                      | [FragmetParser](https://bit.ly/3tKfI4C) |\n\n#### 👶 Basic usage\n\n***\n\n__Basic Editors__ - [Base editor of URL](https://bit.ly/3vXg0qA) and [Base editor of part of URL](https://bit.ly/3tNXSgZ) cover almost all tasks: *__add, get, update or remove__* URL or values anywhere in it. __Base Editors__ are \"CRUDable\" wrappers over the __parse_url()__ function from native PHP, and according to this fact, they return and modify values in a similar way. The only significant difference is the syntax of calls when parsing a URL or its parts. \n\n```php\n// Working with URL\n\n$urling-\u003eurl-\u003eadd();\n$urling-\u003eurl-\u003eget();\n$urling-\u003eurl-\u003eupdate();\n$urling-\u003eurl-\u003edelete();\n\n// Working with one of the URL parts\n\n$urling-\u003eurl-\u003escheme-\u003eadd();\n$urling-\u003eurl-\u003escheme-\u003eget();\n$urling-\u003eurl-\u003escheme-\u003eupdate();\n$urling-\u003eurl-\u003escheme-\u003edelete();\n\n// For example, let's imagine that the URL is: https://github.com/ismaxim/urling#basic-usage\n// Then example workflow to parse this URL in part of \"scheme\" or \"protocol\" (see ACCESSING TABLE, column \"Aliases\") will seem to this:\n\n$urling-\u003eurl-\u003escheme-\u003eget();          # returns \"https\" (state of URL: https://github.com/ismaxim/urling#basic-usage)\n$urling-\u003eurl-\u003escheme-\u003edelete();       # returns null    (state of URL: github.com/ismaxim/urling#basic-usage)\n$urling-\u003eurl-\u003escheme-\u003eadd(\"ftp\");     # returns \"ftp\"   (state of URL: ftp://github.com/ismaxim/urling#basic-usage)\n$urling-\u003eurl-\u003escheme-\u003eupdate(\"smtp\"); # returns \"smtp\"  (state of URL: smtp://github.com/ismaxim/urling#basic-usage)\n\n// Work with other parts of URL can be done in a similar way.\n```\n\n#### 🧔 Advanced usage\n\n***\n\nIf you need to do something like *__add, get, update or delete__* the value of any part of the URL, but it's outside the scope of the base functionality, you can use one of the Base editors functions *__add, get, update or delete__* as a prefix with the name of a specific method as postfix appropriate for your task like:\n\n\u003e (add, get, update, delete) + \"SomeFunctionName\" for the concrete task.\n\nNote: *Almost all functions will use that code convention permanently.*\n\nExamples:  \n- getValueByName();\n- getNameValuePairs();\n- etc. ...\n\n```php\n$urling-\u003eurl-\u003eparams-\u003egetValueByName();\n$urling-\u003eurl-\u003eparams-\u003egetNameValuePairs();\n```\n\n## 🧪 Testing\n\n_Actually, all tests already automatically passed within CI build._\n\nTo test this library - run the command below in your terminal.\n\n```shell\ncomposer test\n```\n\n## 🤝 Contributing\n\nIf you have a problem that cannot be solved using this library, please write your solution and if you want to help other developers who also use this library (or if you want to keep your solution working after a new version is released, which will go to package manager dependencies) - create a pull-request. We will be happy to add your excellent code to the library!\n\n🐞 Report any bugs or issues you find on the [GitHub issues](https://github.com/ismaxim/urling/issues).\n\n### ✨ Creating custom functional\n\nYou can extend the functionality of the library with your own code, making edits to solve your problems in the parser classes. There are two types of parser classes the first and the main is [URL parser](https://github.com/ismaxim/urling/blob/master/src/Urling/Core/Url.php), but there are others as well, - [URL parts parsers](https://github.com/ismaxim/urling/tree/master/src/Urling/PartParsers). For each part is separate own parser.\n\nUsing the library or examining docs you can notice the same or similar to this record:\n\n```php\n$urling-\u003eurl-\u003eparams-\u003eget()\n```\n\nThis entry might interpret the next way: \"Hey, Urling, ask to the part 'params' on the current URL and return it value(this part)\".\n\nBasically extending functionality, you will work with a part of the URL almost all times and will processing or get the value for a specific part. To understand how to access to parser for needed part you can look at [ACCESSING TABLE](#accessing-table). You only need to match the [*__url part__*](#url-part) and [*__aliases__*](#aliases) sections with the [*__parser__*](#parser) section, and then go to the desired parser file and write the best code in the world! \n\n## 📎 Credits\n- [Maintainer →](https://github.com/ismaxim)\n- [Contributors →](https://github.com/ismaxim/urling/contributors)\n\n## 📃 License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximgrynykha%2Furling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximgrynykha%2Furling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximgrynykha%2Furling/lists"}