protected static function isFileSyncExclude($strPath)
{
if (\Config::get('uploadPath') == 'templates') {
return true;
}
if (is_file(TL_ROOT . '/' . $strPath)) {
$strPath = dirname($strPath);
}
// Outside the files directory
if (strncmp($strPath . '/', \Config::get('uploadPath') . '/', strlen(\Config::get('uploadPath')) + 1) !== 0) {
return true;
}
// Check the excluded folders
if (\Config::get('fileSyncExclude') != '') {
$arrExempt = array_map(function ($e) {
return \Config::get('uploadPath') . '/' . $e;
}, \StringUtil::trimsplit(',', \Config::get('fileSyncExclude')));
foreach ($arrExempt as $strExempt) {
if (strncmp($strExempt . '/', $strPath . '/', strlen($strExempt) + 1) === 0) {
return true;
}
}
}
return false;
}