Contao\Dbafs::isFileSyncExclude PHP Method

isFileSyncExclude() protected static method

Check if a file or folder is excluded from synchronization
protected static isFileSyncExclude ( string $strPath ) : boolean
$strPath string The relative path
return boolean True if the file or folder is excluded from synchronization
    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;
    }