]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Minify/MinifyPlugin.php
common_memcache() => Cache::instance()
[quix0rs-gnu-social.git] / plugins / Minify / MinifyPlugin.php
index b49b6a4bad1dc63c296edab6b6a8bbc5fe735c72..5071fd5a1f21931d3f16c53b7863c8659835f7d7 100644 (file)
@@ -29,6 +29,7 @@ Author URI: http://candrews.integralblue.com/
 /**
  * @package MinifyPlugin
  * @maintainer Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  */
 
 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
@@ -86,7 +87,11 @@ class MinifyPlugin extends Plugin
         $url = parse_url($src);
         if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
         {
-            $src = $this->minifyUrl($src);
+            if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
+                $src = $this->minifyUrl($src);
+            } else {
+                $src = $this->minifyUrl('js/'.$src);
+            }
         }
     }
 
@@ -96,7 +101,7 @@ class MinifyPlugin extends Plugin
             && is_null(common_config('theme', 'path'))
             && is_null(common_config('theme', 'server'));
         $url = parse_url($src);
-        if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
+        if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment']))
         {
             if(!isset($theme)) {
                 $theme = common_config('site', 'theme');
@@ -114,7 +119,7 @@ class MinifyPlugin extends Plugin
     function onStartInlineScriptElement($action,&$code,&$type)
     {
         if($this->minifyInlineJs && $type=='text/javascript'){
-            $c = common_memcache();
+            $c = Cache::instance();
             if (!empty($c)) {
                 $cacheKey = common_cache_key(self::cacheKey . ':' . crc32($code));
                 $out = $c->get($cacheKey);
@@ -134,7 +139,7 @@ class MinifyPlugin extends Plugin
     function onStartStyleElement($action,&$code,&$type,&$media)
     {
         if($this->minifyInlineCss && $type=='text/css'){
-            $c = common_memcache();
+            $c = Cache::instance();
             if (!empty($c)) {
                 $cacheKey = common_cache_key(self::cacheKey . ':' . crc32($code));
                 $out = $c->get($cacheKey);