Part of the EllisLab Network
   
2 of 6
2
AssetLibPro - An advanced CI Asset Library
Posted: 22 May 2008 10:17 AM   [ Ignore ]   [ # 11 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  142
Joined  02-14-2007

line 274 has:

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

I think it should be

$this->_unlink_old_caches($this->cache_dir_js$this->cache_file_js[$group]); 
 Signature 

Trying to do it right the first time! whoops guess that didn’t work out so well…

Profile
 
 
Posted: 22 May 2008 10:29 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  03-17-2008

uh, yeah… evil copy & paste mad
I’ll fix that a.s.a.p
Way too busy right now, though.

Profile
 
 
Posted: 28 May 2008 02:05 AM   [ Ignore ]   [ # 13 ]  
Summer Student
Total Posts:  9
Joined  10-17-2007

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

Profile
 
 
Posted: 28 May 2008 07:57 AM   [ Ignore ]   [ # 14 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  03-17-2008
fgrehm - 28 May 2008 06:05 AM

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

Sory, what do you mean exactly?

Profile
 
 
Posted: 28 May 2008 08:50 AM   [ Ignore ]   [ # 15 ]  
Summer Student
Total Posts:  9
Joined  10-17-2007

On the _add method we’ve got these lines:

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 raspberry

Profile
 
 
Posted: 28 May 2008 08:55 AM   [ Ignore ]   [ # 16 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  03-17-2008

Okay, thanks. I’ll take a look later today.
Expect a fix then wink

Profile
 
 
Posted: 31 May 2008 06:07 PM   [ Ignore ]   [ # 17 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  03-17-2008
TheLoops - 28 May 2008 12:55 PM

Okay, thanks. I’ll take a look later today.
Expect a fix then wink

See first post for update.

Profile
 
 
Posted: 02 June 2008 09:10 PM   [ Ignore ]   [ # 18 ]  
Grad Student
Rank
Total Posts:  72
Joined  01-02-2008

Ps: Don’t forget to leave a comment if you like it (or don’t) wink

I didn’t!

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

Profile
 
 
Posted: 02 June 2008 11:05 PM   [ Ignore ]   [ # 19 ]  
Grad Student
Rank
Total Posts:  72
Joined  01-02-2008

Why this?

echo $this->cache_dir_css.'/'.$this->cache_file_css[$group]

What about ie6 & ie7 sytles?

$this->csstidy_loaded TRUE;echo 'ss'

??????

Profile
 
 
Posted: 03 June 2008 01:20 AM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  66
Joined  03-17-2008
Ignacio - 03 June 2008 01:10 AM
private function _add($file$group NULL{
    
//. . .
    
if (file_exists($file) && is_readable($file)) {
        
//. . .
    
}else{
        
echo "file doesn't exists or isn't readable";
    
}

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

Thanks

I’m very sorry for this. red face I will add an error log in the next update.

Ignacio - 03 June 2008 03:05 AM

Why this?

echo $this->cache_dir_css.'/'.$this->cache_file_css[$group]

What’s the problem here? hmmm

Ignacio - 03 June 2008 03:05 AM

What about ie6 & ie7 sytles?

What do you mean exactly?

Ignacio - 03 June 2008 03:05 AM
$this->csstidy_loaded TRUE;echo 'ss'

??????

Well, I have no idea what this was meant for during initial development and especially: why it’s still in there. shut eye
Damn, didn’t I check the code twice? I did.

Profile
 
 
   
2 of 6
2