Yii 1.1: minscript

combine, minify, compress, cache
88 followers

Development of minScript has been DISCONTINUED. There will be no future updates, bug fixes or support.

minScript is a Yii Framework extension which extends clientScript to automatically combine, minify and compress files. The files are served with optimal client cache headers which dramatically improves the web application performance and eases the load on web servers.

Please visit the extension's wiki page for a full documentation on minScript.

You may find more help and information in the minScript forum topic.

To report a problem or see open issues visit the extension's issues page.

Total 20 comments

#17530 report it
ehochedez at 2014/06/29 11:12am
Combine minScript and URL and showScriptName=false

Hello,

I have set up the minScript extension that works well and I just started the URL rewriting. When using the option 'showScriptName'=>false, my websites cannot find the script and css minimized by minScript anymore. Both my URL rewriting and the minScript extension seem to work fine independently but I can't get them to work together, can't figure out why.

The action ExtMinScriptController > actionServe is usually called but not in the case of the 2 working toghether. Here is the interesting part of my my config file :

'clientScript'=>array(
            'class'=>'ext.minScript.components.ExtMinScript',
    ),
    'components'=>array(
        'urlManager'=>array(
            'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                'userPage/<idUser:\d+>'=>'user/userPage',
                'userPage/<username:\w+>'=>'user/userPage',
                'inbox/<username:\w+>'=>'message/inbox',
                'validateEmail/<validationCode:\w+>'=>'user/validateEmail',
                '<action:(searchUser|myProfile|myPictures|register|resetPassword|logout)>' => 'user/<action>',
                '<action:(index|contact)>' => 'site/<action>',
                '<action:(inbox)>' => 'message/<action>',
            ),
        ),
    ),
    'controllerMap'=>array(
        'min'=>array(
            'class'=>'ext.minScript.controllers.ExtMinScriptController',
        ),
    ),

Anyone has the same problem ?

#17377 report it
atrandafir at 2014/05/30 03:23am
SEO suggestion for error 500

Hello,

I have noticed minScript gives a error 500 if the files used for a specific group are no longer available.

That's somehow bad for SEO because your site is giving a server error 500.

I think it should give a 404 not found error instead. Or maybe, keep the compressed group stored on disk until you manually remove assets?

Regards, Alex.

#15759 report it
darioo at 2013/12/14 04:45pm
Awesome

This is great extension, I love it (Y) :D

#15423 report it
Nacesprin at 2013/11/08 06:51am
EXCELENT EXTENSION

This script is what I was looking for!! It works fine!!

#15255 report it
limitless at 2013/10/21 12:08pm
Re: Using minScript with bootstrap extension

Hey Scott Gardner

Thank you for reporting this. I replied to your request in the minScript forum topic and hope we can find a solution to this since multiple people have reported similar issues.

#14351 report it
Scott Gardner at 2013/08/05 08:13pm
Using minScript with bootstrap extension

I am using the bootstrap extension. When I add the minScript extension, TbButtonColumn buttons are not displayed. Any ideas? Thank you

#13333 report it
limitless at 2013/05/22 01:07pm
Re: Needs a lot of work

Hey notsoluckycharm

if i understand you correctly you are suggesting that minScript should create the combined, minified and compressed files instead of serving the content out directly. The content is served directly for some good reasons, one of them being that this allows to send specific headers directly without having to change the web server configuration.

I'm sorry to hear that it breaks your scripts. Most of the time this is a problem of how the scripts react to being minified and combined and not all scripts play well with that. In minScript version 2.2 you can exclude certain files from being processed, this might help.

#13332 report it
limitless at 2013/05/22 12:55pm
Re: Application slowdown after configure an extension

Hey karmraj

The slowdowns you are reporting are most likely caused by another extension which constantly publishes files and therefore forces minScript to update itself all the time. Unfortunately there is not more information but try looking in that direction.

Also, "optionname" and "optionvalue" are placeholders which can be replaced by properties as described here.

#13331 report it
limitless at 2013/05/22 12:49pm
Re: Problem serving the content

Hey olemara

First of all, thank you for the praise.

This looks like a problem with your "CUrlManager" configuration. Is the property "urlFormat" set to "get" or to "path"? Try setting it to "get".

Also i think some information got stripped out of your comment (URL) which makes it a bit harder to debug this.

#13330 report it
limitless at 2013/05/22 12:42pm
Re: Using minScript with yii-debug-toolbar?

Hey atrandafir

Since version 2.2 you can exclude certain files from being processed. Have a look at the property ExtMinScript::$minScriptUrlMap

#13329 report it
limitless at 2013/05/22 12:39pm
Re: Keeps telling me there are unexpected token ! and some functions are not defined....

