PHP Class Neos\Flow\ResourceManagement\Target\FileSystemTarget

Inheritance: implements Neos\Flow\ResourceManagement\Target\TargetInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$absoluteBaseUri string 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.
$baseUri string Can be relative to website's base Uri, for example "_Resources/MySpecialTarget/". If resources should be served from a different domain, make sure to specify an absolute URI though
$bootstrap Neos\Flow\Core\Bootstrap
$extensionBlacklist array A list of extensions that are blacklisted and must not be published by this target.
$httpBaseUri string The configured Neos.Flow.http.baseUri to use as fallback if no absolute baseUri is configured and if it can't be determined from the current request (e.g. in CLI mode)
$messageCollector Neos\Flow\ResourceManagement\Publishing\MessageCollector
$name string Name which identifies this publishing target
$options array
$path string The path (in a filesystem) where resources are published to
$resourceRepository Neos\Flow\ResourceManagement\ResourceRepository
$subdivideHashPathSegment boolean If the generated URI path segment containing the sha1 should be divided into multiple segments
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Méthodes publiques

Méthode Description
__construct ( string $name, array $options = [] ) Constructor
getName ( ) : string Returns the name of this target instance
getPublicPersistentResourceUri ( PersistentResource $resource ) : string Returns the web accessible URI pointing to the specified persistent resource
getPublicStaticResourceUri ( string $relativePathAndFilename ) : string Returns the web accessible URI pointing to the given static resource
initializeObject ( ) : void Initializes this resource publishing target
publishCollection ( Neos\Flow\ResourceManagement\CollectionInterface $collection, callable $callback = null ) : void Publishes the whole collection to this target
publishResource ( PersistentResource $resource, Neos\Flow\ResourceManagement\CollectionInterface $collection ) : void Publishes the given persistent resource from the given storage
unpublishResource ( PersistentResource $resource ) : void Unpublishes the given persistent resource

Méthodes protégées

Méthode Description
detectResourcesBaseUri ( ) : string Detects and returns the website's absolute base URI
encodeRelativePathAndFilenameForUri ( string $relativePathAndFilename ) : string Applies rawurlencode() to all path segments of the given $relativePathAndFilename
getRelativePublicationPathAndFilename ( Neos\Flow\ResourceManagement\ResourceMetaDataInterface $object ) : string 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.
getResourcesBaseUri ( ) : string Returns the resolved absolute base URI for resources of this target.
handleMissingData ( Neos\Flow\ResourceManagement\ResourceMetaDataInterface $resource, Neos\Flow\ResourceManagement\CollectionInterface $collection ) Handle missing data notification
publishFile ( resource $sourceStream, string $relativeTargetPathAndFilename ) : void Publishes the given source stream to this target, with the given relative path.
setOption ( string $key, mixed $value ) : boolean Set an option value and return if it was set.
unpublishFile ( string $relativeTargetPathAndFilename ) : void Removes the specified target file from the public directory

Method Details

__construct() public méthode

Constructor
public __construct ( string $name, array $options = [] )
$name string Name of this target instance, according to the resource settings
$options array Options for this target

detectResourcesBaseUri() protected méthode

Detects and returns the website's absolute base URI
protected detectResourcesBaseUri ( ) : string
Résultat string The resolved resource base URI, @see getResourcesBaseUri()

encodeRelativePathAndFilenameForUri() protected méthode

Applies rawurlencode() to all path segments of the given $relativePathAndFilename
protected encodeRelativePathAndFilenameForUri ( string $relativePathAndFilename ) : string
$relativePathAndFilename string
Résultat string

getName() public méthode

Returns the name of this target instance
public getName ( ) : string
Résultat string

getPublicPersistentResourceUri() public méthode

Returns the web accessible URI pointing to the specified persistent resource
public getPublicPersistentResourceUri ( PersistentResource $resource ) : string
$resource Neos\Flow\ResourceManagement\PersistentResource PersistentResource object
Résultat string The URI

getPublicStaticResourceUri() public méthode

Returns the web accessible URI pointing to the given static resource
public getPublicStaticResourceUri ( string $relativePathAndFilename ) : string
$relativePathAndFilename string Relative path and filename of the static resource
Résultat string The URI

