PHPackages                             vinogradsoft/compass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vinogradsoft/compass

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vinogradsoft/compass
====================

Library for working with addresses. Works with disk file paths and URLs.

1.1.0(2y ago)31832MITPHPPHP &gt;=8.0

Since Oct 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/vinogradsoft/compass)[ Packagist](https://packagist.org/packages/vinogradsoft/compass)[ RSS](/packages/vinogradsoft-compass/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (2)

[![Compass logo](banner.svg)](banner.svg)

**Create reusable applications.**
Open source library.

[![codecov](https://camo.githubusercontent.com/41400cbdede9b8bb6c6ff378d10f064131cc761c362834d189f6682c19aeb722/68747470733a2f2f636f6465636f762e696f2f67682f76696e6f67726164736f66742f636f6d706173732f67726170682f62616467652e7376673f746f6b656e3d533158525a3147455938)](https://codecov.io/gh/vinogradsoft/compass)[![](https://camo.githubusercontent.com/231e6bea9f265fd6379e656eec06716656fd3d6439631b6be4316db060d0c253/68747470733a2f2f62616467656e2e6e65742f7374617469632f6c6963656e73652f4d49542f677265656e)](https://camo.githubusercontent.com/231e6bea9f265fd6379e656eec06716656fd3d6439631b6be4316db060d0c253/68747470733a2f2f62616467656e2e6e65742f7374617469632f6c6963656e73652f4d49542f677265656e)

What is Compass?
----------------

[](#what-is-compass)

> 👉 Compass is a library designed to work with URLs and hard disk file paths. It includes tools to simplify manipulation of this data. The goal of the library is to facilitate working with URLs and data on file locations.

General Information
-------------------

[](#general-information)

Compass can be used in various PHP applications to process file paths and URLs. It includes two main components: `Compass\Path` and `Compass\Url`. Both of these components are separate objects and offer a set of methods for simple data manipulation. `Compass\Path` provides tools for working with directories, including finding, replacing, and checking for directories in a path string, as well as changing their order. In turn, `Compass\Url` provides capabilities for working with URLs, allowing you to create, retrieve, and modify various parts of a URL.

Both components operate on a similar principle, first collecting the necessary parameters and then applying them to the result using a special `updateSource()` method.

Install
-------

[](#install)

To install with composer:

```
php composer require vinogradsoft/compass "^1.0"

```

Requires PHP 8.0 or newer.

URL Component
-------------

[](#url-component)

### 🚀 Quick Start

[](#-quick-start)

```
