Download the PHP package hkt/psr7-asset without Composer

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

Psr7Asset

Asset management for PHP. This package is a fork of Aura.Asset_Bundle.

Foreword

Requirements

Installation

You can use any psr-17 libraries.

Tests

Build Status

or you may use;

PSR Compliance

This attempts to comply with PSR-1, PSR-2, PSR-4, PSR-7, PSR-15 and PSR-17. If you notice compliance oversights, please send a patch via pull request.

Structure of Package

Assume you have a Vendor.Package. Your assets can be any where. Consider it is in the public folder. The folder names css, images, js can be according to your preffered name.

Assuming you have the same structure, now in your template you can point to /asset/vendor/package/css/some.css, /asset/vendor/package/js/hello.js, /asset/vendor/package/images/another.jpg.

Routing

The library can be used with any framework. So it makes use of preg_match under the hood. The default regular expression is /\/asset\/([a-zA-Z0-9-_]+)\/([a-zA-Z0-9-_]+)\/(.*)/ .

You can modify the regular expression when intantiating the Router object which is passed as 3rd argument to AssetAction.

Zend Expressive

If you are using `zend expressive you can configure,

AuraRouter

FastRoute

NB : Make sure you have set the service Hkt\Psr7Asset\AssetAction to the Di container.

From your view you can use as

This will return /asset/vendor/package/css/bootstrap.min.css.

Mapping

With the help of mapping the vendor/package or directly the path you can alter the result it returns.

Eg :

Overriding css, js, images

Like puli it is possible that you can override the style sheet, images, js etc for the downloaded package. You just need to map it. No magic under the hood.

Eg :

Caching

The asset files are served by PHP. There is an experimental repo https://github.com/harikt/psr7-asset-cache that can do caching. So files can be served by the web server itself.

Configuration via Aura.Di

Pass Hkt\Psr7Asset\Container\AssetConfig to your Container Builder. Don't forget to set the service Interop\Http\Factory\ResponseFactoryInterface as below.


All versions of psr7-asset with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0
psr/http-server-middleware Version ^1.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 hkt/psr7-asset contains the following files

Loading the files please wait ....