pluf2

pluf2 Commit Details


Date:2009-01-12 14:27:10 (15 years 11 months ago)
Author:Loic d'Anterroches
Branch:master
Commit:91849f4957fa0819a0ce1f4e6eb3c7705e081406
Parents: 1ed1eeb958889ec0c9ea382401988a7e7950cdc1
Message:Improved the caching mechanism.

Note, this is a partially deprecated file.
Changes:

File differences

src/Pluf/L10n.php
140140
141141
142142
143
144
145
146
147
148
143
144
145
149146
150147
151148
......
153150
154151
155152
156
153
157154
158155
159156
160
161
162
157
158
163159
164160
165161
.str_replace(DIRECTORY_SEPARATOR, '_', substr($file, 0, -5))
.'.php';
$lines = file($file);
if (false === ($fp = @fopen($phpfile,'w'))) {
return false;
}
fputs($fp, '<?php '."\n".'/* automatically generated file from: '
.$file.' */'."\n\n");
fputs($fp, '$l = array();'."\n");
$out = '<?php '."\n".'/* automatically generated file from: '
.$file.' */'."\n\n";
$out .= '$l = array();'."\n";
$count = count($lines);
for ($i=1; $i<$count; $i++) {
$tmp = (!empty($lines[$i+1])) ? trim($lines[$i+1]) : '';
$string = '$l[\''
.str_replace("'", "\\'", trim(substr($lines[$i],1)))
.'\'] = \''.str_replace("'", "\\'", $tmp).'\';'."\n";
fputs($fp, $string);
$out .= $string;
$i++;
}
}
fputs($fp, 'return $l;'."\n");
fputs($fp, "\n".'?>');
@fclose($fp);
$out .= 'return $l;'."\n\n".'?>';
file_put_contents($phpfile, $out, LOCK_EX);
@chmod($phpfile, 0777);
return true;
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05143s using 13 queries.