Hey jiaming

I tried the configuration you provided and it works flawlessly for me. Are you using the latest version of minScript (2.2)?

#12600 report it
notsoluckycharm at 2013/03/31 05:14pm
Needs a lot of work

Wish it would integrate and publish assets passed to it using absolute urls instead of making itself as an endpoint.

It also breaks half my scripts ( require.js ) ... moving on to the next extensions.

#12588 report it
karmraj at 2013/03/30 07:17am
Application slowdown after configure an extension

My Application is under development. I have read about this extension from community. Today i have configure this extension. It's working perfectly but it takes more time then before it takes to load a page.

I have make following change in configuration file. And one more problem is that, whatever steps i have follow to configure this extension from this link : bitbucket.org/TeamTPG/minscript. i got an error as "Extoptionvalue" is not define so when i had commented follwing optionname line its working.

    'controllerMap'=>array(
            'min'=>array(
            'class'=>'ext.minScript.controllers.ExtMinScriptController',
            //'optionName'=>'optionValue',
            ),
    ),

'components'=>array(
            'clientScript'=>array(
                    'class'=>'ext.minScript.components.ExtMinScript',
                    //'optionName'=>'optionValue',
            ),

so let me know, is there any problem in my configuration or i had made any mistakes.

Thanks, Karmraj Zala

#12147 report it
olemara at 2013/03/01 04:17am
Problem serving the content

Hi there,

and thank you for what seems to be a great extension. I am new to the minifying process so there may be holes in my knowledge here. I have the newest Yii version, minify 2.1 installed, and the latest version from your homepage. The folders are created in the runtime directory, but I get this message in the php log file:

[Fri Mar 01 10:00:44 2013] [error] [client 127.0.0.1] File does not exist: /var/www/min/serve, referer: http://localhost:5555/

So I can not serve the file. Using the URL builder i get URL's like this:

which works. How can I buypass this problem?

Cheers!

#11753 report it
atrandafir at 2013/02/01 10:14am
Using minScript with yii-debug-toolbar?

Hello,

I am using yii-debug-toolbar on my development machine and minScript does process also the javascript/css coming from yii-debug-toolbar, and that makes the page a little bit slower.

Is there any way I can tell minScript to exclude it?

Thanks.

#11206 report it
andyhot at 2012/12/27 02:56pm
Coffeescript + sass + less

minscript works fine for me, so, thx!

I've even got a fork up at https://bitbucket.org/andyhot/minscript that adds support for coffeescript, sass, less (basically by augmenting ExtMinScriptSource)

#10936 report it
jiaming at 2012/12/05 01:12am
Keeps telling me there are unexpected token ! and some functions are not defined....

Keeps telling me there are unexpected token ! and some functions are not defined....

Looks like the javascript integration isn't going well...

Here is my setup, any problems?

'clientScript'=>array(
 
 'class'=>'ext.minScript.components.ExtMinScript',
 
  'packages'=>array(
    'jquery'=>array(
      'baseUrl'=>'//ajax.googleapis.com/ajax/libs/jquery/1.8/',
      'js'=>array('jquery.min.js'),
      'coreScriptPosition'=>CClientScript::POS_HEAD
    ),
    'jquery.ui'=>array(
      'baseUrl'=>'//ajax.googleapis.com/ajax/libs/jqueryui/1.8/',
      'js'=>array('jquery-ui.min.js'),
      'depends'=>array('jquery'),
      'coreScriptPosition'=>CClientScript::POS_BEGIN
    ),
  ),
),
'controllerMap'=>array(
                'min'=>array(
                        'class'=>'ext.minScript.controllers.ExtMinScriptController',
                ),
        ),

THank you!

#10590 report it
limitless at 2012/11/06 06:31am
Re: Issue with wysiwyg loading

Hey Revelis Luc Bonnin

I tried to reproduce this with RedactorJS but it worked flawlessly in my setup.

If there's still a problem please report an issue here with more details of your setup: https://bitbucket.org/TeamTPG/minscript/issues?status=new&status=open

#10488 report it
Revelis Luc Bonnin at 2012/10/31 09:06am
Issue with wysiwyg loading

Hi, This extension works really great except for my pages where i have a wysiwig load.

If js are minified using minscript, the wysiwig doesn't load and i got my poor default textarea :( Any idea ? (no js error, wysiwg simply doesn't load).

I'm using redactorjs wysiwig.

#10180 report it
briiC.lv at 2012/10/09 06:27am
@ThePaulius

I had something similar but i found other extensions to be responsible for that kind of action. For example bootstrap extension was regenerating some files and it didn't allow for minscript to read from cache.

Leave a comment

Please to leave your comment.

Create extension