PHPackages                             mrclay/elgg-url-sniffer - 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. mrclay/elgg-url-sniffer

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

mrclay/elgg-url-sniffer
=======================

Analyze a URL to see if it's within an Elgg site, is an action/page, likely represents a GUID, etc.

3.1.0(9y ago)2461[2 issues](https://github.com/mrclay/elgg-url-sniffer/issues)2MITPHPPHP &gt;=5.3

Since Oct 24Pushed 9y agoCompare

[ Source](https://github.com/mrclay/elgg-url-sniffer)[ Packagist](https://packagist.org/packages/mrclay/elgg-url-sniffer)[ RSS](/packages/mrclay-elgg-url-sniffer/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (6)Used By (2)

elgg-url-sniffer
================

[](#elgg-url-sniffer)

Analyze a URL to see if it's within an Elgg site, is an action/page, likely represents a GUID, etc.

```
$site_url = new \UFCOE\Elgg\SiteUrl('http://example.org/my-elgg-site/');

$path = $site_url->getSitePath($given_url);
if (!$path) {
    // URL is not within Elgg site
    // e.g. 'https://example.org/my-elgg-site/' (scheme mismatch)
    // e.g. 'http://example.com/my-elgg-site/' (host mismatch)
    // e.g. 'http://example.org/other-path' (not in site path)
    return;
}

// let's say URL was http://example.org/my-elgg-site/blog/view/1234/my-friendly-title

// URL segments within the site. ["blog", "view", "1234", "my-friendly-title"]
$path->getUrlSegments();

// path within the site. Here "blog/view/1234/my-friendly-title"
$path->getPath();

// URL corresponds to a GUID. Here 1234
$path->getGuid();

// URL corresponds to a container GUID. Here 0 (unknown)
$path->getContainerGuid();

// an action name. e.g. "profile/edit", Here null
$path->getAction();

// a username if a profile page or null
$path->getUsername();

// test whether the path is within a given one
$path->isWithinPath("blog"); // is any blog view page, so true
$path->isWithinPath("blo");  // first URL segment must be "blo", so false
$path->isWithinPath("blog/view");  // is any blog view page, so true
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~77 days

Total

5

Last Release

3592d ago

Major Versions

1.0.0 → 2.0.02016-07-29

2.0.1 → 3.0.02016-08-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb9f7ec61e604d89a53f7505dab67dbe8df1be784fe2dda6901d9c5aaad4a2c4?d=identicon)[mrclay](/maintainers/mrclay)

---

Top Contributors

[![mrclay](https://avatars.githubusercontent.com/u/170687?v=4)](https://github.com/mrclay "mrclay (14 commits)")

---

Tags

urlelggroutinganalyzesniff

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mrclay-elgg-url-sniffer/health.svg)

```
[![Health](https://phpackages.com/badges/mrclay-elgg-url-sniffer/health.svg)](https://phpackages.com/packages/mrclay-elgg-url-sniffer)
```

###  Alternatives

[spatie/url

Parse, build and manipulate URL's

74015.2M115](/packages/spatie-url)[league/uri-components

URI components manipulation library

31937.4M89](/packages/league-uri-components)[sabre/uri

Functions for making sense out of URIs.

29436.8M44](/packages/sabre-uri)[spomky-labs/base64url

Base 64 URL Safe Encoding/Decoding PHP Library

15441.7M57](/packages/spomky-labs-base64url)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

41515.2k](/packages/wazum-sluggi)[illuminatech/url-trailing-slash

Allows enforcing URL routes with or without trailing slash

48228.5k](/packages/illuminatech-url-trailing-slash)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
