if(substr(OC::$REQUESTEDFILE, -3) == 'css'){
$file = 'apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE;
$minimizer = new OC_Minimizer_CSS();
- $minimizer->output(array(array(OC::$APPSROOT, OC::$APPSWEBROOT, $file)));
+ $minimizer->output(array(array(OC::$APPSROOT, OC::$APPSWEBROOT, $file)), $file);
exit;
}elseif(substr(OC::$REQUESTEDFILE, -3) == 'php'){
require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
return $cache_dir;
}
+ protected function fixKey($key) {
+ return str_replace('/', '_', $key);
+ }
+
public function get($key) {
+ $key = $this->fixKey($key);
if ($this->hasKey($key)) {
$cache_dir = $this->getCacheDir();
return file_get_contents($cache_dir.$key);
}
public function set($key, $value, $ttl=0) {
+ $key = $this->fixKey($key);
$cache_dir = $this->getCacheDir();
if ($cache_dir and file_put_contents($cache_dir.$key, $value)) {
if ($ttl === 0) {
}
public function hasKey($key) {
+ $key = $this->fixKey($key);
$cache_dir = $this->getCacheDir();
if ($cache_dir && is_file($cache_dir.$key)) {
$mtime = filemtime($cache_dir.$key);
if(!$cache_dir){
return false;
}
+ $key = $this->fixKey($key);
return unlink($cache_dir.$key);
}
}
static public function acceptGZip() {
+ if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
+ return false;
+ }
$HTTP_ACCEPT_ENCODING = $_SERVER["HTTP_ACCEPT_ENCODING"];
if( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false )
return 'x-gzip';