PHPackages                             vanilla/garden-sites - 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. [Admin Panels](/categories/admin)
4. /
5. vanilla/garden-sites

ActiveLibrary[Admin Panels](/categories/admin)

vanilla/garden-sites
====================

Package containing interfaces and implementations for local and hosted vanilla forums sites management and definitions.

v3.0.1(3d ago)1174.1k↓12.3%1proprietaryPHPPHP &gt;=8.0CI passing

Since Sep 8Pushed 3d ago2 watchersCompare

[ Source](https://github.com/vanilla/garden-sites)[ Packagist](https://packagist.org/packages/vanilla/garden-sites)[ RSS](/packages/vanilla-garden-sites/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (24)Versions (31)Used By (0)

vanilla/garden-sites
====================

[](#vanillagarden-sites)

Library for managing providing a list of sites and clusters from localhost or an orchestration server.

Installation
------------

[](#installation)

```
composer require vanilla/garden-sites
```

Usage
-----

[](#usage)

The entrypoint to usage of this library is through either the `Garden\Sites\LocalSiteProvider`, `Garden\Sites\DashboardSiteProvider`, `Garden\Sites\OrchSiteProvider`.

### Configuring in Laravel

[](#configuring-in-laravel)

To configure this library in Laravel you need to setup the following 2 things.

**conf/orch.php**

```
use Garden\Sites\LaravelProviderFactory;

// This will inject your env variables into laravel config.
return LaravelProviderFactory::createLaravelConfigFromEnv("env");
```

**Usage in the app**

```
use Garden\Sites\LaravelProviderFactory;use Garden\Sites\SiteProvider;

/** @var SiteProvider $provider */
$provider = LaravelProviderFactory::providerFromLaravelConfig([\Config::class, 'get'])

/**
 * Site providers do various caching of results. By default an in-memory cache is used, but especially with an orch-client
 * it is recommended to configure a persistent cache like memcached or redis.
 * Caches must implement {@link CacheInterface}
 */

$cache = new RedisAdapter(/** Configuration here. */);
// or
$cache = new MemcachedAdapter(/** Configuration here. */);

$provider->setCache($cache);
```

### LocalSiteProvider

[](#localsiteprovider)

This provider reads site configurations from a local directory. The provider is configured with a path to the directory containing the site configurations.

**.env**

```
ORCH_TYPE="local"
ORCH_LOCAL_DIRECTORY_PATH="/path/to/site/configs"
```

Notably the path to the site configs must be a readable directory to the PHP process.

The local site provider works be reading php-based config files from a given directory. This reads all sites recognized by the `vnla docker` setup. For a site config to be recognized it must meet the following criteria

- The file has name matching one of the following patterns
    - `/*.php` - Becomes `*.vanilla.local`
    - `/vanilla.local/*.php` - Becomes `vanilla.local/*`
    - `/e2e-tests.vanilla.local/*.php` - Becomes `e2e-tests.vanilla.local/*`
- The file contains a valid PHP configuration files.
- The configuration contains the following values
    - `Vanilla.SiteID`
    - `Vanilla.AccountID`
    - Optional `Vanilla.ClusterID`. Defaults to `cl00000`

**Clusters**

By default all local sites are on the same cluster `cl00000`. You can bypass this by adding a `Vanilla.ClusterID` config to the site.

Cluster configurations may be added into the configs `/clusters` directory and are named `/clusters/cl*.php`. These should php config files just like sites. The configurations in these files will be merged with the site configs.

### OrchSiteProvider

[](#orchsiteprovider)

The orch site provider loads sites and clusters from a remote orchestration http server. Sites, clusters, and configs are cached for a 1 minute period.

**.env**

```
ORCH_TYPE="orchestration"
ORCH_BASE_URL="https://orchestration.vanilladev.com"
ORCH_SECRET="SECRET_HERE"
# Optional hostname to force for orchestration (Force Proxy from localhost)
ORCH_HOSTNAME="ORCH_HOSTNAME";
# CSV of region IDs to accept sites from.
ORCH_REGION_IDS="yul1-prod1,sjc1-prod1";
ORCH_USER_AGENT="my-service";
```

### DashboardSiteProvider

[](#dashboardsiteprovider)

The orch site provider loads sites and clusters from a remote management-dashboard http server. Sites, clusters, and configs are cached for a 1 minute period.

**.env**

```
ORCH_TYPE="dashboard"
ORCH_BASE_URL="https://management-dashboard.vanilladev.com"
# JWT secret for management dashboard
ORCH_SECRET="SECRET_HERE"
# Optional hostname to force for management dashboard (Force Proxy from localhost)
ORCH_HOSTNAME="ORCH_HOSTNAME";
# CSV of region IDs to accept sites from.
ORCH_REGION_IDS="yul1-prod1,sjc1-prod1";
ORCH_USER_AGENT="my-service";
```

### Using site providers

[](#using-site-providers)

Both `OrchSiteProvider` and `LocalSiteProvider` extend from `SiteProvider` and implement similar functionality.

```
use Garden\Sites\Exceptions\ClusterNotFoundException;
use Garden\Sites\Exceptions\SiteNotFoundException;
use Garden\Sites\SiteProvider;

function doSomethingWithProvider(SiteProvider $siteProvider)
{
    /**
     * Look up a site by ID.
     * Can throw an {@link SiteNotFoundException}
     */
    $site = $siteProvider->getSite(100);

    // List all sites
    $allSites = $siteProvider->getSites();

    /**
     * Look up a cluster by ID.
     * Can throw an {@link ClusterNotFoundException}
     */
    $cluster = $siteProvider->getCluster("cl10001");

    // List all clusters
    $allClusters = $siteProvider->getClusters();
}
```

### Using Clusters and Sites

[](#using-clusters-and-sites)

```
use Garden\Sites\Site;
use Garden\Sites\Cluster;

function doSomethingWithCluster(Cluster $cluster)
{
    // A few getters
    $clusterID = $cluster->getClusterID();
    $regionID = $cluster->getRegionID();
}

function doSomethingWithSite(Site $site)
{
    // A few getters
    $siteID = $site->getSiteID();
    $accountID = $site->getAccountID();
    $clusterID = $site->getClusterID();
    $baseUrl = $site->getBaseUrl();

    // HTTP Requests
    // This is a `garden-http` configured with the site's baseUrl
    // and set to throw on errors.
    $response = $site->httpClient()->get("/url", ["query" => "params"]);
    $response = $site->httpClient()->post("/url", ["body" => "here"]);
    $response = $site->httpClient()->patch("/url", ["body" => "here"]);
    $response = $site->httpClient()->put("/url", ["body" => "here"]);
    $response = $site->httpClient()->delete("/url");

    // System auth for an http request
    $site
        ->httpClient()
        ->withSystemAuth()
        ->get("/some-resource");

    // Ensure there is no auth on a request
    $site
        ->httpClient()
        ->withNoAuth()
        ->get("/some-resource");

    // Access the cluster
    $cluster = $site->getCluster();

    // Configs
    $configVal = $site->getConfigValueByKey("some.key.here", "fallback");

    // Configs are cached on the `Garden\Sites\Site` instance
    // You can clear them here.
    $site->clearConfigCache();

    // Check services hostnames the site should be using.
    $baseUrl = $site->getQueueServiceBaseUrl();
    $baseUrl = $site->getSearchServiceBaseUrl();
}
```

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance99

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~39 days

Recently: every ~85 days

Total

27

Last Release

3d ago

Major Versions

v1.6.0 → v2.0.02024-10-28

v2.4 → v3.02026-05-20

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v2.0.0PHP &gt;=8.0

### Community

Maintainers

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

---

Top Contributors

[![acharron-hl](https://avatars.githubusercontent.com/u/146114816?v=4)](https://github.com/acharron-hl "acharron-hl (16 commits)")[![charrondev](https://avatars.githubusercontent.com/u/1770056?v=4)](https://github.com/charrondev "charrondev (14 commits)")[![maximepoulin-hl](https://avatars.githubusercontent.com/u/70532110?v=4)](https://github.com/maximepoulin-hl "maximepoulin-hl (3 commits)")[![OlivierLamyCanuel](https://avatars.githubusercontent.com/u/39598345?v=4)](https://github.com/OlivierLamyCanuel "OlivierLamyCanuel (1 commits)")

---

Tags

production

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vanilla-garden-sites/health.svg)

```
[![Health](https://phpackages.com/badges/vanilla-garden-sites/health.svg)](https://phpackages.com/packages/vanilla-garden-sites)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[google/auth

Google Auth Library for PHP

1.4k294.2M218](/packages/google-auth)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/administration

Administration frontend for the Shopware Core

414.3M116](/packages/shopware-administration)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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