Download the PHP package dimezilla/wp_manifest_loader without Composer

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

WordPress Manifest Loader

This library provides a simple class that will read a manifest.json and automatically register and enqueue the scripts found within.

A manifest.json is typically a file that is produced by a bundler like webpack as part of a production build. It could be something that looks like this:

Installation

Install via composer:

Basic Usage

It's pretty simple. For the purpose of the following example, I'm going to assume that you are using this in a plugin.

1) The first thing you should do is create the class:

Here's all of the arguments that the assetloader takes in the order in which they are accepted:

In the above example, we are telling the asset loader that the url is the wordpress generated url for the plugin project's path. Then we are telling the asset loader that the directory path to our project is this current directory of our file. Next we are telling the loader that the plugin tag prefix is 'radcampaign'. This means that the asset loader will ascribe a handle prefixed with 'radcampaign/' for let's say a file called main.js. Thus the handle would be 'radcampaign/main.js'. So if you want o use it as a script dependency later, in another script, this is how you would use it.

2) Next, call registerAssets inside some sort of wp_enqueue_scripts hook

registerAssets by default automatically enqueues the assets it finds. To prevent this from happening you can call register assets like so:

Advanced Usage

Asset Specific Configuration

This package has support for a asset-loader.config.json to be placed in the same director as the $plugin_path setting when the class is instantiated. This file must be valid json and is a dictionary keyed by the script key found in the manifest file. Borrowing from our example above, here's what a possible configuration might look like:

This file would register our main.js script with the jquery and lodash dependencies. It would assign a version of 0.1, and load the script in the footer. This would also register main.css with the a bootstrap dependency, give it a version of 1.0 and specify a "screen" media for the css.

Instantiating the loader

You don't have to use new MANIFEST_LOADER\AssetLoader to craete the class. You can also create it through it's static method MANIFEST_LOADER\AssetLoader::create. This method takes all of the same arguments as the __construct method.

Deferring the reading of local files

By default, when the loader is created, it will load config if an asset-loader.config.json is found. It will also try and find the manifest file and read that as well. You can turn this behavior off when creating the class by doing the following:

assetURL & assetPath

After the manifest has been loaded, you can get any of the file paths or urls by running the following

Changing initial configuration

If after you create the loader you want to do something like lets say changing the default version used you can use one of the setters to change. In this case you can run $loader->setVersion('2.5'); and this will change the default version to "2.5". You can use a getter function retrieve the default version by running $loader->getVersion(); and this will return the instance default version. All of the setters return the class instance so that you may chain them like this:

Here's all of the setters and their corresponding getters:

Again all of these set functions return the class instance. All of the get functions take no arguments and return the value.


All versions of wp_manifest_loader with dependencies

PHP Build Version
Package Version
No informations.
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 dimezilla/wp_manifest_loader contains the following files

Loading the files please wait ....