return file content
@param        $file
@param null   $rev
@param string $type
@return mixed
979585
public function read($file, $rev=NUll, $type='sandbox')
	{
		$url = 'https://api-content.dropbox.com/1/files/';
		$params = array();
		if ($rev) $params['rev'] = $rev;
		$result = $this->doOAuthCall($url,'GET',$params, $type, $file);
		// if file not found, response is json, otherwise just file contents
		if(!in_array('HTTP/1.1 404 Not Found', $result['headers']))
			return $result['body'];
		else {
			$result_body = json_decode($result['body'], true);
			trigger_error(sprintf(self::E_APIERROR, $result_body['error']));
			return false;
		}
	}
1352770
public function exists($file, $hidden=false, $rev=NULL, $type='sandbox')
	{
		return $this->metadata($file, false, true, $hidden, $rev, $type);
	}
1329562
public function read($file)
    {
        $fp = fopen($file, 'r+');

        $contents = '';

        while ($part = fread($fp, 1024)) {
            $contents .= $part;
        }

        if (null !== $fp) {
            fclose($fp);
        }

        return $contents;
    }
889078
public function htmlMinify($file, $type = 'file')
    {
        $file = $this->getFile($file, $type);
        $file = $this->cleanSpaces($file);
        $file = $this->fixMaster($file);
        $file = $this->removeComments($file);

        return $file;
    }
1252461
protected function getDataFromFile($file, $type = 'application/json')
    {
        if (file_exists($file)) {
            $opts = [
                'http' => [
                    'header' => 'Content-Type: '.$type.'; charset=utf-8',
                ],
            ];

            $context = stream_context_create($opts);
            $data = file_get_contents($file, 0, $context);
            $json = $this->isJson($data, true);
            
            if (!$json) {
                throw new InvalidJsonException();
            }
            
            return $json;
        }

        throw new FileNotFoundException();
    }
41740
public function loadFile($file)
    {
        $openfile = @fopen($file, "rb") or die("loadFile: Error opening file '{$file}'.");
        $contents = @fread($openfile, filesize($file)) or die("loadFile: Error reading data from file '{$file}'.");
        @fclose($openfile);
        return $contents;
    }
922799
public static function getFile($file) {
		if(is_file($file)) {
			return $file;
		}
		$vendor = dirname(dirname(dirname(__FILE__)));
		$file   = '/'. ltrim($file, '/');
		if (is_file($vendor.$file)) {
			return $vendor.$file;
		}
		$app = dirname(APP_DIR);
		if (is_file($app.$file)) {
			return $app.$file;
		}
		return null;
	}
972050
protected function getFileContents($file, $line){
        if(!is_string($file) || !is_int($line)
            || !is_file($file) || !is_readable($file)
        ){
            return null;
        }

        $file       = new \SplFileObject($file, "r");
        $current    = 1;
        $contents   = [];
        $min        = $line - 3;
        $max        = $line + 3;

        foreach($file as $row){
            if($min <= $current && $current <= $max){
                $contents[$current] = $row;
            }

            $current++;
        }

        if(empty($contents)){
            return null;
        }

        return $contents;
    }
1235695
public function request($type, $file = null)
    {
        static $retries = [];

        // check if not checked
        $this->check();

        // check if is cached
        if(isset($this->cache[sha1($file)][$type]))
        {
            return $this->cache[sha1($file)][$type];
        }
        elseif(!isset($retries[sha1($file)]))
        {
            $retries[sha1($file)] = $this->retries;
        }

        // parameters for cURL request
        list($resource, $headers) = $this->getParameters($type, $file);

        // check the request
        $file = parent::checkRequest($type, $file);

        // cURL options
        $options = $this->getCurlOptions($type, $file);

        // sets headers
        foreach($headers as $header)
        {
            $options[CURLOPT_HTTPHEADER][] = $header;
        }

        // cURL init and options
        $options[CURLOPT_URL] = $this->getUrl() . "/$resource";

        // get the response and the HTTP status code
        list($response, $status) = $this->exec($options);

        // reduce memory usage closing cURL resource
        if(isset($options[CURLOPT_INFILE]) && is_resource($options[CURLOPT_INFILE]))
        {
            fclose($options[CURLOPT_INFILE]);
        }

        // request completed successfully
        if($status == 200)
        {
            if($type == 'meta')
            {
                $response = Metadata::make($response, $file);
            }

            // cache certain responses
            if(in_array($type, ['lang', 'meta']))
            {
                $this->cache[sha1($file)][$type] = $response;
            }
        }
        // request completed successfully but result is empty
        elseif($status == 204)
        {
            $response = null;
        }
        // retry on request failed with error 500
        elseif($status == 500 && $retries[sha1($file)]--)
        {
            $response = $this->request($type, $file);
        }
        // other status code is an error
        else
        {
            $this->error($status, $resource);
        }

        return $response;
    }
967285
public function get($fileId, $revisionId, $optParams = array()) {
      $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Revision($data);
      } else {
        return $data;
      }
    }
368753
static function read($file)
	{
		if(file_exists($file) && is_readable($file))
			return file_get_contents($file);

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

		return NULL;
	}
1241336
public function getUrl($file, $type): string
    {
        if (!$this->checkPermission($type)) {
            $file = $this->noImage;
        }

        $filePath = $this->getCachePath($file, $type);

        if (file_exists($filePath['system']) && (time() - filemtime($filePath['system']) < $this->cacheTime)) {
            return $filePath['public'];
        }

        return Url::toRoute([$this->imageAction, 'path' => urlencode($file), 'type' => $type]);
    }
212748
public function get($type, $file = null)
    {
        if (!isset($this->paths[$type])) {
            $method = 'get'.Utils::camelize($type).'Dir';

            if (!method_exists($this, $method)) {
                return null;
            }

            $this->set($type, $this->$method());
        }

        $path = $this->paths[$type];
        if ($file) {
            if ($path instanceof pathmanager\FallbackInterface) {
                $path = $path->resolve($file);
            } else {
                $path .= '/' . ltrim($file, '/');
            }
        }

        return $path;
    }
644719
public function file( $file = null )
	{
		if ( !is_null( $file ) )
		{
			return $this->_file = $file;
		}
		
		return $this->_file;
	}
800296
public static function get($file = false) {

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

            return file_get_contents($file);
        }

        return false;
    }
1218566
public function readImage( $file, $type) {
		switch ($type) {
			case 2:	//JPEG
			return(ImageCreateFromJPEG($file));
			break;
			
			case 3:	//PNG
			return(ImageCreateFromPNG($file));
			break;
			
			default:
			$this->errorMsg="File format not supported.";
			return(false);
		}
	}
875648
public function getContent($type = 'default') {

		if(false === is_string($type)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
		}

		if(false === is_dir($this -> directory -> getPath())) {
			return trigger_error(sprintf('Directory "%s" does not exists', $this -> directory -> getPath()), E_USER_ERROR);	
		}

		$files = array_values(array_diff(scandir($this -> directory -> getPath()), ['.', '..']));

		switch($type) {

			case 'array' : 
				return $files;

			case 'object' :
				return (object) $files;

			case 'json' :
				return json_encode($files);

			default : 

				$content = [];

				foreach($files as $file) {

					if(is_dir($this -> directory -> getPath() . $file)) {
						
						$content[] = new Directory($file);
						continue;
					}

					$content[] = new File($file);
				}

				return $content;
		}
	}