Download the PHP package mathiasreker/php-script-cache without Composer
On this page you can find all versions of the php package mathiasreker/php-script-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mathiasreker/php-script-cache
More information about mathiasreker/php-script-cache
Files in mathiasreker/php-script-cache
Package php-script-cache
Short Description php-script-cache is a PHP library for caching external scripts locally.
License MIT
Homepage https://github.com/mathiasreker/php-script-cache
Informations about the package php-script-cache
PHP script cache
php-script-cache
is a PHP library for caching external scripts locally.
✅ Cache ✅ Bundle ✅ Minify
Versions & Dependencies
Version | PHP | Documentation |
---|---|---|
^1.0 | ^7.4 | current |
Requirements
PHP
>= 7.4- php-extension
ext-json
Installation
Run:
Examples
Set up a cronjob to build the assets.
Place this code where you want to output the script tags. You can add attributes to the scripts.
Documentation
Instantiate the object.
setPath
sets the path of the output folder for built files.
doMinify
minifies the content.
add
sets the attributes of the script. The src
can be an array of several scripts.
All the scripts in the collection will get bundled. You can use any attributes.
You do not need to set attributes when you build the cache.
build
builds the assets.
fetch
returns a string of the script tags.
Roadmap
See the open issues for a complete list of proposed features (and known issues).
Contributing
If you have a suggestion to improve this, please fork the repo and create a pull request. You can also open an issue with the tag "enhancement". Finally, don't forget to give the project a star! Thanks again!
Docker
If you are using docker, you can use the following command to get started:
Next, access the container:
Tools
PHP Coding Standards Fixer:
PHP Coding Standards Checker:
PHP Stan:
Unit tests:
License
It is distributed under the MIT License. See LICENSE
for more information.