Class PackedDownloadController

Class PackedDownloadController

This class implements a mass downloader. It can be used to have the shop retrieve a list of resources (denoted by their URLs) and pack them in a ZIP file. The ZIP file is stored in the cache folder and can then be downloaded.

HttpViewController implements HttpViewControllerInterface
AdminHttpViewController implements AdminStatusOnlyInterface
PackedDownloadController
Package: AdminHttpViewControllers
Category: System
Extends: AdminHttpViewController
Located at Controllers/HttpView/Admin/PackedDownloadController.inc.php

Methods summary

public __construct( HttpContextReaderInterface $httpContextReader, HttpResponseProcessorInterface $httpResponseProcessor, ContentViewInterface $contentView )

initializes the controller

public defaultAction( void ) : JsonHttpControllerResponse

Returns an error (JSON-encoded) as this controller does not have a default action

public actionDownloadByJson( void ) : JsonHttpControllerResponse

Retrieves a number of resources and puts them in a ZIP for later retrieval by the user.

public actionDownloadPackage( void ) : HttpControllerResponse

Download a pack of resources retrieved with actionDownloadByJson() identified by a downloadKey

protected downloadFile( string $url, string $tmpDir ) : string

Retrieve a file/resource and store in $tmpDir File name is determined from URL.

protected packForDownload( string $tmpDir, array $files ) : downloadKey

Packs up files in $tmpDir into a ZIP file

protected cleanUp( $tmpDir ) : boolean

Clean up $tmpDir

protected makeTmpDir( void ) : string

Makes a new tmpDir location

Methods inherited from AdminHttpViewController

validateCurrentAdminStatus()

Methods inherited from HttpViewController

_callActionMethod(), _getPostData(), _getPostDataCollection(), _getQueryParameter(), _getQueryParametersCollection(), _getServerData(), _render(), _validatePageToken(), actionDefault(), getTemplateFile(), proceed()

Properties summary

Properties inherited from HttpViewController

$assets, $contentView, $httpContextReader, $httpResponseProcessor, $postDataArray, $queryParametersArray, $serverDataArray