Download the PHP package wpackio/enqueue without Composer

On this page you can find all versions of the php package wpackio/enqueue. 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 enqueue

WPACK.IO Enqueue API

Build Status codecov Latest Stable Version

This is the PHP companion of @wpackio/scripts.

It gives you all the APIs you will need to properly consume assets generated from @wpackio/scripts from your WordPress plugins or themes.

Detailed Documentation

This README only covers the very basics and a quick start guide, without explaining the overall usage.

Please visit our official documentation site for detailed instruction.

Installation

Using Composer

We recommend using composer for using this library.

Then in your plugin main file or functions.php file of your theme, load composer auto-loader.

Manual

If you do not wish to use composer, then download the file Enqueue.php.

Remove the namespace line namespace WPackio; and rename the classname from Enqueue to something less generic, like MyPluginEnqueue. This ensures conflict-free loading.

Then require the file in your plugin entry-point or functions.php file of your theme.

Getting Started

Which ever way, you choose to install, you have to make sure to instantiate the class early during the entry-point of your plugin or theme.

This ensures that we hava necessary javascript in our website frontend and admin end to make webpack code-splitting and dynamic import work.

A common pattern may look like this.

Default configuration when calling enqueue

main_js_handle is added in 3.3 and can predictably set the handle of primary JavaScript file. Useful for translations etc.

runtime_js_handle is added in 3.4 and can predictably set the handle of the common runtime JavaScript. This is useful to localize/translate dependent script handles in the same files entry. By calling wp_set_script_translations on the runtime you can collectively enqueue translate json for all the dependencies on the entries.

For information on usage and API, please visit official documentation site wpack.io.

Avoid conflict in multiple WordPress Plugins

Always require the latest version of Wpackio\Enqueue. The autoloader is set to load only one instance and will not conflict with existing class.

However, if you want to load conflict free, kindly use Strauss.

Actions and Filters

Filter wpackio_print_public_path

Accepts 3 parameters:

Using this you can dynamically change the public path that is used for code splitting. This can be used to change the public path to a CDN.

Example Code to replace all wpack.io public path with a cdn url

Example Code to the change the public path url only for a specific instance of wpack.io


All versions of enqueue with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 wpackio/enqueue contains the following files

Loading the files please wait ....