Welcome Guest, Not a member yet? Register   Sign In
theCloset Asset Management Library
#1

[eluser]kilishan[/eluser]
theCloset is a light-weight asset management library for CodeIgniter that makes keeping your stylesheets and javascripts organized and fast.

It does not aim to provide all of the bells and whistles that other asset management libraries do. Instead, it provides a core functionality that makes it simple to combine and compress your scripts into a single, high-performance file for production servers, while allowing to organize the css and js into as many scripts as you want on your development server.

Why Another Library?

I have used a number of the other asset management libraries for CodeIgniter and, after having used the simple functions built into my old Ocular layout library, I found I didn’t like the way they ‘felt’. I know, it’s a very subjective thing.

As I got to thinking more about performance, one thing struck me about the other excellent libraries: most of them are CI libraries or models that get called every time a script is loaded. Not just during the execution of the app. What happens is that the base CodeIgniter gets loaded every time your server sends up a css or javascript file. That’s a lot of processing and memory to use just to serve up a basically static file. Granted, there has to be some overhead involved with combining files and the other features that an asset library should provide, but I felt that it was a better performing design to keep the actual asset providing script separate.

After some searching I found Neils Leenheer’s excellent (and small) combine script. It provides the combining and gzipping of the source files. Using the devMode plugin I had just written, I created a wrapper library to make it easy to include new files (or completely override the defaults) at run-time.

Learn more or download
#2

[eluser]quasiperfect[/eluser]
hi

i would like to test u'r lib but i don't know how to permit access to combine.php

i use this in my htaccess

Code:
IndexIgnore *
RewriteEngine On
RewriteBase /site/
RewriteRule ^(application|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
#3

[eluser]kilishan[/eluser]
It looks like your htaccess should be fine. The line
Code:
RewriteCond %{REQUEST_FILENAME} !-f
should allow it to be found since it's basically saying that if it's not a file, then route the page to the index.php file.

I'm not sure where you've placed the combine.php file itself. It looks like you're running in a subdirectory, which should be fine. I haven't tried it like that, but normally the combine.php file should be sitting in the same folder as the index.php file.
#4

[eluser]stondin[/eluser]
Hi there,

I keep running into an issue while using your Assets, devMode Plugin and Safari.
I think safari has problems with the combine script and pages don't render past the initial script tags in the header when the website is running in either 'test' or 'production' modes. Any help with this issue would be really appreciated.

Kind regards
Dan
#5

[eluser]kilishan[/eluser]
[quote author="stondin" date="1265952043"]Hi there,

I keep running into an issue while using your Assets, devMode Plugin and Safari.
I think safari has problems with the combine script and pages don't render past the initial script tags in the header when the website is running in either 'test' or 'production' modes. Any help with this issue would be really appreciated.

Kind regards
Dan[/quote]

Hey Dan,

It doesn't appear to be a Safari issue, at least not on my machine. I'm running on a Mac, so I don't know if the PC version of Safari does something differently, but I wouldn't think so.

Did you set your dir locations in the combine.php script, also? At the top of the script, just below the license info are four lines. The last three of these are the important ones:

Code:
$cache       = true;
$cachedir = dirname(__FILE__) . '/codeigniter/cache/assets/';
$cssdir   = dirname(__FILE__) . '/public/css';
$jsdir    = dirname(__FILE__) . '/public/js';

If you haven't already, then you need to adjust these to match your settings.

If this isn't the problem, can you give me any more information? I just checked one of my sites in both Chrome and Safari and it's working fine on the development server.

Oh, another thought would be to make sure your .htaccess allows access to that file, if you're using one.




Theme © iAndrew 2016 - Forum software by © MyBB