]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Minify/MinifyPlugin.php
Fixed type hints:
[quix0rs-gnu-social.git] / plugins / Minify / MinifyPlugin.php
index 69def60641d778decdf5e3ba8bf7e3cbed2633f9..1dd3bdcf345fcd685cabdfe9ba3ad304d3e3ced0 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); }
@@ -50,7 +51,6 @@ class MinifyPlugin extends Plugin
      *
      * @return boolean hook return
      */
-
     function onStartInitializeRouter($m)
     {
         $m->connect('main/min',
@@ -58,18 +58,6 @@ class MinifyPlugin extends Plugin
         return true;
     }
 
-    function onAutoload($cls)
-    {
-        switch ($cls)
-        {
-         case 'MinifyAction':
-            require_once(INSTALLDIR.'/plugins/Minify/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
-            return false;
-         default:
-            return true;
-        }
-    }
-
     function onLoginAction($action, &$login)
     {
         switch ($action)
@@ -118,9 +106,9 @@ 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));
+                $cacheKey = Cache::key(self::cacheKey . ':' . crc32($code));
                 $out = $c->get($cacheKey);
             }
             if(empty($out)) {
@@ -138,9 +126,9 @@ 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));
+                $cacheKey = Cache::key(self::cacheKey . ':' . crc32($code));
                 $out = $c->get($cacheKey);
             }
             if(empty($out)) {
@@ -156,7 +144,7 @@ class MinifyPlugin extends Plugin
     }
 
     function minifyUrl($src) {
-        return common_local_url('minify',null,array('f' => $src ,v => STATUSNET_VERSION));
+        return common_local_url('minify',null,array('f' => $src ,v => GNUSOCIAL_VERSION));
     }
 
     static function minifyJs($code) {
@@ -169,15 +157,15 @@ class MinifyPlugin extends Plugin
         return Minify_CSS::minify($code,$options);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Minify',
-                            'version' => STATUSNET_VERSION,
+                            'version' => GNUSOCIAL_VERSION,
                             'author' => 'Craig Andrews',
                             'homepage' => 'http://status.net/wiki/Plugin:Minify',
                             'rawdescription' =>
-                            _m('The Minify plugin minifies your CSS and Javascript, removing whitespace and comments.'));
+                            // TRANS: Plugin description.
+                            _m('The Minify plugin minifies StatusNet\'s CSS and JavaScript, removing whitespace and comments.'));
         return true;
     }
 }
-