Get contents of a file with shared access.

@param string $path

@return string
326287
public function sharedGet(string $path) : string
    {
        $contents = '';
        $handle   = @fopen($path, File::READ_BINARY);

        if (false === $handle) {
            return $contents;
        }

        try {
            if (flock($handle, LOCK_SH)) {
                clearstatcache(true, $path);

                $contents = fread($handle, filesize($path) ?: 1);

                flock($handle, LOCK_UN);
            }
        } finally {
            fclose($handle);
        }

        return $contents;
    }
266134
public function read($path)
    {
        $contents = file_get_contents($this->applyPathPrefix($path));

        return $contents !== false ? compact('contents') : false;
    }
851009
public function directoryFiles($path)
  {
    $contents = [];

    // Scan directory
    $directoryFiles = scandir($path);

    foreach ($directoryFiles as $index => $filePath)  {

      // Ommit . and ..
      if ( ! in_array($filePath, ['.', '..']))  {

        // Check if this is a directory
        if (is_dir($path . DIRECTORY_SEPARATOR . $filePath)) {

          // Rescan and get files in this directory
          $contents = array_merge($contents, self::directoryFiles($path . DIRECTORY_SEPARATOR . $filePath));

        } else  {

          // Add file to contens array
          $contents[] = $path . DIRECTORY_SEPARATOR . $filePath;
        }
      }
    }

    return $contents;
  }
753096
public function read($path)
    {
        $object = $this->applyPathPrefix($path);

        try {
            $contents = $this->client->getObject($this->bucket, $object);
        } catch (OssException $e) {
            return false;
        }

        return compact('contents', 'path');
    }
819071
protected function getFilePath(string $path): string
    {
        if (empty($path)) {
            $path = $this->fileName;
        }

        return $path;
    }
1118513
public function getContents($path)
    {
        $fullPath = $this->concatPaths($path);

        if (file_exists($fullPath)) {
            return file_get_contents($fullPath);
        }

        return false;
    }
1226936
public function getMetadata($path)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        return $this->getResponse('GET', $url);
    }
1044459
protected function loadFile($path)
    {
        if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
            throw new \InvalidArgumentException('Can only parse files with ".php" extensions');
        }
        if (!file_exists($path)) {
            throw new \InvalidArgumentException(sprintf('Failed to find \'%s\' file.', $path));
        }

        return file_get_contents($path);
    }
1187323
protected function _getContents($path) {
		$contents = '';
		try {
			$contents = $this->dropbox->getFile($path);
		} catch (Dropbox_Exception $e) {
			return $this->setError('Dropbox error: '.$e->getMessage());
		}
		return $contents;
	}
507601
public static function getFolder($path)
    {
        if (!is_dir($path)) return null;

        $path = rtrim($path, '/') . '/';

        $array = array('file' => array(), 'folder' => array());
        $dir_obj = opendir($path);

        while ($dir = readdir($dir_obj)) {
            if ($dir != '.' && $dir != '..') {
                $file = $path . $dir;
                if (is_dir($file)) {
                    $array['folder'][] = $dir;
                } elseif (is_file($file)) {
                    $array['file'][] = $dir;
                }

            }
        }
        closedir($dir_obj);
        return $array;

    }
1313327
public function read($path)
    {
        list (, $fileId) = $this->splitPath($path);
        if ($response = $this->service->files->get($fileId, $this->applyDefaultParams([
            'alt' => 'media'
        ], 'files.get'))) {
            return [
                'contents' => (string) $response->getBody()
            ];
        }

        return false;
    }
700068
public static function read($path)
    {
        $path = Normalize::diskFullPath($path);

        if (!self::exist($path)) {
            return false;
        }

        return @file_get_contents($path);
    }
210893
final public function getFileContents($path)
    {
        return $this->getRepositoryContent()->download(
            $this->settings->getVendor(),
            $this->settings->getPackage(),
            $path,
            $this->settings->getReference()
        );
    }
412462
public function read($path)
    {
        $url = self::BASE_URL.$path;
        return file_get_contents($url, false, $this->context);
    }
1021059
protected function getObjectACL($path)
    {
        $metadata = $this->getVisibility($path);

        return $metadata['visibility'] === AdapterInterface::VISIBILITY_PUBLIC ? OssClient::OSS_ACL_TYPE_PUBLIC_READ : OssClient::OSS_ACL_TYPE_PRIVATE;
    }
211312
public function getContent($path)
    {
        // only a page index was given ?
        if (('0' == $path) || (int) ($path) > 0) {
            $path = $this->findByIndex($path);
        } else {
            $path = $this->basePath . '/' . $path;
            $infos = pathinfo($path);
            // was the extension given ?
            if (empty($infos['extension'])) {
                $path .= '.md';
            }
        }
        if (file_exists($path)) {
            return file_get_contents($path);
        }

        return false;
    }
659047
protected function getScandir($path) {
		$files = array();
		
		!isset($this->dirsCache[$path]) && $this->cacheDir($path);

		foreach ($this->dirsCache[$path] as $p) {
			if (($stat = $this->stat($p)) && empty($stat['hidden'])) {
				$files[] = $stat;
			}
		}

		return $files;
	}