mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2982 - Speed up SCSS themes compilation during setup - fix included files with same name and folder
This commit is contained in:
@@ -772,8 +772,8 @@ CSS;
|
||||
// Handle shortcut syntax : @import "typo" ;
|
||||
// file matched: _typo.scss
|
||||
$sShortCut = substr($sFilePath, strrpos($sFilePath, '/') + 1);
|
||||
$sFilePath = str_replace($sShortCut, "_$sShortCut.scss", $sFilePath);
|
||||
$sFileURI = str_replace($sShortCut, "_$sShortCut.scss", $sFileURI);
|
||||
$sFilePath = static::ReplaceLastOccurrence($sShortCut, "_$sShortCut.scss", $sFilePath);
|
||||
$sFileURI = static::ReplaceLastOccurrence($sShortCut, "_$sShortCut.scss", $sFileURI);
|
||||
$sImportedFile = realpath($sFilePath);
|
||||
}
|
||||
|
||||
@@ -799,6 +799,27 @@ CSS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $search
|
||||
* @param $replace
|
||||
* @param $subject
|
||||
*
|
||||
* @since 3.0.0 N°2982
|
||||
* Replaces last occurrence of the string
|
||||
* @return string|string[]
|
||||
*/
|
||||
static function ReplaceLastOccurrence($sSearch, $sReplace, $sSubject)
|
||||
{
|
||||
$iPos = strrpos($sSubject, $sSearch);
|
||||
|
||||
if($iPos !== false)
|
||||
{
|
||||
$sSubject = substr_replace($sSubject, $sReplace, $iPos, strlen($sSearch));
|
||||
}
|
||||
|
||||
return $sSubject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.0.0 N°2982
|
||||
* Used for testing purpose
|
||||
|
||||
Reference in New Issue
Block a user