2017 © Pedro Peláez
 

silverstripe-module silverstripe-packagistshortcode

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

image

webbuilders-group/silverstripe-packagistshortcode

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

  • Wednesday, March 23, 2016
  • by WebbuildersGroup
  • Repository
  • 4 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Packagist Short Code

Add a short code for adding a Packagist installs button with a count to a HTMLText field., (*1)

Maintainer Contact

Requirements

  • SilverStripe CMS 4.x | 5.x

Installation

Composer (recommended):, (*2)

composer require webbuilders-group/silverstripe-packagistshortcode

If you prefer you may also install manually: * Download the module from here https://github.com/webbuilders-group/silverstripe-packagistshortcode/archive/master.zip * Extract the downloaded archive into your site root so that the destination folder is called githubshortcode, opening the extracted folder should contain _config.php in the root along with other files/folders * Run dev/build?flush=all to regenerate the manifest, (*3)

Usage

Usage is pretty straight forward to add a packagist downloads button you simply add the following:, (*4)

[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., (*5)

[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):, (*6)

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

Configuration Options

There are a few configuration options available to you:, (*7)

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

The Versions

23/03 2016

dev-master

9999999-dev

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

  Sources   Download

BSD-3-Clause

The Requires

 

packagist silverstripe shortcode

18/12 2013

0.1

0.1.0.0

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

  Sources   Download

BSD-3-Clause

The Requires

 

packagist silverstripe shortcode