@param string $file

@return bool
550846
public function hasLoaded(string $file) : bool
    {
        $file = $this->sanitizeFileName($file);
        return isset($this->loaded[$file]);
    }
518192
public static function isLink(string $file = ''): bool
    {
        $file = static::normalizePath($file);
        return static::exists($file) && \is_link($file);
    }
971498
public function once(string $file)
    {
        if (!$this->hasLoaded($file)) {
            return $this->load($file);
        }

        return false;
    }
940203
private function shouldCopyFileInstead($file)
    {
        // Check if it should not be processed.
        if ($this->isExcludedFromVerbatim($file)) {
            return false;
        }

        foreach ($this->copyVerbatimPatterns as $pattern) {
            if (Str::is($pattern, $file)) {
                return true;
            }
        }

        return false;
    }
909277
public static function isImage($file)
    {
        if (!$v = getimagesize($file)) {
            return false;
        }
        return in_array($v[2], [IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP]);
    }
982225
public static function clear($file = false) {

        if ($file && self::isFile($file)) {

            $f = @fopen($file, "r+");
            if ($f !== false) {
                ftruncate($f, 0);
                fclose($f);

                return true;
            }
        }

        return false;
    }
604021
public function delete($file)
    {
        return ($this->isConnected() === true) ? ftp_delete($this->getConnection(), $file) : false;
    }
276160
protected function ensureDirectoryIsPresent($file)
    {
        $directory = dirname($file);

        //@todo might want to check for regular file?
        if (!file_exists($directory)) {
            return $this->createDirectory($directory);
        }

        return true;
    }
120936
public function readConfig($file = 'config.php')
    {
        $orig_file = $file;

        if (strpos($file, '.php') != strlen($file) - 4) {
            $file .= '.php';
        }

        if (strpos($file, '/') === false) {
            $file = getcwd().'/'.$this->config_location.'/'.$file;
        }

        if (file_exists($file)) {
            // some tricky thing to make config be read in some cases it could not in simple way
            unset($config);

            $config = &$this->config;
            $this->config_files_loaded[] = $file;
            include $file;

            unset($config);

            return true;
        }

        return false;
    }
1349855
public static function checkFile($file)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('General::checkFile()', '`General::checkFileWritable()');
        }
        clearstatcache();
        $dir = dirname($file);

        if (
            (!is_writable($dir) || !is_readable($dir)) // Folder
            || (file_exists($file) && (!is_readable($file) || !is_writable($file))) // File
        ) {
            return false;
        }

        return true;
    }
87618
public static function isFileEmpty($file)
    {
        if (!is_file($file)) {
            throw new RuntimeException(sprintf('Invalid file path supplied'));
        }

        return mb_strlen(file_get_contents($file, 2), 'UTF-8') > 0 ? false : true;
    }
605683
private function initialize($file)
    {
        if (file_exists($file)) {
            $this->file = realpath($file);
            return false;
        }
        file_put_contents($file, '');
        $this->file = realpath($file);
        return true;
    }
264720
public function parseFile($file)
    {
        if (!file_exists($file)) {
            return false;
        }
        $fh = fopen($file, 'r');
        if (!$fh) {
            return false;
        }
        $ret = $this->parseHandle($fh);
        fclose($fh);
        return $ret;
    }
1123099
public function onceIgnore(string $file)
    {
        if (!$this->hasLoaded($file)) {
            return $this->loadIgnore($file);
        }

        return false;
    }
917642
public function delete( $file ) {

		$parent = $this->get_file( dirname( $file ) );

		$filename = basename( $file );

		if (
			false === $parent
			|| 'dir' !== $parent->type
			|| false === isset( $parent->contents->$filename )
		) {
			return false;
		}

		unset( $parent->contents->$filename );

		return true;
	}
895781
public function loadFile($file)
    {
        $xml = file_get_contents($file);
        if (!$xml) {
            return false;
        }

        try {
            $this->setXml($xml);
        } catch (\Exception $e) {
            return false;
        }

        return true;
    }
216472
public static function checkFileName($file)
    {
        return strpos($file, '/') === false && strpos($file, '\\') === false && strpos($file, '..') === false;
    }