webbuilders-group/silverstripe-packagistshortcode

Add a short code for adding a Packagist installs button with a count to a HTMLText field.

Installs: 41

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 1

Open Issues: 1

Type:silverstripe-vendormodule

pkg:composer/webbuilders-group/silverstripe-packagistshortcode

2.1.0 2025-06-18 18:00 UTC

This package is auto-updated.

Last update: 2025-09-26 15:08:30 UTC


README

Add a short code for adding a Packagist installs button with a count to a HTMLText field.

Maintainer Contact

Requirements

  • SilverStripe CMS ^4|^5|^6

Installation

Composer (recommended):

composer require webbuilders-group/silverstripe-packagistshortcode

If you prefer you may also install manually:

Usage

Usage is pretty straight forward to add a packagist downloads button you simply add the following:

[packagist package="package owner/package name"]

Optionally you may add mode="monthly" or button="daily" (defaults to total) to show the download count for the given period.

[packagist package="package owner/package name" mode="monthly"]

In 3.1 the short codes above will work as included however the updated syntax for the short code would be (of course layout and button are not required):

[packagist,package="package owner/package name",mode="monthly"]

Configuration Options

There are a few configuration options available to you:

SilverStripe\Core\Injector\Injector:
    Psr\SimpleCache\CacheInterface.PackagistShortCode:
        factory: SilverStripe\Core\Cache\CacheFactory
        constructor:
            namespace: "NewRelic"
            defaultLifetime: 86400 #Cache time in seconds
WebbuildersGroup\PackagistShortCode\PackagistShortCode:
    UseShortHandNumbers: true #Use short hand numbers i.e 5.6K or not