mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
patch for minify to support EGroupware set up as an alias, which is a common setup
This commit is contained in:
parent
019a84cd17
commit
82c73c423e
@ -152,6 +152,13 @@ $min_serveOptions['minApp']['groupsOnly'] = false;
|
|||||||
*/
|
*/
|
||||||
$min_symlinks = array();
|
$min_symlinks = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure an alias for EGroupware, as it is common setup
|
||||||
|
*
|
||||||
|
* Requires patched lib/Minify/Controller/MinApp.php, to understand aliases defined as symlink!
|
||||||
|
*/
|
||||||
|
list($sitePrefix) = explode('/phpgwapi/inc/min/', $_SERVER['REQUEST_URI']);
|
||||||
|
$min_symlinks['//'.ltrim($sitePrefix, '/')] = dirname(dirname(dirname(__DIR__)));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you upload files from Windows to a non-Windows server, Windows may report
|
* If you upload files from Windows to a non-Windows server, Windows may report
|
||||||
|
@ -136,10 +136,18 @@ class Minify_Controller_MinApp extends Minify_Controller_Base {
|
|||||||
foreach ((array)$cOptions['allowDirs'] as $allowDir) {
|
foreach ((array)$cOptions['allowDirs'] as $allowDir) {
|
||||||
$allowDirs[] = realpath(str_replace('//', $_SERVER['DOCUMENT_ROOT'] . '/', $allowDir));
|
$allowDirs[] = realpath(str_replace('//', $_SERVER['DOCUMENT_ROOT'] . '/', $allowDir));
|
||||||
}
|
}
|
||||||
|
$base_path = $_SERVER['DOCUMENT_ROOT'].$base;
|
||||||
|
// check base against symlinks to support aliases configured via symlinks
|
||||||
|
if (!(file_exists($base_path) && is_dir($base_path) && realpath($base_path) !== false) &&
|
||||||
|
isset($options['minifierOptions']['text/css']['symlinks'][$t='//'.trim($base, '/')]) &&
|
||||||
|
($base_path = realpath($options['minifierOptions']['text/css']['symlinks'][$t]))) {
|
||||||
|
$base_path .= '/';
|
||||||
|
$allowDirs[] = $base_path;
|
||||||
|
}
|
||||||
$basenames = array(); // just for cache id
|
$basenames = array(); // just for cache id
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$uri = $base . $file;
|
$uri = $base . $file;
|
||||||
$path = $_SERVER['DOCUMENT_ROOT'] . $uri;
|
$path = $base_path . $file;
|
||||||
$realpath = realpath($path);
|
$realpath = realpath($path);
|
||||||
if (false === $realpath || ! is_file($realpath)) {
|
if (false === $realpath || ! is_file($realpath)) {
|
||||||
$this->log("The path \"{$path}\" (realpath \"{$realpath}\") could not be found (or was not a file)");
|
$this->log("The path \"{$path}\" (realpath \"{$realpath}\") could not be found (or was not a file)");
|
||||||
|
Loading…
Reference in New Issue
Block a user