Download the PHP package gears/assetmini without Composer

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

AssetMini - now deprecated see: https://github.com/phpgearbox/asset

PHP based js and css asset minification.

This project is all about making your JS and CSS assets mini. Yes there are plenty others out there that do a similar sort of thing. How do we differ, what features do we offer:

How to Install

Installation via composer is easy:

composer require gears/assetmini:*

How do I use it?

First up when you install assetmini it will attempt to create an assets folder in your project root dir, if the folder doesn't already exist. Don't worry we won't overwrite anything.

If you would like to place the assets folder else where please add the following to your file. Note this is just an example.

The assets folder however you create it should look like the 'skel' folder of this project.

Also note that the cache folder will need to be writable by PHP.

Apache should work out of the box. This is done by the inclusion of a .htaccess file. If using the view helper this will even update the .htaccess file to have the correct RewriteBase path.

To configure for Nginx, you could use the following:

This block will catch any minified css or js requests. We use the try_files to test for an already minified version, if this does not exist we will get php to make it for us. Make sure you point nginx to the correct location of min.php

Once your PHP server is setup and working with the appropriate re-writes then you can use the view helper like so:

A note about the AssetMini scope. Composer will load a file called , all this does is checks to see if a class called already exists in the global scope. If not it uses the function to alias the class to .

This means that you no longer have to place the following in each php script you need to use AssetMini:

I am in two minds about this functionality and open to peoples thoughts. If you think this is stupidly silly let me know...

Manually Setting Paths

For most setups AssetMini will hopefully guess the base url and path for your project but if not you may need to do this yourself.

To set the base url:

To set the base path:

A few things to note:

Dot Notation Folder/File Names

First up I will say if you are familiar with Laravel this works basically the same as specifying a View name. I could ramble on here for a while but I feel like it's easier to show with an example.

Lets say your assets folder looks like this:

To load those assets the php would be:

Pre Minified Assets

Now if you have used some sort of minfication before you are probably all to familar with the situation where it works fine unminified but the second you minify your code it all breaks and fails.

No 2 minification programs are made the same while one might work and the other won't on the same source code. I do really like AssetMini thats for sure but I am the first to admit sometimes even we can't get it right.

Anyway I didn't write the minfication code, you can thank Robert Hafner and Joe Scylla for that... and send them all the bugs hahaha :)

Back on topic. To get around this issue you can provide a pre minified asset. Just make sure the filename contains '.min.' and we will bypass the minification process. We still combine the file with any other assets and also gzip compress it.

Laravel Integration

I have now included a ServiceProvider and Facade for Laravel. All you need to do in your Laravel project is require assetmini as above. And then add the following to your main file.

Making Contributions

This project is first and foremost a tool to help me create awesome websites. Thus naturally I am going to tailor for my use. I am just one of those really kind people that have decided to share my code so I feel warm and fuzzy inside. Thats what Open Source is all about, right :)

If you feel like you have some awesome new feature, or have found a bug I have overlooked I would be more than happy to hear from you. Simply create a new issue on the github project and optionally send me a pull request.


Developed by Brad Jones - [email protected]


All versions of assetmini with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
gears/installer Version *
gears/string Version *
tedivm/jshrink Version *
natxet/cssmin Version *
oyejorge/less.php Version *
leafo/scssphp Version *
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 gears/assetmini contains the following files

Loading the files please wait ....