FileSystemSymlinkTarget
class FileSystemSymlinkTarget extends FileSystemTarget (View source)
A target which publishes resources by creating symlinks.
Properties
protected array | $options | from FileSystemTarget | |
protected string | $name | Name which identifies this publishing target |
from FileSystemTarget |
protected string | $path | The path (in a filesystem) where resources are published to |
from FileSystemTarget |
protected string | $baseUri | The configured publicly accessible web URI which points to the root path of this target. |
from FileSystemTarget |
protected string | $absoluteBaseUri | The resolved absolute web URI for this target. If $baseUri was absolute this will be the same, otherwise the request base uri will be prepended. |
from FileSystemTarget |
protected bool | $subdivideHashPathSegment | If the generated URI path segment containing the sha1 should be divided into multiple segments |
from FileSystemTarget |
protected array | $excludedExtensions | A list of extensions that are excluded and must not be published by this target. |
from FileSystemTarget |
protected ResourceRepository | $resourceRepository | from FileSystemTarget | |
protected LoggerInterface | $logger | from FileSystemTarget | |
protected MessageCollector | $messageCollector | from FileSystemTarget | |
protected BaseUriProvider | $baseUriProvider | from FileSystemTarget | |
protected bool | $relativeSymlinks |
Methods
Injects the (system) logger based on PSR-3.
Checks if the PackageStorage has been previously initialized with symlinks and clears them. Otherwise the original sources would be overwritten.
Publishes the whole collection to this target
Publishes the given persistent resource from the given storage
Handle missing data notification
Returns the web accessible URI pointing to the given static resource
Returns the web accessible URI pointing to the specified persistent resource
Applies rawurlencode() to all path segments of the given $relativePathAndFilename
Publishes the given source stream to this target, with the given relative path.
Removes the specified target file from the public directory
Returns the resolved absolute base URI for resources of this target.
Detects and returns the website's absolute base URI
Determines and returns the relative path and filename for the given Storage Object or PersistentResource. If the given object represents a persistent resource, its own relative publication path will be empty. If the given object represents a static resources, it will contain a relative path.
Set an option value and return if it was set.
Publishes the specified directory to this target, with the given relative path.
Details
__construct(string $name, array $options = [])
Constructor
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
void
initializeObject()
Initializes this resource publishing target
string
getName()
Returns the name of this target instance
protected void
checkAndRemovePackageSymlinks(StorageInterface $storage)
Checks if the PackageStorage has been previously initialized with symlinks and clears them. Otherwise the original sources would be overwritten.
void
publishCollection(CollectionInterface $collection, callable $callback = null)
Publishes the whole collection to this target
void
publishResource(PersistentResource $resource, CollectionInterface $collection)
Publishes the given persistent resource from the given storage
protected
handleMissingData(ResourceMetaDataInterface $resource, CollectionInterface $collection)
Handle missing data notification
void
unpublishResource(PersistentResource $resource)
Unpublishes the given persistent resource
string
getPublicStaticResourceUri(string $relativePathAndFilename)
Returns the web accessible URI pointing to the given static resource
string
getPublicPersistentResourceUri(PersistentResource $resource)
Returns the web accessible URI pointing to the specified persistent resource
protected string
encodeRelativePathAndFilenameForUri(string $relativePathAndFilename)
Applies rawurlencode() to all path segments of the given $relativePathAndFilename
protected void
publishFile(resource $sourceStream, string $relativeTargetPathAndFilename)
Publishes the given source stream to this target, with the given relative path.
protected void
unpublishFile(string $relativeTargetPathAndFilename)
Removes the specified target file from the public directory
This method fails silently if the given file could not be unpublished or already didn't exist anymore.
protected string
getResourcesBaseUri()
Returns the resolved absolute base URI for resources of this target.
protected string
detectResourcesBaseUri()
Detects and returns the website's absolute base URI
protected string
getRelativePublicationPathAndFilename(ResourceMetaDataInterface $object)
Determines and returns the relative path and filename for the given Storage Object or PersistentResource. If the given object represents a persistent resource, its own relative publication path will be empty. If the given object represents a static resources, it will contain a relative path.
No matter which kind of resource, persistent or static, this function will return a sub directory structure if no relative publication path was defined in the given object.
protected bool
setOption(string $key, mixed $value)
Set an option value and return if it was set.
protected void
publishDirectory(string $sourcePath, string $relativeTargetPathAndFilename)
Publishes the specified directory to this target, with the given relative path.