Download the PHP package dorsetdigital/silverstripe-enhanced-requirements without Composer

On this page you can find all versions of the php package dorsetdigital/silverstripe-enhanced-requirements. 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 silverstripe-enhanced-requirements

silverstripe-enhanced-requirements

Extends and enhances the Silverstripe requirements system, providing inlining of assets, http/2 server push, deferred css, etc.

Note: This module is designed to provide a number of tools which may help to improve the front-end performance of a website. It is not an 'off-the-shelf' solution, and should be used carefully. Just setting everything to preload or push, or inlining content without first analysing where and how it's used can lead to a reduction in performance!

Requirements

*Silverstripe 4.x / 5.x

Installation

Install with composer require dorsetdigital/silverstripe-enhanced-requirements ^1

Once installed, the module will set the Requirements system to use the enhanced backend, but none of the additional features will be enabled by default.

Usage

The module extends the standard Requirements methods, providing additional options. Currently, these additional options are available for both CSS and JS files:

The following option is also available for CSS files:

inline

When this option is set, the framework will attempt to add the provided CSS or JS file as inline code rather than being loaded externally. This allows developers to still build front-end assets with existing workflows, but inline the processed content where it is advantageous to do so:

preload

The preload option automatically adds <link rel="preload"> tags to the markup to help improve the load order of important assets

This would result in the following tag being added to the markup:

push

The push option adds HTML link headers to the response. On systems where this is supported, this will trigger a server push of the specified assets in order for them to be delivered even before the browser has completed parsing the document.

Would result in an HTTP header similar to the following being added to the response:

nonce

This adds the HTML 'nonce' attribute as required. Can be useful for dealing with CSP implementations

defer (css)

If the defer option is added to a CSS inclusion, a tag will be injected into the head of the document which loads the specified CSS file after the page has loaded. This can help to reduce page blocking for styles which are not needed for the initial rendering. In order to provide support for browsers which do not run javascript, a noscript tag is also added. The resultant output looks like this:

Tag ordering

The module does not change the ordering of tags added via the Requirements API, nor does it change the signatures of the default class methods (with the exception of adding a third parameter to the themedCSS() and themedJavascript() methods) so should be a drop-in replacement for existing code.

The preload tags are added to the page using the addHeadTags() method. By default, these are added at the bottom of the <head> section after the CSS files have been added. This behaviour may not always be desireable. If this is the case, the module can be configured to inject any custom tags before the styles / scripts are added. Since this will affect any custom tags which have been added, not just the preload tags, the result of changing this option should be tested thoroughly before deploying to production, in case of unwanted side-effects.

To set the custom tags to be injected first, use the following in the site's yml config files:


All versions of silverstripe-enhanced-requirements with dependencies

PHP Build Version
Package Version
Requires silverstripe/cms Version ^4 || ^5
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 dorsetdigital/silverstripe-enhanced-requirements contains the following files

Loading the files please wait ....