Skip to content

stuartloxton/php-sprockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

PHP Sprocket

PHP Sprocket is a port of Sprockets – the ruby library for Javascript dependency management and concatenation. For syntax instructions visit http://getsprockets.org/installation_and_usage.

1. If you already have a .htaccess file then add the rules that come with phpsprocket into it and change the path to point to phpsprocket.
2. Change the top variables in phpsprocket.php to reflect your settings.
3. Enjoy clean JavaScript

Changes to the original sprockets.

PHP Sprockets currently acts as a transparent proxy as default and caches results. Because of this you do not have to initialize any classes in your app and sprocket stays separate.

For constants you can use either <%= or <?= this is to make the syntax closer to PHP’s but still keep compatibility with original sprocket files.

By adding ?debug to the URL of a javascript file it stops any cacheing taking place.

Planned/Proposed Changed

1. Flag directives, e.g. //= flag “gzip:true” would gzip the JS, possible flags: stripcomments, minify and gzip.

About

A PHP implementation of Sprockets - The Ruby system for JS concatenation. Features built in Cacheing system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages