/** * Sets file mask to configured value for given file. * * Does not do anything if running on windows * * @param string $path Path to file to set mask for */ protected function setFileMask($path) { // we cannot do this on windows if (!(strtoupper(substr(PHP_OS, 0, 3)) == "WIN")) { chmod($path, $this->importerConfiguration->getImportFileMask()); } }
/** * Check whether given filename matches file pattern in configuration * * @param string $fileName * @return bool */ protected function fileMatchesFilePattern($fileName) { foreach ($this->importerConfiguration->getSupportedFileTypes() as $filePattern) { $filePattern = '.' . $filePattern; if (substr($fileName, 0, 1) !== '.' && substr_compare(strtolower($fileName), $filePattern, -strlen($filePattern), strlen($filePattern)) == 0) { return TRUE; } } return FALSE; }