hultberg / mexifest
A manifest.json reader
Installs: 11 219
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- league/flysystem: ^1.0
Requires (Dev)
- hultberg/phpstan-shim: ^0.10.2
- phpunit/phpunit: ^7.2
README
A simple asset manager that parses manifest files for php.
Requires php 7.1.
Install
$ composer require hultberg/mexifest
Usage
manifest.json
{ "app.js": "js/app.js", "app.css": "css/app.css" }
app.php
<?php require __DIR__ . '/vendor/autoload.php'; use Hultberg\Mexifest\AssetManager; use Hultberg\Mexifest\WebpackManifestParser; use League\Flysystem\Adapter\Local as LocalAdapter; use League\Flysystem\Filesystem; $fs = new Filesystem(new LocalAdapter(__DIR__)); $am = new AssetManager((new WebpackManifestParser($fs, 'manifest.json'))->parse()); /* Output: [ ['app.js', 'js/app.js', 'js'], ] */ var_dump($am->findByName('app.js')); /* Output: [ ['app.css', 'css/app.css'], ] */ var_dump($am->findByExtension('css'));
License
MIT, see LICENSE.md provided in repo.