Used in order to process the input file.  After processing this input
file, it will return a new file name for the rest of the process to use
if needed.

@param string $filename
@param string $actualFileName
@return string
198536
public function process($filename, $actualFileName)
    {
        // Check if the processing should be done
        if(!$this->shouldProcess($filename))
        {
            // No need to process the file, so bypass
            return $this->getFinalName($filename);
        }

        // Get an instance of the SASS compiler
        $sass = new \scssc();

        // Otherwise write the file and return the new file name
        return $this->write($sass->compile(file_get_contents($filename)), $actualFileName);
    }
799018
public function main($sourceFileName)
    {
        $modName = $this->modifyName($sourceFileName);
        if ($this->fromPrefix === null
            || (strlen($sourceFileName) < ($this->prefixLength + $this->postfixLength)
                || (!$this->fromContainsStar && !$modName === $this->modifyName($this->fromPrefix)))
            || ($this->fromContainsStar
                && (!StringHelper::startsWith($this->modifyName($this->fromPrefix), $modName)
                    || !StringHelper::endsWith($this->modifyName($this->fromPostfix), $modName)))
        ) {
            return null;
        }
        return [
            $this->toPrefix . (
            $this->toContainsStar
                ? $this->extractVariablePart($sourceFileName) . $this->toPostfix
                : ''
            )
        ];
    }
597255
public String getFileName(String originalFileName) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileName)) {
            return m_targetFileName;
        } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileNamePrefix)) {
            return m_targetFileNamePrefix + originalFileName;
        } else {
            return originalFileName;
        }
    }
370792
protected function logFilename($filename, $filePath)
    {
        $filePath = trim(rtrim($filePath, "\/"));
        $filename = trim(trim($filename, "\/"));

        $path = $filePath . DIRECTORY_SEPARATOR . $filename;

        if (!realpath($path) || !file_exists($path)) {
            touch($path);
        }

        return realpath($path);
    }
478873
static function filenameWithoutExtension($filename) {
		$filename=self::filename($filename);
		if (preg_match('~(.*)\.(\w{1,10})$~',$filename,$parts)) {
			return $parts[1];
		}
		return $filename;
	}
218139
private function getNormalizedFileName($originalFileName)
    {
        if (false !== strpos($originalFileName, '.')) {
            $pathParts = pathinfo($originalFileName);
            $fileName = $this->pathCleaner->cleanup($pathParts['filename']);
            $fileName .= '.' . $pathParts['extension'];
        } else {
            $fileName = $this->pathCleaner->cleanup($originalFileName);
        }

        return $fileName;
    }
755583
public static function realpath($pFilename) {
		// Returnvalue
		$returnValue = '';

		// Try using realpath()
		if (file_exists($pFilename)) {
			$returnValue = realpath($pFilename);
		}

		// Found something?
		if ($returnValue == '' || ($returnValue === NULL)) {
			$pathArray = explode('/' , $pFilename);
			while(in_array('..', $pathArray) && $pathArray[0] != '..') {
				for ($i = 0; $i < count($pathArray); ++$i) {
					if ($pathArray[$i] == '..' && $i > 0) {
						unset($pathArray[$i]);
						unset($pathArray[$i - 1]);
						break;
					}
				}
			}
			$returnValue = implode('/', $pathArray);
		}

		// Return
		return $returnValue;
	}
1113450
protected function setFilename($filename)
    {
        if (is_string($filename)) {
            if (is_readable($filename)) {
                $this->filename = $filename;
            } elseif (file_exists($filename)) {
                throw new \InvalidArgumentException("File '$filename' isn't readable.");
            } else {
                throw new \InvalidArgumentException("File '$filename' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($filename). "' for argument 'filename' given."
            );
        }

        return $this;
    }
1189922
private function normalizeFileName($fileName)
    {
        if (!is_array($fileName)) {
            return $fileName;
        }

        return isset($fileName['filename']) ? $fileName['filename']
            : isset($fileName['file']) ? $fileName['file'] : ''
        ;
    }
845976
private function setRealFileName($value) {
        $base64FileNamePos = strpos($value, 'filename ');
        if (is_int($base64FileNamePos) && $base64FileNamePos >= 0) {
            $value = substr($value, $base64FileNamePos + 9); // 9 - length of 'filename '
            $this->realFileName = base64_decode($value);
        } else {
            $this->realFileName = $value;
        }
        return $this;
    }
1085597
public function getFilename()
    {
        /** @var BaseConverter $converter */
        $converter = $this->getDocument()->getConverter();
        return $converter->getDestinationFilenameRelativeToProjectRoot($this->getDocument()->getFile());
    }
1361363
public function fetchName(string $filename): ?string
    {
        return str_replace('\\', '/', substr($filename, 0, -1 * (1 + strlen($this->extension))));
    }
448254
public function process($filename, $actualFileName)
    {
        // Check if the processing should be done
        if(!$this->shouldProcess($filename))
        {
            // No need to process the file, so bypass
            return $this->getFinalName($filename);
        }

        // Get an instance of the LESS compiler
        $less = new lessc();

        // Otherwise write the file and return the new file name
        return $this->write($less->compileFile($filename), $actualFileName);
    }
1209700
protected function getFileName()
    {
        $fileName = parent::getFileName();

        if ($this->maxCount !== false) {
            $fileName = strtr($fileName, [$this->countPlaceHolder => $this->currentFileCount]);
        }

        return $fileName;
    }
1345484
public function getFile($filename) {

        $filename = realpath(__DIR__.'/../headers/'.$filename.'.txt');

        if(!file_exists($filename)) throw new \Exception('Filename doesnt exist.');

        return file_get_contents($filename);
    }
373627
static function _NormalizeFilename($filename){
		$_filename = "";
		while(1){
			$_filename = preg_replace('/[^\/]+\/+\.\.\//','/',$filename); // "/path/to/dir/../tmp/images/" -> "/path/to/tmp/images/"
			if($_filename==$filename){ break; }
			$filename = $_filename;
		}
		$filename = $_filename;

		$filename = preg_replace('/\/\/+/','/',$filename); // "/path/to//tmp/dir//" -> "/path/to/tmp/dir/"

		return $filename;
	}
276432
public function setFileName($fileName = null) {
		if (empty($fileName)) {
			return false;
		}

		$this->_fileName = (string)$fileName;

		return true;
	}