Exception:Array
(
[message] => Call to undefined function MatthiasMullie\PathConverter\mb_substr()
[file] => /home/www/vvveb/www/plugins/minify/system/minify/Converter.php
[line_no] => 162
[line] => $path = mb_substr($path, mb_strlen($shared)); // <==
[lines] => Array
(
[0] => }
[1] =>
[2] => // normalize paths
[3] => $path = $this->normalize($this->from . '/' . $path);
[4] =>
[5] => // strip shared ancestor paths
[6] => $shared = $this->shared($path, $this->to);
[7] => $path = mb_substr($path, mb_strlen($shared)); // <==
[8] => $to = mb_substr($this->to, mb_strlen($shared));
[9] =>
[10] => // add .. for every directory that needs to be traversed to new path
[11] => $to = str_repeat('../', count(array_filter(explode('/', $to))));
[12] =>
[13] => return $to . ltrim($path, '/');
)
[trace] => #0 /home/www/vvveb/www/plugins/minify/system/minify/CSS.php(447): MatthiasMullie\PathConverter\Converter->convert()
#1 /home/www/vvveb/www/plugins/minify/system/minify/CSS.php(342): MatthiasMullie\Minify\CSS->move()
#2 /home/www/vvveb/www/plugins/minify/system/minify/Minify.php(152): MatthiasMullie\Minify\CSS->execute()
#3 /home/www/vvveb/www/plugins/minify/plugin.php(340): MatthiasMullie\Minify\Minify->minify()
#4 /home/www/vvveb/www/plugins/minify/plugin.php(374): MinifyPlugin->processCss()
#5 /home/www/vvveb/www/system/event.php(77): MinifyPlugin->{closure:MinifyPlugin::app():369}()
#6 /home/www/vvveb/www/system/core/view.php(436): Vvveb\System\Event::trigger()
#7 /home/www/vvveb/www/system/core/view.php(360): Vvveb\System\Core\View->compile()
#8 /home/www/vvveb/www/system/core/view.php(575): Vvveb\System\Core\View->checkNeedRecompile()
#9 /home/www/vvveb/www/system/core/response.php(169): Vvveb\System\Core\View->render()
#10 /home/www/vvveb/www/system/core/frontcontroller.php(276): Vvveb\System\Core\Response->output()
#11 /home/www/vvveb/www/system/core/frontcontroller.php(327): Vvveb\System\Core\FrontController::call()
#12 /home/www/vvveb/www/system/core/frontcontroller.php(401): Vvveb\System\Core\FrontController::redirect()
#13 /home/www/vvveb/www/system/core/startup.php(518): Vvveb\System\Core\FrontController::dispatch()
#14 /home/www/vvveb/www/index.php(170): Vvveb\System\Core\start()
#15 /home/www/vvveb/www/public/index.php(28): include('...')
#16 {main}
[code] => Array
(
[0] =>
[2] => namespace MatthiasMullie\PathConverter;
[3] =>
[4] => /**
[5] => * Convert paths relative from 1 file to another.
[6] => *
[7] => * E.g.
[8] => * ../../images/icon.jpg relative to /css/imports/icons.css
[9] => * becomes
[10] => * ../images/icon.jpg relative to /css/minified.css
[11] => *
[12] => * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
[13] => *
[14] => * @author Matthias Mullie
[15] => * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
[16] => * @license MIT License
[17] => */
[18] => class Converter implements ConverterInterface
[19] => {
[20] => /**
[21] => * @var string
[22] => */
[23] => protected $from;
[24] =>
[25] => /**
[26] => * @var string
[27] => */
[28] => protected $to;
[29] =>
[30] => /**
[31] => * @param string $from The original base path (directory, not file!)
[32] => * @param string $to The new base path (directory, not file!)
[33] => * @param string $root Root directory (defaults to `getcwd`)
[34] => */
[35] => public function __construct($from, $to, $root = '')
[36] => {
[37] => $shared = $this->shared($from, $to);
[38] => if ($shared === '') {
[39] => // when both paths have nothing in common, one of them is probably
[40] => // absolute while the other is relative
[41] => $root = $root ?: getcwd();
[42] => $from = strpos($from, $root) === 0 ? $from : preg_replace('/\/+/', '/', $root . '/' . $from);
[43] => $to = strpos($to, $root) === 0 ? $to : preg_replace('/\/+/', '/', $root . '/' . $to);
[44] =>
[45] => // or traveling the tree via `..`
[46] => // attempt to resolve path, or assume it's fine if it doesn't exist
[47] => $from = @realpath($from) ?: $from;
[48] => $to = @realpath($to) ?: $to;
[49] => }
[50] =>
[51] => $from = $this->dirname($from);
[52] => $to = $this->dirname($to);
[53] =>
[54] => $from = $this->normalize($from);
[55] => $to = $this->normalize($to);
[56] =>
[57] => $this->from = $from;
[58] => $this->to = $to;
[59] => }
[60] =>
[61] => /**
[62] => * Normalize path.
[63] => *
[64] => * @param string $path
[65] => *
[66] => * @return string
[67] => */
[68] => protected function normalize($path)
[69] => {
[70] => // deal with different operating systems' directory structure
[71] => $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');
[72] =>
[73] => // remove leading current directory.
[74] => if (substr($path, 0, 2) === './') {
[75] => $path = substr($path, 2);
[76] => }
[77] =>
[78] => // remove references to current directory in the path.
[79] => $path = str_replace('/./', '/', $path);
[80] =>
[81] => /*
[82] => * Example:
[83] => * /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif
[84] => * to
[85] => * /home/forkcms/frontend/core/layout/images/img.gif
[86] => */
[87] => do {
[88] => $path = preg_replace('/[^\/]+(? } while ($count);
[90] =>
[91] => return $path;
[92] => }
[93] =>
[94] => /**
[95] => * Figure out the shared path of 2 locations.
[96] => *
[97] => * Example:
[98] => * /home/forkcms/frontend/core/layout/images/img.gif
[99] => * and
[100] => * /home/forkcms/frontend/cache/minified_css
[101] => * share
[102] => * /home/forkcms/frontend
[103] => *
[104] => * @param string $path1
[105] => * @param string $path2
[106] => *
[107] => * @return string
[108] => */
[109] => protected function shared($path1, $path2)
[110] => {
[111] => // $path could theoretically be empty (e.g. no path is given), in which
[112] => // case it shouldn't expand to array(''), which would compare to one's
[113] => // root /
[114] => $path1 = $path1 ? explode('/', $path1) : array();
[115] => $path2 = $path2 ? explode('/', $path2) : array();
[116] =>
[117] => $shared = array();
[118] =>
[119] => // compare paths & strip identical ancestors
[120] => foreach ($path1 as $i => $chunk) {
[121] => if (isset($path2[$i]) && $path1[$i] == $path2[$i]) {
[122] => $shared[] = $chunk;
[123] => } else {
[124] => break;
[125] => }
[126] => }
[127] =>
[128] => return implode('/', $shared);
[129] => }
[130] =>
[131] => /**
[132] => * Convert paths relative from 1 file to another.
[133] => *
[134] => * E.g.
[135] => * ../images/img.gif relative to /home/forkcms/frontend/core/layout/css
[136] => * should become:
[137] => * ../../core/layout/images/img.gif relative to
[138] => * /home/forkcms/frontend/cache/minified_css
[139] => *
[140] => * @param string $path The relative path that needs to be converted
[141] => *
[142] => * @return string The new relative path
[143] => */
[144] => public function convert($path)
[145] => {
[146] => // quit early if conversion makes no sense
[147] => if ($this->from === $this->to) {
[148] => return $path;
[149] => }
[150] =>
[151] => $path = $this->normalize($path);
[152] => // if we're not dealing with a relative path, just return absolute
[153] => if (strpos($path, '/') === 0) {
[154] => return $path;
[155] => }
[156] =>
[157] => // normalize paths
[158] => $path = $this->normalize($this->from . '/' . $path);
[159] =>
[160] => // strip shared ancestor paths
[161] => $shared = $this->shared($path, $this->to);
[162] => $path = mb_substr($path, mb_strlen($shared)); // <==
[163] => $to = mb_substr($this->to, mb_strlen($shared));
[164] =>
[165] => // add .. for every directory that needs to be traversed to new path
[166] => $to = str_repeat('../', count(array_filter(explode('/', $to))));
[167] =>
[168] => return $to . ltrim($path, '/');
[169] => }
[170] =>
[171] => /**
[172] => * Attempt to get the directory name from a path.
[173] => *
[174] => * @param string $path
[175] => *
[176] => * @return string
[177] => */
[178] => protected function dirname($path)
[179] => {
[180] => if (@is_file($path)) {
[181] => return dirname($path);
[182] => }
[183] =>
[184] => if (@is_dir($path)) {
[185] => return rtrim($path, '/');
[186] => }
[187] =>
[188] => // no known file/dir, start making assumptions
[189] =>
[190] => // ends in / = dir
[191] => if (mb_substr($path, -1) === '/') {
[192] => return rtrim($path, '/');
[193] => }
[194] =>
[195] => // has a dot in the name, likely a file
[196] => if (preg_match('/.*\..*$/', basename($path)) !== 0) {
[197] => return dirname($path);
[198] => }
[199] =>
[200] => // you're on your own here!
[201] => return $path;
[202] => }
[203] => }
)
)