getRelativePublicationPathAndFilename() protected méthode

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 getRelativePublicationPathAndFilename ( Neos\Flow\ResourceManagement\ResourceMetaDataInterface $object ) : string
$object Neos\Flow\ResourceManagement\ResourceMetaDataInterface PersistentResource or Storage Object
Résultat string The relative path and filename, for example "c/8/2/8/c828d0f88ce197be1aff7cc2e5e86b1244241ac6/MyPicture.jpg" (if subdivideHashPathSegment is on) or "c828d0f88ce197be1aff7cc2e5e86b1244241ac6/MyPicture.jpg" (if it's off)

getResourcesBaseUri() protected méthode

Returns the resolved absolute base URI for resources of this target.
protected getResourcesBaseUri ( ) : string
Résultat string The absolute base URI for resources in this target

handleMissingData() protected méthode

Handle missing data notification
protected handleMissingData ( Neos\Flow\ResourceManagement\ResourceMetaDataInterface $resource, Neos\Flow\ResourceManagement\CollectionInterface $collection )
$resource Neos\Flow\ResourceManagement\ResourceMetaDataInterface
$collection Neos\Flow\ResourceManagement\CollectionInterface

initializeObject() public méthode

Initializes this resource publishing target
public initializeObject ( ) : void
Résultat void

publishCollection() public méthode

Publishes the whole collection to this target
public publishCollection ( Neos\Flow\ResourceManagement\CollectionInterface $collection, callable $callback = null ) : void
$collection Neos\Flow\ResourceManagement\CollectionInterface The collection to publish
$callback callable Function called after each resource publishing
Résultat void

publishFile() protected méthode

Publishes the given source stream to this target, with the given relative path.
protected publishFile ( resource $sourceStream, string $relativeTargetPathAndFilename ) : void
$sourceStream resource Stream of the source to publish
$relativeTargetPathAndFilename string relative path and filename in the target directory
Résultat void

publishResource() public méthode

Publishes the given persistent resource from the given storage
public publishResource ( PersistentResource $resource, Neos\Flow\ResourceManagement\CollectionInterface $collection ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource The resource to publish
$collection Neos\Flow\ResourceManagement\CollectionInterface The collection the given resource belongs to
Résultat void

setOption() protected méthode

Set an option value and return if it was set.
protected setOption ( string $key, mixed $value ) : boolean
$key string
$value mixed
Résultat boolean

unpublishFile() protected méthode

This method fails silently if the given file could not be unpublished or already didn't exist anymore.
protected unpublishFile ( string $relativeTargetPathAndFilename ) : void
$relativeTargetPathAndFilename string relative path and filename in the target directory
Résultat void

unpublishResource() public méthode

Unpublishes the given persistent resource
public unpublishResource ( PersistentResource $resource ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource The resource to unpublish
Résultat void

Property Details

$absoluteBaseUri protected_oe property

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.
protected string $absoluteBaseUri
Résultat string

$baseUri protected_oe property

Can be relative to website's base Uri, for example "_Resources/MySpecialTarget/". If resources should be served from a different domain, make sure to specify an absolute URI though
protected string $baseUri
Résultat string

$bootstrap protected_oe property

protected Bootstrap,Neos\Flow\Core $bootstrap
Résultat Neos\Flow\Core\Bootstrap

$extensionBlacklist protected_oe property

A list of extensions that are blacklisted and must not be published by this target.
protected array $extensionBlacklist
Résultat array

$httpBaseUri protected_oe property

The configured Neos.Flow.http.baseUri to use as fallback if no absolute baseUri is configured and if it can't be determined from the current request (e.g. in CLI mode)
protected string $httpBaseUri
Résultat string

$messageCollector protected_oe property

protected MessageCollector,Neos\Flow\ResourceManagement\Publishing $messageCollector
Résultat Neos\Flow\ResourceManagement\Publishing\MessageCollector

$name protected_oe property

Name which identifies this publishing target
protected string $name
Résultat string

$options protected_oe property

protected array $options
Résultat array

$path protected_oe property

The path (in a filesystem) where resources are published to
protected string $path
Résultat string

$resourceRepository protected_oe property

protected ResourceRepository,Neos\Flow\ResourceManagement $resourceRepository
Résultat Neos\Flow\ResourceManagement\ResourceRepository

$subdivideHashPathSegment protected_oe property

If the generated URI path segment containing the sha1 should be divided into multiple segments
protected bool $subdivideHashPathSegment
Résultat boolean

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface