Check if the file is missing or is not readable

@param string $file Path to file
@return bool True on success, false otherwise
519386
public static function isFileReadable($file)
    {
        $result = false;

        if (!file_exists($file)) {
            return $result;
        }
        if (!is_file($file)) {
            return $result;
        }
        if (!is_readable($file)) {
            return $result;
        }

        $result = true;

        return $result;
    }
929507
protected function pageExists($file)
    {
        $file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
        return $file != ''
            && substr($file, 0, strlen($this->pages_dir)) == $this->pages_dir
            && file_exists($file)
            && is_readable($file);
    }
966955
public function loadIgnore(string $file)
    {
        if (file_exists($this->getThemePath() . $this->sanitizeFileName($file))) {
            return $this->load($file);
        }

        return false;
    }
221545
public function delFile($file)
    {
        $file = $this->checkpath($file);
        if (@!ftp_delete($this->linkid, $file)) {
            $this->close();
            return false;
        }
        $this->close();
        return true;
    }
368916
protected static function checkFileReadableJob(string $path): bool
    {
        if (!\is_file($path) || !\is_readable($path)) {
            return false;
        }
        
        return true;
    }
429907
public static function remove(string $file = ''): bool
    {
        $file = static::normalizePath($file);
        if (static::exists($file)) {
            return @\unlink($file);
        }
        return false;
    }
1048198
public static function checkFileDeletable($file)
    {
        clearstatcache();
        $dir = dirname($file);
        // Deleting a file requires write permissions on the directory.
        // It does not require write permissions on the file
        return @file_exists($dir) && @is_writable($dir);
    }
510628
public function checkFilename($file)
    {
        $newFilename  = $file;
        $parts        = pathinfo($file);
        $origFilename = $parts['filename'];
        $ext          = (isset($parts['extension']) && ($parts['extension'] != '')) ? '.' . $parts['extension'] : null;

        $i = 1;

        while (file_exists($this->uploadDir . DIRECTORY_SEPARATOR . $newFilename)) {
            $newFilename = $origFilename . '_' . $i . $ext;
            $i++;
        }

        return $newFilename;
    }
258208
public function file_contains_php($file)
    {
        $contents = file_get_contents($file);
        $position = strpos($contents, '<?php');
        return $position !== false;
    }
992656
public function has($file)
    {
        if (($isArray = is_array($file)) || $file instanceof Traversable) {
            foreach ($file as $key => $f) {
                try {
                    if ( ! $this->has($f)) {
                        return false;
                    }
                }
                catch (InvalidArgumentException $e) {
                    throw new UnexpectedValueException(
                        sprintf(
                            "%s's value at key %s caused InvalidArgumentException",
                            $isArray ? 'Array' : 'FileBag',
                            $key
                        ),
                        null,
                        $e
                    );
                }
                catch (UnexpectedValueException $e) {
                    throw new UnexpectedValueException(
                        sprintf(
                            "%s's value at key %s caused UnexpectedValueException",
                            $isArray ? 'Array' : 'FileBag',
                            $key
                        ),
                        null,
                        $e
                    );
                }
            }
        }
        elseif ($file instanceof SplFileInfo
            || $file instanceof File
        ) {
            return $this->files->contains($file);
        }
        else {
            throw InvalidArgumentException::create(
                sprintf(
                    '%1$s/File|%1$s/File[]|%1$s/FileBag',
                    __NAMESPACE__
                ),
                $file
            );
        }

        return true;
    }
411798
public function allowed($file)
    {
        return in_array($file->getType(), array('file', 'dir')) && $file->isReadable() && !$this->isInitialPath($file);
    }
1035914
static function fileExists($file){
        if(file_exists($file)) return $file;
        if(file_exists(static::$www.$file)) return static::$www.$file;
        if(file_exists(static::$phar.$file)) return static::$phar.$file;
        $xfile = str_replace(static::$www, static::$phar, $file);
        if(file_exists($xfile)) return $xfile;
        return false;
    }
372930
public function allowed($file)
    {
        return in_array($file->getType(), array('file', 'dir')) && $file->isWritable() && !$this->isInitialPath($file);
    }
1190797
public static function exists(string $file = ''): bool
    {
        $file = static::normalizePath($file);
        return static::verifyPath($file) && \file_exists($file) && \is_file($file);
    }
702699
private function isExcludedFromVerbatim($file)
    {
        foreach ($this->copyVerbatimExcludePatterns as $pattern) {
            if (Str::is($pattern, $file)) {
                return true;
            }
        }

        return false;
    }
1146489
public function has(string $file, string $ext = ''): bool
    {
        return $this->findFile($file, $ext) !== null;
    }
1024456
protected static function isWhitelisted($file)
    {
        if (!is_array(self::$whitelist) || count(self::$whitelist) === 0) {
            return true;
        }
        foreach (self::$whitelist as $fileName) {
            if (strpos($file, $fileName)) {
                return true;
            }
        }
        return false;
    }