Welcome Guest, Not a member yet? Register   Sign In
Carabiner 1.4: Asset Management Library

[eluser]Benedikt[/eluser]
Nice library so far but I have a problem and I would like to know if you have an idea for that:

Currently I get a URL like

Code:
http://domain/system/application/cache/carabiner/00000000009939b9184d06e0feb33450dc78b54e11.js

Sure I do not allow direct access to my cache folder.

Now I was thinking to use a controller in the middle who can load the data and you would only reference this controller:

Code:
http://domain/Media/<group>

Is there a way to do it this way instead of giving access to my cache folder directly?

Thanks for ideas.

[eluser]stondin[/eluser]
Hey there,

Just a quick note. On line 654 of the carabiner.php file

Code:
if( !isset($this->js[$group]) ):

should be

Code:
if( !isset($this->css[$group]) ):

Caused me a massive headache as adding groups in the config file wouldn't work unless both a js and a css array were present. A lot of digging later, I found the problem.
Hope that helps people and the quick fix can be made to the latest version of Carabiner.
Many thanks for a great Library!

[eluser]Dan Horrigan[/eluser]
So there may have already been a comment about this, and I didn't see it, but I will say it anyway. Libraries need to have their file names capitalized and the class name should be capitalized as well. Not doing so will cause the script to fail on some machines that are case sensitive.

Read the User Manual

[eluser]mikedfunk[/eluser]
I'm having trouble every time carabiner combines files. It adds 2 weird characters between each combined file and makes the combined file fail. I've isolated the problem to combining; whether or not I minify has no effect. Strangely this only happens to my CSS files. My JS files also don't work after combining but I can't find out why. Here's what the cached CSS file looks like:

http://skitch.com/mikedfunk/d8g74/http-l...c98b44.css

Can anyone help??

[eluser]Philipp Gérard[/eluser]
Great work! I used Carabiner in my current project (just implemented it) and had a huge performance gain because I now load javascripts on a per controller basis. I noticed however, that a faulty js cache file will always be included if I use $this->...->display() even if I did not add any js file anywhere. The file is not even there, Carabiner only pretends so. Maybe worth a fix.

[eluser]mikedfunk[/eluser]
[quote author="mikedfunk" date="1276033159"]I'm having trouble every time carabiner combines files. It adds 2 weird characters between each combined file and makes the combined file fail. I've isolated the problem to combining; whether or not I minify has no effect. Strangely this only happens to my CSS files. My JS files also don't work after combining but I can't find out why. Here's what the cached CSS file looks like:

http://skitch.com/mikedfunk/d8g74/http-l...c98b44.css

Can anyone help??[/quote]

I figured out the problem with this. It was because one of my CSS files used UTF-16 encoding. Switched to UTF-8 and it was fine.

[eluser]pickupman[/eluser]
@mikedfunk
You may have issues with combined/minified js scripts for 2 possible reasons.
1.) Scripts may already by minified, and sometimes processing them again may cause errors.
2.) You may have a syntax error. Some browsers will allow the error. Run the script causing the problem through an online js validator. You will probably find a missing ; or something.

[eluser]zombaya[/eluser]
Hi,

I noticed a bug which led to unexisting file-links. In the function _display_js() you check if '$this->js' is empty. (Linenumber around 620)
Code:
private function _display_js($group = 'main')
    {
    if( empty($this->js) ) return; // if there aren't any js files, just stop!

However it is possible that $this->js is not empty but the group to be displayed is.

So you should add a check like this:

Code:
if( empty($this->js[$group]) ) return; // if there aren't any js files in the group, just stop!

It is possible that this isn't necesarry for everyone because I changed some things but I don't think those changes affect this.

The same applies for _display_css()

[eluser]mikedfunk[/eluser]
Thanks Zomboya, I was getting this problem too. Any other fixes to the lib while you're at it?

[eluser]zombaya[/eluser]
Well, at line 664 I added a check to see if a given js-file indeed existed and if it doesn't, log it and move on.
Code:
foreach($this->js[$group] as $ref):

        if( ! is_file($this->script_path.$ref['dev']) && ! is_file($this->script_path.$ref['prod']))
        {
            log_message('error',"Carabiner: dev_file '{$this->script_path}{$ref['dev']}' is not a file");
            continue;
        }

The same applies for line 696. I also should add this check for css.

I also removed the use of realpath at line 885 and the like, since it isn't nessecary, I believe.

Also added this to the end of the file for clarity.
Code:
/* End of file Carabiner.php */
/* Location: ./application/libraries/Carabiner.php */


The major change I made was add support for less using lessc from lessphp, but it's not completely finished.




Theme © iAndrew 2016 - Forum software by © MyBB