Open file for reading and return file pointer

@param  string   file hash
@return Resource
@author Dmitry (dio) Levashov
421879
public function open($hash) {
		if (($file = $this->file($hash)) == false
		|| $file['mime'] == 'directory') {
			return false;
		}
		
		return $this->fopenCE($this->decode($hash), 'rb');
	}
368359
public static function readFile(string $file): string
    {
        $contents = @\file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException(\sprintf('File not found: "%s"', $file));
        }
        
        return $contents;
    }
610163
private function read_file($file)
  {
    $handler = fopen($file, "r");
    $file_content = fread($handler, filesize($file));
    fclose($handler);

    return $file_content;
  }
1236501
public function read($file)
	{
		$this->file = $file;

		if($this->fs->exists($this->file)) {

			$this->data = file_get_contents($this->file);

			return $this;
		}

		// Throw exception
		throw new Exceptions\FileNotExists($this->file);
	}
88180
public static function for_file($file)
    {
        if (!$file || (is_string($file) && !file_exists($file))) {
            return null;
        }

        // Ensure we have a File instance to work with
        if (is_string($file)) {
            /** @var File $fileObject */
            $fileObject = File::create();
            $fileObject->setFromLocalFile($file);
            $file = $fileObject;
        }

        $extension = $file->getExtension();
        $mime = $file->getMimeType();

        foreach (self::get_extractor_classes() as $className) {
            $extractor = self::get_extractor($className);

            // Skip unavailable extractors
            if (!$extractor->isAvailable()) {
                continue;
            }

            // Check extension
            if ($extension && $extractor->supportsExtension($extension)) {
                return $extractor;
            }

            // Check mime
            if ($mime && $extractor->supportsMime($mime)) {
                return $extractor;
            }
        }
    }
933208
public final function loadFile($file) {
        $f = $this->getPath($file);
        if (is_file($f) && is_readable($f)) {
            return @file_get_contents($f);
        }

        return false;
    }
957936
public function load($file)
    {
        $resource = new ZipFileResource($file);

        $package = $resource->getXML('META-INF/container.xml');

        if (!$opfFile = (string) $package->rootfiles->rootfile['full-path']) {
            $ns = $package->getNamespaces();
            foreach ($ns as $key => $value) {
                $package->registerXPathNamespace($key, $value);
                $items = $package->xpath('//'. $key .':rootfile/@full-path');
                $opfFile = (string) $items[0]['full-path'];
            }
        }

        $data = $resource->get($opfFile);

        // all files referenced in the OPF are relative to it's directory
        if ('.' !== $dir = dirname($opfFile)) {
            $resource->setDirectory($dir);
        }

        $opfResource = new OpfResource($data, $resource);
        $package = $opfResource->bind();
        
        $package->opfDirectory = dirname($opfFile);
        
        if ($package->navigation->src->href) {
            $ncx = $resource->get($package->navigation->src->href);
            $ncxResource = new NcxResource($ncx);
            $package = $ncxResource->bind($package);
        }
        
        return $package;
    }
842693
static function find_file($file, $base = '/')
	{
		if(file_exists($file) && is_readable($file))
			return $file;

		foreach(bors_dirs() as $dir)
			if(file_exists($fn = $dir.$base.'/'.$file) && is_readable($fn))
				return $fn;

		return NULL;
	}
570876
public static function file( $file )
	{
		$params = array_merge( static::$params, array(
			'time' => time(),
			'fingerprint' => \CCSession::fingerprint(),
			'random' => CCStr::random(),
		));
		
		foreach( $params as $param => $value )
		{
			$file = str_replace( ':'.$param, $value, $file );
		}
		
		return $file;
	}
743453
public function hash(string $data, $file = false) {
    if ($file === false) {
      return $this->hashContent($data);
    }
    
    return $this->hashFile($file);
  }
249409
protected static function load($file)
    {
        if (null !== static::DIRECTORY) {
            return file_get_contents(__DIR__.'/../data/'.static::DIRECTORY.'/'.$file.'.json');
        }

        return file_get_contents(__DIR__.'/../data/'.$file.'.json');
    }
1339614
static public function
	FromFile($file) {
	/*//
	return Nether\OneScript\Project
	read a project file from disk.
	//*/

		if(!file_exists($file) && is_readable($file))
		throw new Exception(
			'file not found or unreadable',
			static::ErrorFileUnreadable
		);

		$input = json_decode(file_get_contents($file));

		if(!$input || !is_object($input))
		throw new Exception(
			'file appears to be invalid',
			static::ErrorFileInvalid
		);

		$project = (new static($input))
		->SetProjectFile($file);

		return $project;
	}
18086
public static @NonNull ClickEvent openFile(final @NonNull String file) {
    return new ClickEvent(Action.OPEN_FILE, file);
  }
800296
public static function get($file = false) {

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

            return file_get_contents($file);
        }

        return false;
    }
939299
protected function read($file)
    {
        $data = null;
        $key  = $file;
        $file = $this->getFileName($file);

        if ( file_exists($file))
        {
            // if cache file not expire
            if (filemtime($file) >= time())
            {
                echo "read cache<br/>";
                $data = file_get_contents($file);
                $data = ($this->base64Encode) ? base64_decode($data) : $data;
                $data = unserialize($data);
                static::$keys[$key] = true;
            }
            else
            {
                unset(static::$keys[$key]);
                unlink($file);
            }
        }

        return $data;
    }
1350530
function load_file($file)
    {
        if (!file_exists($file) || !is_readable($file)) return false;
        $data = file($file);
        foreach ($data as $line) {
            $line = trim($line);
            if (($line == '') || ($line == '#')) continue;
            $line = preg_split('/\s+/', $line, 2);
            if (count($line) < 2) continue;
            $exts = $line[1];
            // if there's a comment on this line, remove it
            $hash_pos = strpos($exts, '#');
            if ($hash_pos !== false) $exts = substr($exts, 0, $hash_pos);
            $this->set($line[0], $exts);
        }
        return true;
    }
512212
public function file($hash) {
		$path = $this->decode($hash);
		
		return ($file = $this->stat($path)) ? $file : $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		
		if (($file = $this->stat($path)) != false) {
			if ($realpath) {
				$file['realpath'] = $path;
			}
			return $file;
		}
		return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
	}