PHPackages                             sitegeist/base-url - 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. sitegeist/base-url

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

sitegeist/base-url
==================

Determinates base URL from site configurations for scripts where no FE or BE context is available like commands or tasks

v1.1.7(2y ago)227.7k1[1 issues](https://github.com/sitegeist/base-url/issues)[1 PRs](https://github.com/sitegeist/base-url/pulls)GPL-2.0-or-laterPHPPHP &gt;=7.2.0

Since Aug 19Pushed 2y ago3 watchersCompare

[ Source](https://github.com/sitegeist/base-url)[ Packagist](https://packagist.org/packages/sitegeist/base-url)[ RSS](/packages/sitegeist-base-url/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (3)Versions (13)Used By (0)

Base URL for TYPO3 commands and tasks
=====================================

[](#base-url-for-typo3-commands-and-tasks)

In in scripts where no FE or BE context is available and you want to build URLs its a good idea to get the absolute URL from a site configuration. This extension provides a helper class to get there.

Where to use
------------

[](#where-to-use)

- commands which are called via cli
- scheduler tasks

Features
--------

[](#features)

- get base URL depending on site configurations
- absolute a relative URL

Getting Started
---------------

[](#getting-started)

use the static functions from `BaseUrl` helper Class

```
\Sitegeist\BaseUrl\Helper\BaseUrl::get(); // https://example.com/
```

```
\Sitegeist\BaseUrl\Helper\BaseUrl::prepend('home.html'); // https://example.com/home.html
```

use the viewhelpers in your fluid templates e. g. for mails

```

```

```
home.html
```

Multiple site configuration setups
----------------------------------

[](#multiple-site-configuration-setups)

if your system has more than one site configuration, you can specify which site configuration should be used by:

- specify site configuration identifier

    ```
    BaseUrl::get('mysite');
    BaseUrl::prepend('home.html', 'mysite');
    ```

    ```

    home.html
    ```
- specify a pageUid (anywhere in the pageTree)

    ```
    BaseUrl::get(null, 1);
    BaseUrl::prepend('home.html', null, 1);
    ```

    ```

    home.html
    ```

Getting further
---------------

[](#getting-further)

Disable `$asString` return type to get an `TYPO3\CMS\Core\Http\Uri` object. Now you can get or change specific parts of the url.

```
BaseUrl::get(null, null, true, false);

BaseUrl::prepend('home.html', null, null, true, false);
/*
TYPO3\CMS\Core\Http\Uri prototype object
   scheme => protected "https" (5 chars)
   supportedSchemes => protected array(2 items)
      http => 80 (integer)
      https => 443 (integer)
   authority => protected "" (0 chars)
   userInfo => protected "" (0 chars)
   host => protected "example.com" (11 chars)
   port => protected NULL
   path => protected "home.html" (9 chars)
   query => protected "" (0 chars)
   fragment => protected NULL
*/
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86% 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 ~165 days

Recently: every ~257 days

Total

9

Last Release

821d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.2.0 &lt;8

v1.1.5PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/51e0a02d8e12b73949ec858638aa7e295e103022cc5a879f86ac8532c2c170bd?d=identicon)[sitegeist](/maintainers/sitegeist)

![](https://www.gravatar.com/avatar/3417112414b1e0e135fb48a511e90178dbf2275af7dc6178250b7123eff0a026?d=identicon)[Ulrich Mathes](/maintainers/Ulrich%20Mathes)

---

Top Contributors

[![ulrichmathes](https://avatars.githubusercontent.com/u/26324456?v=4)](https://github.com/ulrichmathes "ulrichmathes (37 commits)")[![s2b](https://avatars.githubusercontent.com/u/458524?v=4)](https://github.com/s2b "s2b (2 commits)")[![MaxAmann-sitegeist](https://avatars.githubusercontent.com/u/165805977?v=4)](https://github.com/MaxAmann-sitegeist "MaxAmann-sitegeist (1 commits)")[![mnediw](https://avatars.githubusercontent.com/u/43402899?v=4)](https://github.com/mnediw "mnediw (1 commits)")[![neumann-sitegeist](https://avatars.githubusercontent.com/u/115168454?v=4)](https://github.com/neumann-sitegeist "neumann-sitegeist (1 commits)")[![OleksandrMatsko](https://avatars.githubusercontent.com/u/108868156?v=4)](https://github.com/OleksandrMatsko "OleksandrMatsko (1 commits)")

---

Tags

typo3typo3-extensionuriurltypo3typo3-extensionbase urlabsolute url

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sitegeist-base-url/health.svg)

```
[![Health](https://phpackages.com/badges/sitegeist-base-url/health.svg)](https://phpackages.com/packages/sitegeist-base-url)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[typo3/cms-styleguide

TYPO3 extension to showcase TYPO3 Backend capabilities

106760.3k33](/packages/typo3-cms-styleguide)[wazum/sluggi

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

40529.5k](/packages/wazum-sluggi)[brotkrueml/schema

Embedding schema.org vocabulary - API and view helpers for schema.org markup

34653.7k16](/packages/brotkrueml-schema)[jweiland/events2

Events 2 - Create single and recurring events

2166.7k3](/packages/jweiland-events2)[in2code/lux

Living User eXperience - LUX - the Marketing Automation tool for TYPO3.

2158.6k1](/packages/in2code-lux)

PHPackages © 2026

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