Kaynağa Gözat

Merge branch 'master' of https://github.com/unaio/una

RomanL 6 yıl önce
ebeveyn
işleme
c19377074d

Dosya farkı çok büyük olduğundan ihmal edildi
+ 75 - 77
modules/boonex/lucid/install/sql/install.sql


+ 2 - 1
plugins/matthiasmullie/data/js/keywords_after.txt

@@ -708,7 +708,8 @@ class CSS extends Minify
             return $placeholder.$rest;
         };
 
-        $this->registerPattern('/calc(\(.+?)(?=$|;|calc\()/', $callback);
+        $this->registerPattern('/calc(\(.+?)(?=$|;|}|calc\()/', $callback);
+        $this->registerPattern('/calc(\(.+?)(?=$|;|}|calc\()/m', $callback);
     }
 
     /**

+ 38 - 0
plugins/matthiasmullie/minify/Exception.php

@@ -99,6 +99,44 @@ abstract class Minify
         return $this;
     }
 
+    /**
+     * Add a file to be minified.
+     *
+     * @param string|string[] $data
+     *
+     * @return static
+     * 
+     * @throws IOException
+     */
+    public function addFile($data /* $data = null, ... */)
+    {
+        // bogus "usage" of parameter $data: scrutinizer warns this variable is
+        // not used (we're using func_get_args instead to support overloading),
+        // but it still needs to be defined because it makes no sense to have
+        // this function without argument :)
+        $args = array($data) + func_get_args();
+
+        // this method can be overloaded
+        foreach ($args as $path) {
+            if (is_array($path)) {
+                call_user_func_array(array($this, 'addFile'), $path);
+                continue;
+            }
+
+            // redefine var
+            $path = (string) $path;
+
+            // check if we can read the file
+            if (!$this->canImportFile($path)) {
+                throw new IOException('The file "'.$path.'" could not be opened for reading. Check if PHP has enough permissions.');
+            }
+
+            $this->add($path);
+        }
+
+        return $this;
+    }
+
     /**
      * Minify the data & (optionally) saves it to a file.
      *

+ 14 - 5
plugins/matthiasmullie/path-converter/Converter.php

@@ -31,16 +31,17 @@ class Converter implements ConverterInterface
     /**
      * @param string $from The original base path (directory, not file!)
      * @param string $to   The new base path (directory, not file!)
+     * @param string $root Root directory (defaults to `getcwd`)
      */
-    public function __construct($from, $to)
+    public function __construct($from, $to, $root = '')
     {
         $shared = $this->shared($from, $to);
         if ($shared === '') {
             // when both paths have nothing in common, one of them is probably
             // absolute while the other is relative
-            $cwd = getcwd();
-            $from = strpos($from, $cwd) === 0 ? $from : $cwd.'/'.$from;
-            $to = strpos($to, $cwd) === 0 ? $to : $cwd.'/'.$to;
+            $root = $root ?: getcwd();
+            $from = strpos($from, $root) === 0 ? $from : preg_replace('/\/+/', '/', $root.'/'.$from);
+            $to = strpos($to, $root) === 0 ? $to : preg_replace('/\/+/', '/', $root.'/'.$to);
 
             // or traveling the tree via `..`
             // attempt to resolve path, or assume it's fine if it doesn't exist
@@ -70,6 +71,14 @@ class Converter implements ConverterInterface
         // deal with different operating systems' directory structure
         $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');
 
+        // remove leading current directory.
+        if (substr($path, 0, 2) === './') {
+            $path = substr($path, 2);
+        }
+
+        // remove references to current directory in the path.
+        $path = str_replace('/./', '/', $path);
+
         /*
          * Example:
          *     /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif
@@ -155,7 +164,7 @@ class Converter implements ConverterInterface
         $to = mb_substr($this->to, mb_strlen($shared));
 
         // add .. for every directory that needs to be traversed to new path
-        $to = str_repeat('../', mb_substr_count($to, '/'));
+        $to = str_repeat('../', count(array_filter(explode('/', $to))));
 
         return $to.ltrim($path, '/');
     }

+ 0 - 0
plugins/matthiasmullie/path-converter/ConverterInterface.php


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor