fkooman\RemoteStorage\DocumentStorage::getDocumentPath PHP Méthode

getDocumentPath() public méthode

Get the full absolute location of the document on the filesystem.
public getDocumentPath ( Path $p )
$p Path
    public function getDocumentPath(Path $p)
    {
        $documentPath = $this->baseDir . $p->getPath();
        if (!is_readable($documentPath)) {
            throw new DocumentStorageException('unable to read document');
        }
        return $documentPath;
    }

Usage Example

 public function getDocument(Path $p, array $ifNoneMatch = null)
 {
     if (null !== $ifNoneMatch && in_array($this->md->getVersion($p), $ifNoneMatch)) {
         throw new RemoteStorageException('document not modified');
     }
     return $this->d->getDocumentPath($p);
 }