We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SL Combinator : Combine and Compress JavaScript and CSS on-the-fly : Version Update (2.1.0) 1st April, 2009

Development and Programming

Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Version 2.1.0 : Released 1st April, 2009 * Implemented LG Addon Updater functionality, to automatically check for updates.

Version 2.0.1 : Released 1st April, 2009 * Finally got around to adding a changelog, huzzah! * Made minor change to minify path to explicitly include index.php. Prevents problems on some servers that use the “Include” method for removing index.php from URLs.

–

Hello all,

SL Combinator is a plugin and extension that combines and compresses JavaScript files on the fly, reducing page size and minimising HTTP requests. Combined files are saved for later use, and the plugin is smart enough to check for an up-to-date cache file before deciding to create a new one.

The plugin eliminates the hassle of manually combining and compressing multiple JS files for use on a live site. You can have multiple separate JavaScript files for easy editing and debugging, without wasting time combining and compressing files for use on the live site (or forcing your visitors to download uncompressed files).

Head on over to the Resources section of my site to read the full documentation, and download the add-on.

If you have any questions or problems, just post them to this thread and I’ll do my best to answer them.

Cheers, Stephen

       
silenz's avatar
silenz
1,648 posts
16 years ago
silenz's avatar silenz
AFAIK, there is no known fix, but if you have information to the contrary, please let me know.

There is a fix but it’s not for the faint of heart and involves potentially black magic.

Have no “_pi” in the filename 😛

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
There is a fix but it’s not for the faint of heart and involves potentially black magic… Have no “_pi” in the filename

Sorry silenz, close but no cigar. That just causes an error on the page using the plugin, because the plugin filename doesn’t match the plugin class name.

In case you’re wondering, the reason the plugin class has “_pi” at the end is to avoid a conflict with the extension class.

Stephen

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

This is really useful, thanks Stephen. Can’t wait to try it out.

       
silenz's avatar
silenz
1,648 posts
16 years ago
silenz's avatar silenz
Sorry silenz, close but no cigar. That just causes an error on the page using the plugin, because the plugin filename doesn’t match the plugin class name.

Not for me. Anyway, the solution is still to avoid the “_pi”. Rename the class accordingliy.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Not for me. Anyway, the solution is still to avoid the “_pi”. Rename the class accordingliy.

The problem comes when you actually use the plugin (as opposed to just viewing it in the CP); it throws an error on the page.

As for renaming the class, that would cause a conflict in the code with the extension class. I may try renaming the extension class instead, so the plugin can function without the “_pi” suffix.

Thanks for the suggestions.

Stephen

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
This is really useful, thanks Stephen. Can’t wait to try it out.

No problem, let me know how you get on.

Cheers, Stephen

       
eclectiv's avatar
eclectiv
133 posts
16 years ago
eclectiv's avatar eclectiv

I seem to get the following error. Anyone know what’s going on?

Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /nfs/c03/h03/mnt/55445/domains/mydomain.com/html/combine/jsmin-1.1.1.php on line 49
       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi eclectiv,

That looks like a problem with the JSMin script (which I utilised for this plugin, rather than wrote), as opposed to the plugin itself. The usual suspect is that your server is using PHP4, not PHP5; is that the case?

If everything goes to plan, I’ll be releasing a new version early next week, which addresses a lot of niggling problems I’ve encountered whilst using JSMin. Assuming the version of PHP isn’t the issue, if you can wait a few days the new version will hopefully solve your problem.

Regards, Stephen

       
eclectiv's avatar
eclectiv
133 posts
16 years ago
eclectiv's avatar eclectiv

Perfect! It was what you expected – the PHP version was 4. I changed that and it’s all working now. Thanks, Stephen!

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Perfect! It was what you expected—the PHP version was 4. I changed that and it’s all working now.

Good news, thanks for letting me know electiv.

Cheers, Stephen

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hello all,

I’ve just rolled out version 2 of this plugin / extension (attached to the first message in this thread). It’s a complete rewrite that now makes use of the spiffy Minify application for all the combining, compressing, and caching.

Here are the highlights:

  • Support for CSS! Now you can compress and combine your CSS files on the fly too.
  • Less troublesome compression — particularly of jQuery plugins and sIFR — thanks to Minify’s enhanced version of JSMin.
  • Greatly improved client-side caching, with HTTP encoding and headers (once again, thanks to Minify).

The new version brings with it some changes to both the filenames, and the plugin syntax, so it’s not a straight “replace old files” upgrade. Apologies for any inconvenience this causes, but hopefully you’ll find that it’s worth the (small) effort.

I’ve posted full instructions for upgrading, installing, and using the plugin / extension to my blog. And of course, if you have any questions, just leave a message on this thread and I’ll do my best to answer it.

Cheers, Stephen

P.S. Oh yes, and I fixed the inconsequential bug.

       
Paul Wenzel's avatar
Paul Wenzel
13 posts
16 years ago
Paul Wenzel's avatar Paul Wenzel

Hi Stephen

This looks to be a fabulous plugin. Unfortunately, I attempted to use the 2.0 release and encountered an HTTP 400 Bad Request error with every execution. I reviewed your installation instructions closely, but remain stumped about the error.

I am using Expression Engine 1.6.6 on PHP Version 5.2.6, Apache 2.

Thanks!

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi pwenzel,

Unfortunately, I attempted to use the 2.0 release and encountered an HTTP 400 Bad Request error with every execution. I reviewed your installation instructions closely, but remain stumped about the error.

I’m a bit confused; where and when is the HTTP error appearing? Could you show me the code you’re using please?

Thanks, Stephen

       
eclectiv's avatar
eclectiv
133 posts
16 years ago
eclectiv's avatar eclectiv

The new version works great for the JS, but when I use the SL Combinator for the CSS, it doesn’t work. The CSS just doesn’t load. When I go to the direct URL for the CSS that’s published by the SL Combinator for the CSS, I get a HTTP 400 Bad Request error.

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.