Download the PHP package hostnet/asset-lib without Composer

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

Note: Due to the fast changing ecosystem and better javascript support in popular frameworks, this lib has been deprecated with no direct alternative.


Build Status

Assets can be manged in different ways. This project aims to provide a way to build assets incrementally without the need of specialized tools such as watchers and therefore requires no change in your development workflow.

This library allows you to create a generic asset pipeline and also provides some built-in processors to get you started quickly.

Core features are:

Why use this over webpack?

This project allows for incremental changes without the need for a watcher. Moreover, because the code to check for changes is build in PHP, it has very little overhead when integrated into a PHP development workflow.

Why not use a watcher?

Watchers are great if you develop a single project. However, the resource usage can grow when having multiple project. Building assets (in development) when reloading a page only taxes your system when actually needed.

Installation

Instalation can be done using composer:

Usage

In the following example we have a setup for building multiple JS files into one large JS file and we added support for less.

For our input we have:

This will output:

Using the following snippet to build the assets. It is recommended to add it to something like a front-controller to build every time a request comes in so once a response comes back, all your assets are ready.

The project root should be the folder which contains your package.json and composer.json.

For the Symfony framework integration already exists in the form of the asset-bundle.

Including the made javascript

To use the entry-points, you need to do:

  1. Include the outputted require.js file in the head of your HTML files
  2. Include the outputted assets (in the example dist/app.js)
  3. require the entry point module.

As an example:

Built-in processors

The library comes with some built-in processors to get you started more quickly with common tasks. These are:

Creating your own plugin

If the built-in support is not sufficent enough, you can add your own by creating a plugin. You do this by implementing the Hostnet\Component\Resolver\Plugin\PluginInterface interface and adding your class to the configuration.

BuildStep classes

Each build step represent a processing action for either a file or a module. This can be converting typescript to javascript, uglification or anything other that needs to be done to a file before it can be outputted.

See Hostnet\Component\Resolver\Builder\AbstractBuildStep for more information.

ImportCollector classes

Each import collector is responsible for finding additional files to include in the build steps so your assets will work correctly. All files returned by the collector will be tracked for changes. For instance, imported javascript files or fonts in stylesheets etc.

See Hostnet\Component\Resolver\Import\ImportCollectorInterface for more information.

Writer classes

Each writer will write the content of a generated asset to disk. Having multiple writers means you can write the file in different formats. For instance, you might want to output a gziped version of a file if your web-server does not gzip this natively.

See Hostnet\Component\Resolver\Builder\AbstractWriter for more information.

License

The hostnet/asset-lib is licensed under the MIT License, meaning you can reuse the code within proprietary software provided that all copies of the licensed software include a copy of the MIT License terms and the copyright notice.

Get in touch


All versions of asset-lib with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
psr/log Version ^1.0.0
psr/simple-cache Version ^1.0.0
symfony/console Version ^4.0.0 || ^5.0.0
symfony/event-dispatcher Version ^4.0.0 || ^5.0.0
symfony/process Version ^4.2.8 || ^5.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 hostnet/asset-lib contains the following files

Loading the files please wait ....