Message-ID: <629460864.2816.1485850889441.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2815_2037624049.1485850889441" ------=_Part_2815_2037624049.1485850889441 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Asset Management

Asset Management

=20
=20
=20
=20

eZ Platform supports multiple binary file handling mechanisms by means o= f an IOHandler interface. This feature is used by th= e BinaryFile , Media and Imag= e Field Types.

Native IO handler 

The IO API is organized around two types of handlers:

  • eZ\Publish\IO\IOMetadataHandler: Stores & reads metada= ta (validity, size, etc.)
  • eZ\Publish\IO\IOBinarydataHandler: Stores & reads bina= rydata (actual contents)

The IOService uses both.

Configuration

IO handling can now be configured using semantic configuration. Assignin= g the IO handlers to ezplatform itself is configurable per siteaccess.= This is the default configuration:

=20
ezpublish:
    system:
        default:
            io:
                metadata_handler: default
                binarydata_handler: default
=20

Metadata and binarydata handlers are configured in the ez_io extension. This is what the configuration looks like for the default hand= lers. It declares a metadata handler and a binarydata handler, both labelle= d 'default'. Both handlers are of type 'flysystem', and use the same flysys= tem adapter, labelled 'default' as well.

=20
ez_io:
    metadata_handlers:
        default:
            flysystem:
                adapter: default
    binarydata_handlers:
        default:
            flysystem:
                adapter: default
=20

The 'default' flysystem adapter's directory is based on your site settin= gs, and will automatically be set to %ezpublish_legacy.root_dir%/$var= _dir$/$storage_dir$ (example: /path/to/ezpublish_legacy/var/ez= demo_site/storage).

Configur= e the permissions of generated files

V1.5=

=20
ezpublish:
    system:
        default:
            io:
                permissions:=20
                    files: 0750 #default is 0644
                    directories: 0640 #default is 0755
=20

Both files and directories rules are optional.=

Default values are 0644 for files and 0755 for directories.

= The native Flysystem handler

league/flysystem (along with FlysystemBundle) is an abstract file handling library.

It is used as the default way to read & write content binary files i= n eZ Platform. It can use the local filesystem (our defaul= t configuration and the one we officially support), but is= also able to read/write to sftp, zip or cloud fi= lesystems (azure, rackspace, S3)= .

Handler options

Adapter

The adapter is the 'driver' used by flysystem to read/write files. Adapt= ers can be declared using oneup_flysystem as follows:

=20
oneup_flysystem:
    adapters:
        default:
            local:
                directory: "/path/to/directory"
=20

 

The way to configure other adapters can be found on the bundle's online documentation. Note that we do not use the Filesyste= m configuration described in this documentation, only the adapters.

The DFS Cluster handler

For clustering use we provide a custom metadata handler that stores meta= data about your assets in the database. This is done as it is faster then a= ccessing the remote NFS or S3 instance in order to read metadata. For furth= er reading on setting this up, see Clustering.

 

=20
=20
=20
=20

In this topic:

=20
=20
=20
------=_Part_2815_2037624049.1485850889441--