2017 © Pedro Peláez
 

library bustersphp

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

image

mikefunk/bustersphp

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  • Thursday, May 22, 2014
  • by mikedfunk
  • Repository
  • 1 Watchers
  • 10 Stars
  • 2,433 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

Build Status, (*1)

BustersPhp

A simple class to generate js/css tags with cache names from busters.json. If you use gulp-buster to create a busters.json, it will look something like this:, (*2)

{
    "path/to/app.min.css": "f77f5bee5ef6a19bf63fe66aa0971576",
    "path/to/app.min.js": "03cbc5dc0b5b117264ae74515cd3fb76"
}

Then you can put <?=$bustersPhp->assets()?> in your view and it will display like this:, (*3)

<link href="//mysite.com/path/to/app.min.f77f5bee5ef6a19bf63fe66aa0971576.css" rel="stylesheet">
<script src="//mysite.com/path/to/app.min.03cbc5dc0b5b117264ae74515cd3fb76.js"></script>

Installation

Get composer, then put this in your composer.json in the "require" block:, (*4)

"mikefunk/bustersphp": "1.1.*"

then run composer update., (*5)

Usage

  • use gulp-buster to generate combined css/js cache files with the hash as the file name
  • add BustersPhp to your PHP application via composer: composer require MikeFunk/BustersPhp:dev-develop
  • instantiate in your php with your config passed in:
     '//'.$_SERVER['HTTP_HOST'],
        'cssTemplate'     => '',
        'jsTemplate'      => '',
        'bustersJsonPath' => $_SERVER['DOCUMENT_ROOT'].'/assets/cache/busters.json',
    );
    $bustersPhp = new BustersPhp($config);
```
* echo css/js in your view:

```php
    
    =$bustersPhp->css()?>

    <!-- js script tags -->
    <?=$bustersPhp->js()?>

    <!-- js tags and css tags -->
    <?=$bustersPhp->assets()?>

For more information check out gulp-buster, (*6)

The Versions

22/05 2014

dev-master

9999999-dev

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

22/05 2014

dev-develop

dev-develop

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

22/05 2014

1.1.5

1.1.5.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

12/05 2014

1.1.4

1.1.4.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

08/05 2014

1.1.3

1.1.3.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

08/05 2014

1.1.2

1.1.2.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

09/04 2014

1.1.1

1.1.1.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk

09/04 2014

1.0.0

1.0.0.0

A simple class to generate js/css tags with cache names from busters.json. This is related to gulp-buster.

  Sources   Download

MIT

The Development Requires

by Mike Funk