Munee: Standalone PHP 5.3 Asset Optimisation & Manipulation
#####On-The-Fly Image Resizing, On-the-fly LESS, SCSS, CoffeeScript Compiling, CSS & JavaScript Combining/Minifying, and Smart Client Side and Server Side Caching
#####On-The-Fly Image Resizing, On-the-fly LESS, SCSS, CoffeeScript Compiling, CSS & JavaScript Combining/Minifying, and Smart Client Side and Server Side Caching
Hello the original css code is background-image: url('../img/logo.png'); and after Munee the css code chenge to background-image: url(/themes/default/img/logo.png); "WRONG PATH AND IMAGES NOT WORKING".
in the same CSS if the background path is 'images/demo.jpg' after Munee the code path remain the same and working.
The fixRelativeImagePaths have some issues.
bugHi Cody,
Great work! Munee has become a standard asset in my projects very quickly.
Previously I experimented with http://adaptive-images.com/ to serve appropriately sized images to devices. I'm trying to find a way to replicate this with munee.
In short: I'd like to be able to set munee to an exact width (max device screen width) and have it resize all image output to that size. Would a dispacher option work for that?
enhancementI have tried munee now, but I still seem to miss something.
Folder structure:
Base is a subdir under the doc root:
<DOCUMENTROOT>/sub1/sub2
CSS files are placed in a subdir:
<DOCUMENTROOT>/sub1/sub2/templates/freshcat/css/default
Munee is located in a different sub folder:
<DOCUMENTROOT>/sub1/sub2/lib_munee/munee.php
The only file loaded is index.css
, which contains a bunch of @import
s.
@import url(reset.css);
@import url(webfont.css);
@import url(colors.css);
...
Result is a minified index.css
, but the files that are imported are not minified. Is this by design, or do I have to tweak my config?
define('MUNEE_FOLDER','<DOCUMENTROOT>/sub1/sub2/lib_munee'));
define('MUNEE_CACHE' ,'<DOCUMENTROOT>/sub1/sub2/temp/cache'));
define('DS' ,DIRECTORY_SEPARATOR);
define('WEBROOT' ,'<DOCUMENTROOT>/sub1/sub2');
define('SUB_FOLDER' ,'sub1/sub2');
Note: I had to set the SUB_FOLDER to make the paths resolve correcty.
Thanks!
questionI just try this with a wordpress installation. It works fine, except that when a Admin is logged in and view the front page, then in admin bar, Wordpress logo and update icons goes missing. they use a query string by wordpress.
Hi,
When an image is requested and the source don't exists, is it possible to display a default image? I'm using Munee on a (custom) CDN for products but it isn't known if a product image already exists. Displaying a "No image yet" image is much nicer then showing nothing.
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../fonts/toadOcfmlt9b38dHJxOBGOode0-EuMkY--TSyExeINg.woff2') format('woff2'), url('../fonts/toadOcfmlt9b38dHJxOBGNbE_oMaV8t2eFeISPpzbdE.woff') format('woff');
}
i can not load the font.
When trying to minify css using ?minify=true
, I get the following error:
Fatal error: Call to protected Munee\Asset\Filter\Css\Minify::minify() from context 'Munee\Asset\Type' in vendor\meenie\munee\src\Munee\Asset\Type.php on line 88
Requesting an image, which has not been cached yet, leads to a PHP warning:
request: "GET image.jpg?resize=h[100] HTTP/1.0"
PHP message: PHP Warning: Invalid argument supplied for foreach() in ../vendor/meenie/Munee/src/Munee/Asset/Type/Image.php on line 155
PHP message: PHP Stack trace:
PHP message: PHP 1. {main}() ../www.static/assetic.php:0
PHP message: PHP 2. Munee\Dispatcher::run() ../www.static/assetic.php:16
PHP message: PHP 3. Munee\Asset\Type->init() ../vendor/meenie/Munee/src/Munee/Dispatcher.php:69
PHP message: PHP 4. Munee\Asset\Type\Image->setupFile() ../vendor/meenie/Munee/src/Munee/Asset/Type.php:131
PHP message: PHP 5. Munee\Asset\Type\Image->checkNumberOfAllowedFilters() ../vendor/meenie/Munee/src/Munee/Asset/Type/Image.php:95
This is because glob() may return false instead of an empty array which is then passed to foreach (leading to a warning):
On some systems it is impossible to distinguish between empty match and an error. ... from the PHP documentation (http://php.net/glob#refsect1-function.glob-returnvalues)
Here's my pull request which fixes this warning:
.well {
background-color: #FFF;
}
@font-face {
The characters appear after the end of one file and before the start of the next. These characters are not present in the original files nor in the copies found inside the cache.
I want to obfuscate JS for minify, for example input: function one(first, second) { alert(first + second); } output: function one(a, b) { alert(a, b); } Is it possible to do that?
question "require": {
"php": ">=5.3.2",
"oyejorge/less.php": "1.7.0.5",
"leafo/scssphp": "0.1.1",
"tedivm/jshrink": "1.0.1",
"imagine/imagine": "0.6.2",
"coffeescript/coffeescript": "1.3.1",
"meenie/javascript-packer": "1.1",
"tubalmartin/cssmin": "~2.4",
"sabberworm/php-css-parser": "7.0.0"
}
Not sure if this is possible, I've read through the docs and to my eye I think I can't do this, but I'd like to crop an image from point x and y - i.e. using JS to select an area of an image and crop to a size from points x and y on the image.
Please advise if this could be possible?
This is a suggestion of course but I think it'd be great for package consumers to upgrade tubalmartin/cssmin package to latest ^4
version since it's way better (less buggy, more features) than v2.4.x.
I still haven't found it.
Luckily I had a .htaccess file on my desktop from a few months ago when I was supposed to try out munee but got sidetracked.
Munee is trying to parse urls inside the the JS file even its commented out. To be exact the URL on the last line of the following file: https://github.com/silviomoreto/bootstrap-select/blob/master/dist/js/bootstrap-select.min.js
Btw I still have problem with fonts inside stylesheet (font awesome) unless I use .htaccess rule which i am trying to avoid. Can it be fixed somehow?
For example, I use font-awesome like this:
<link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.css">
Original file excerpt:
src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
Result:
src: url("/\\/bower_components/font-awesome/fonts/fontawesome-webfont.eot?v=4.6.3");
Kind regards
Thanks to @bezumkin for the updates!
Source code(tar.gz)Thanks to @elkangaroo for these changes.
Source code(tar.gz)Asset Component The Asset component manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files. Res
Asset Compress Asset Compress is CakePHP plugin for helping reduce the number of requests, and optimizing the remaining requests your application make
Phraseanet 4.1 - Digital Asset Management application Main Features : Several GUI : Prod, Admin, Thesaurus, Lightbox ,Report, Metadata Management (inc
GLPI stands for Gestionnaire Libre de Parc Informatique is a Free Asset and IT Management Software package, that provides ITIL Service Desk features, licenses tracking and software auditing.
DDLC Plus Asset Decrypter Doki Doki Literature Club Plus Asset Decrypter Used to decrypt encrypted Streaming Asset Bundle files (*.cy) in DDLC-Plus. H
PHP CSS Parser A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output
JShrink JShrink is a php class that minifies javascript so that it can be delivered to the client quicker. This code can be used by any product lookin
Bowerphp An implementation of bower in PHP. https://bowerphp.github.io/ Installation $ composer require beelab/bowerphp Configuration Currently, you c
Bookmarklet Gen Convert readable Javascript code into bookmarklet links Features removes comments compresses code by removing extraneous spaces, but n
NotrinosERP is an open source, web-based enterprise management system that written in PHP and MySql. NotrinosERP contains all the required modules for running any small to medium size businesses. It supports multi users, multi currencies, multi languages
CommentSystem [BETA] Commenting program developed with Html & Css & Php JavaScript Languages and MySql How does it work ? After you set up your Databa
Asset Component is a port of Laravel 3 Asset for Orchestra Platform. The component main functionality is to allow asset declaration to be handle dynamically and asset dependencies can be resolve directly from the container. It however is not intended to becoma an asset pipeline package for Laravel, for such purpose we would recommend to use Grunt or Gulp.
About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie
Assetic Assetic is an asset management framework for PHP. Project status This project is not maintained anymore. Development has been taken over at ht
NotificationPusher Standalone PHP library for easy devices message notifications push. Feel free to contribute! Thanks. Contributors Cédric Dugat (Aut
PdfParser Pdf Parser, a standalone PHP library, provides various tools to extract data from a PDF file. Website : https://www.pdfparser.org Test the A
SkeltchGo is a standalone version of Glowie Skeltch templating engine for PHP, intented to use from outside the framework.
laravel-potion Potion is a pure PHP asset manager for Laravel based off of Assetic. Description Laravel 5 comes with a great asset manager called Elix
A simple, standalone, modern PHP class inspector and mapper library, wrapping PHPs native reflection in a fluent interface.
Amazon S3 PHP Class Usage OO method (e,g; $s3->getObject(...)): $s3 = new S3($awsAccessKey, $awsSecretKey); Statically (e,g; S3::getObject(...)): S3::