Download the PHP package cooltronicpl/craft-files-autoversioning without Composer

On this page you can find all versions of the php package cooltronicpl/craft-files-autoversioning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-files-autoversioning

Static Files Autoversioning Plugin for Craft CMS

This plugin is a Twig extension that helps you cache-bust your static assets, such as CSS, JS, images, videos, or PDFs. It appends a version number to the asset URL, based on either a build number or the file’s last modified time. This ensures that your users always receive the most recent version of your files, without having to clear their browser cache.

Table of Contents

  1. Features
  2. Installation
  3. Usage
  4. Advanced Usage
    • Versioning from a String
    • Versioning from a Timestamp
    • Versioning from a Custom Text File
    • Versioning with PDF Generator or Varnish Cache
    • Note about paths
  5. License
  6. Credits

Features

Installation

You can install this plugin from the Craft Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store section of your Craft control panel and search for “Static Files Autoversioning”. Then click on the “Install” button in its modal window.

Project Setup

To install the plugin, navigate to your Craft project in your terminal:

Usage

To use this plugin, you need to call the version() function in your template, passing the asset path as an argument. For example:

This will output something like:

The version number (v=12345678) is determined by reading a file named build.txt in your root project folder (alongside config, templates, etc.). You can create and update this file using your deployment script. For instance, if you’re using CodeShip, you can use the following command:

Advanced Usage

Versioning from a String

If you want to use a custom string as the version number, you can use the versionString() function, passing the asset path and the string as arguments. For example:

This will output something like:

Versioning from a Timestamp

If you want to use the file’s last modified time as the version number, regardless of the existence of the build.txt file, you can use the versionTimestamp() function, passing the asset path as an argument. For example:

This will output something like:

Versioning from a Custom Text File

If you want to use the content of a custom text file as the version number, you can use the versionCustom() function, passing the asset path and the text file name as arguments. The text file should be located in your root project folder. For example:

This will output something like:

Assuming that the mods.txt file contains the word “modded”.

Versioning with PDF Generator or Varnish Cache

You can also use this plugin with PDF Generator when your hosting or server is caching PDF files. Or your files are cached by caching plugins like Varnish Cache.

This will output something like:

This generates a PDF with a version number, solving any caching policy issues with your hosting.

Note about paths

By default, the plugin searches for files to version in the @webroot directory, and for the build.txt or custom text file in the @root path.

Note: You can learn more about the @webroot and @root aliases and how to configure them in the Craft CMS documentation.

License

This plugin is licensed under the GPLv3 license.

Credits

This plugin is brought to you with love by CoolTRONIC.pl sp. z o.o. (LLC) Interactive Agency and Pawel Potacki.


All versions of craft-files-autoversioning with dependencies

PHP Build Version
Package Version
Requires craftcms/cms Version ^5.0.0.alpha|^4.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cooltronicpl/craft-files-autoversioning contains the following files

Loading the files please wait ....