Exports products as ZIP archives and offers them for downloading.
This \FeaturePhp\Exporter\ZipExporter exports the product to a temporary ZIP archive, offers it for downloading and finally removes the archive. It is suited to implement a "self-service" product generation service for the end user.
package | Default |
---|---|
inherited_from | \FeaturePhp\Exporter\ZipExporter |
__construct(string|null $directory= null
, string $prefix= "feature-php-"
)
inherited_from | \FeaturePhp\Exporter\ZipExporter::__construct() |
---|
string
null
A directory suited for storing temporary files, if NULL, the global temporary directory is used. Writing permissions are required.
string
A prefix to assign to temporary files. Omitted in usual cases.
__construct(string $target)
string
export(\FeaturePhp\ProductLine\Product $product)
This only works when no headers and no output have been sent yet. Note that any occurring errors are ignored so that the downloaded archive will not be corrupted. There is currently no way to obtain error information in this case because feature-php does not have an external log file.
inherited_from | \FeaturePhp\Exporter\ZipExporter::export() |
---|
\FeaturePhp\ProductLine\Product
export(\FeaturePhp\ProductLine\Product $product)
The implementation is expected to have some side effect, e.g. downloading a file.
\FeaturePhp\ProductLine\Product
close(\ZipArchive $zip)
\ZipArchive
download(string $productLineName)
This only works when no headers and no output have been sent yet, otherwise users receive corrupted ZIP files.
string
the name of the product line, used as the ZIP archive file name
open() : \ZipArchive
\ZipArchive
remove()
$target : string