isReadableFile

@access protected
@return string|boolean
481545
protected function isReadableFile(array $parameter)
    {
        extract($parameter);

        if (null !== parse_url($source, PHP_URL_SCHEME)) {
            return $this->isValidDomain($source);
        }

        if (is_file($file = $this->config->base . '/' . $source)) {
            return $file;
        }
        return false;
    }
371613
public function check()
    {
        $this->isFound = file_exists($this->filename);
        $this->isReadable = is_readable($this->filename);

        $result = $this->isFound && $this->isReadable;

        return $result;
    }
1319386
public function isReadableForCurrentMember()
	{
		if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_ALL)
		{
			return true;
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_LOGGED_USER && FE_USER_LOGGED_IN)
		{
			return true;
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_CUSTOM && FE_USER_LOGGED_IN)
		{
			return $this->isAccessibleForCurrentMember(\AccessRight::READ);
		}
		else if ($this->generalReadPermission == self::GENERAL_READ_PERMISSION_INHERIT && $this->hasParentCategory())
		{
			return $this->parentCategory->isReadableForCurrentMember();
		}
		return false;
	}
162917
public function read()
    {

        // if file is readable
        if ($this->readable !== true) return false;

        if (!empty($this->fp) && is_resource($this->fp)) fclose($this->fp);

        $this->open_fp('r');

        if (filesize($this->file) == 0) return false;
        $this->lock(LOCK_SH);

        $content = (string)fread($this->fp, ($this->size >= 0) ? $this->size : 1);

        $this->lock(LOCK_UN);

        return $content;
    }
41545
public function isWritable()
    {
        return in_array($this->mode, [
            StreamMode::WRITE_CLEAN,
            StreamMode::WRITE_END,
            StreamMode::CREATE_READ_WRITE,
            StreamMode::CREATE_WRITE,
            StreamMode::READ_WRITE,
            StreamMode::READ_WRITE_CLEAN,
            StreamMode::READ_WRITE_END,
        ]);
    }
414117
public function isWritable()
    {
        if (null !== ($uri = $this->getMetadata('uri'))) {
            if (is_writable($uri)) {
                return true;
            } elseif (null !== ($mode = $this->getMetadata('mode'))) {
                preg_match_all('/[a-z]\D?/', $mode, $matches);

                if (isset($matches[ 0 ])) {
                    foreach ($matches[ 0 ] as $match) {
                        if (in_array($match, ['r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'])) {
                            return true;

                            break;
                        }
                    }
                }
            }
        }

        return false;
    }
433502
public function isFile(): bool
    {
        if ($this->caching == false) {
            return is_file($this->getAbsoluteFilePath());
        }

        if ($this->isFile == null) {
            $this->isFile = is_file($this->getAbsoluteFilePath());
        }

        return $this->isFile;
    }
780602
protected function getReadableData()
    {
        $job  = $this->monitorJob;
        $data = $job->getArrayCopy();
        
        // Skip when job is not started
        if ($data['setTime'] == 0) return;
        
        $data['firstCheck'] = date(MonitorJob::$monitorDateFormat, $data['firstCheck']);
        $data['checkTime'] = date(MonitorJob::$monitorDateFormat, $data['checkTime']);
        $data['setTime'] = date(MonitorJob::$monitorDateFormat, $data['setTime']);
        $period = $data['period'];
        $mins = $period % 3600;
        $secs = $mins % 60;
        $hours = ($period - $mins) / 3600;
        $mins = ($mins - $secs) / 60;
        $data['period'] = sprintf('%2d:%02d:%02d',$hours,$mins,$secs);
        
        return $data;
    }
1113347
public function isWritable()/*# : bool */
    {
        foreach ($this->lookup_pool as $reg) {
            if ($reg instanceof WritableInterface && $reg->isWritable()) {
                $this->clearLookupCache();
                $this->setWritable($reg);
                return true;
            }
        }
        return false;
    }
289009
function isReadable( $filename = false )
    {
        if ( !$filename )
            $filename = $this->FileName;
        return $this->doIsReadable( $filename );
    }
503995
public function isWritable()
    {
        if (!$this->isValidResource($this->resource)) {
            return false;
        }

        $meta = stream_get_meta_data($this->resource);
        $mode = $meta['mode'];

        return (
            strstr($mode, 'x')
            || strstr($mode, 'w')
            || strstr($mode, 'c')
            || strstr($mode, 'a')
            || strstr($mode, '+')
        );
    }
1012918
protected function isFilesystemReadable(/*# string */ $path)/*# : bool */
    {
        if ($this->getFilesystem()->isReadable()) {
            return true;
        } else {
            return $this->setError(
                Message::get(Message::STR_FS_NONREADABLE, $path),
                Message::STR_FS_NONREADABLE
            );
        }
    }
1073584
public function isReadable($path)
    {
        $node = $this->at($path);
        return null !== $node && (0x0100 & $node->perms);
    }
1152579
protected function isStreamReadable($stream)
    {
        if (empty($stream)) {
            return false;
        }
        if ($stream instanceof StreamInterface) {
            return $stream->isReadable();
        }

        // Ensure resource is stream type
        if (!is_resource($stream)) {
            return false;
        }
        if (get_resource_type($stream) !== 'stream') {
            return false;
        }

        // Ensure stream is readable
        $meta = stream_get_meta_data($stream);
        return isset($meta['mode']) && (strstr($meta['mode'], 'r') || strstr($meta['mode'], '+'));
    }
1284903
public static function getIsMbstringEnabled()
    {
        if (isset(self::$isMbstringEnabled)) {
            return self::$isMbstringEnabled;
        }

        self::$isMbstringEnabled = function_exists('mb_convert_encoding') ?
            true : false;

        return self::$isMbstringEnabled;
    }
193809
private function isReadable($filename)
    {
        $maxPathLength = PHP_MAXPATHLEN - 2;

        if (strlen($filename) > $maxPathLength) {
            throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);
        }

        return is_readable($filename);
    }
1024529
public function can_read() {
        if ($this->is_draft()) {
            return self::can_read_user_draft($this->get('userid'));
        }
        return self::can_read_user($this->get('userid'));
    }