Welcome Guest, Not a member yet? Register   Sign In
AssetLibPro - An advanced CI Asset Library
#11

[eluser]TheLoops[/eluser]
Thanks Maxximus, it's fixed now (v1.0.2).
Code:
<?php header("Content-type: text/css; charset: UTF-8"); ?>
…is now sent no matter if you have far_future_expire or gzip_compress checked.
See first post for update link ;-) Thanks for the feedback guys! :-)
#12

[eluser]Code Arachn!d[/eluser]
line 274 has:

Code:
$this->_unlink_old_caches($this->cache_dir_css, $this->cache_file_js[$group]);

I think it should be

Code:
$this->_unlink_old_caches($this->cache_dir_js, $this->cache_file_js[$group]);
#13

[eluser]TheLoops[/eluser]
uh, yeah… evil copy & paste >Sad
I'll fix that a.s.a.p
Way too busy right now, though.
#14

[eluser]fgrehm[/eluser]
Hi guys,

Nice work on this library!

I really like what you got there but i think there's a problem with it (correct me if i'm wrong)...
Even if the resulting file is already in cache you still read its contents (when you call add_css)? whats the point of doing that?


Please give me a feedback, I really want to use the library Smile
Fabio
#15

[eluser]TheLoops[/eluser]
[quote author="fgrehm" date="1211972750"]Hi guys,

Nice work on this library!

I really like what you got there but i think there's a problem with it (correct me if i'm wrong)...
Even if the resulting file is already in cache you still read its contents (when you call add_css)? whats the point of doing that?


Please give me a feedback, I really want to use the library Smile
Fabio[/quote]Sory, what do you mean exactly?
#16

[eluser]fgrehm[/eluser]
On the _add method we've got these lines:
Code:
if ($fileinfo['extension'] === 'js' || $fileinfo['extension'] === 'css') {
                $this->_assets[$fileinfo['extension']][$group][$file_path] = file_get_contents($file);
                if (!in_array($group,$this->asset_groups[$fileinfo['extension']]))
                    $this->asset_groups[$fileinfo['extension']][] = $group;
            }

I think 'file_get_contents' should only be called when the resulting cache file doesn't exists. The way it is, we read file contents even if the cache exists.

This is the way i think it should be done:
- Add js / ccs path to $this->_assets array (only the file path and not its contents)
- When output($type) method is called, the hash is calculated
- If the cache file doesn't exists, read all assets contents and generate it


I hope you undertand now Smile

Fabio
PS: Sorry about my english, it's been a while since I wrote something in english Tongue
#17

[eluser]TheLoops[/eluser]
Okay, thanks. I'll take a look later today.
Expect a fix then ;-)
#18

[eluser]TheLoops[/eluser]
[quote author="TheLoops" date="1211997308"]Okay, thanks. I'll take a look later today.
Expect a fix then ;-)[/quote]See first post for update.
#19

[eluser]Ignacio[/eluser]
Quote:Ps: Don’t forget to leave a comment if you like it (or don’t) wink
I didn't!

Code:
private function _add($file, $group = NULL) {
    $file_path = $file;
    if ($group === NULL)
        return FALSE;
            
    $file = realpath(trim($file, "/"));
    if (file_exists($file) && is_readable($file)) {
        $fileinfo = pathinfo($file);
        
        if ($fileinfo['extension'] === 'js' || $fileinfo['extension'] === 'css') {
            $this->_assets[$fileinfo['extension']][$group][$file_path] = '';
            if (!in_array($group,$this->asset_groups[$fileinfo['extension']]))
                $this->asset_groups[$fileinfo['extension']][] = $group;
        }
    }else{
        echo "file doesn't exists or isn't readable";
    }
}

I spent an hour!! Why you don't put a little validation there!

Thanks
#20

[eluser]Ignacio[/eluser]
Why this?
Code:
echo $this->cache_dir_css.'/'.$this->cache_file_css[$group];

What about ie6 & ie7 sytles?

Code:
$this->csstidy_loaded = TRUE;echo 'ss';

??????




Theme © iAndrew 2016 - Forum software by © MyBB