Download the PHP package crecket/dependency-manager without Composer
On this page you can find all versions of the php package crecket/dependency-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crecket/dependency-manager
More information about crecket/dependency-manager
Files in crecket/dependency-manager
Package dependency-manager
Short Description Resource dependency manager
License WTFPL
Homepage https://github.com/Crecket/dependency-manager
Informations about the package dependency-manager
dependency-manager
Introduction
A simple and small dependency manager for javascript and CSS files. All files will be combined, minified and cached. Less and Scss files are also supported and all css output is run through a auto-prefixer.
Requirements
- matthiasmullie/minify ^1.3
- doctrine/cache ^1.6
- leafo/scssphp ^0.6.3
- tedivm/jshrink ^1.1
- leafo/lessphp ^0.5.0
- twig/twig ^1.23
- css-crush/css-crush ^dev-master
Installation
-
Install with composer
composer require crecket/dependency-manager
-
Add the twig extension to your twig view:
$twig->addExtension(new Crecket\DependencyManager\Response());
Usage
Adding new files
addFiles($fileList, $groupName);
- PARAM1: enter a single string to a file location or a array with multiple files.
- PARAM2: the group name, this way you can store multiple file groups
Remove files
removeFiles($groupName);
- PARAM1: contains the file group name.
Create a url
Twig: getFilesLink(minify, groupName)
- PARAM1: Minify the files or not
- PARAM2: Group name
PHP: getFilesLink(
- PARAM1: Minify the files or not
- PARAM2: Group name
Response
Standard php example
Silex route example
You can quite easily use the url generator in silex to create a url to this route using
or without twig
Next create a route:
Debugging
Response takes a optional second parameter which will make sure the session storage and secret key are ignored. This can be a hash id to retrieve the files stored in the session, or a direct array with files
Or get the hash value directly to use in a route/url generator.
Security
To ensure only you can create a file list add a secret key. Make sure this key is secure/long enough!
Issues
Font files in Css
External font files, for example bootstrap's Glyphicons my return 404 errors because the path has changed. These can usually be fixed by copying the font files and moving them to a /fonts
folder in your web root.
All versions of dependency-manager with dependencies
doctrine/cache Version ^1.6
leafo/scssphp Version ^0.6
tedivm/jshrink Version ^1.1
twig/twig Version ^1.23
oyejorge/less.php Version v1.7.0.10