| Next revision | Previous revision |
| scriptlog:lib:service:downloadservice [2026/09/26 09:09] – admin admin | scriptlog:lib:service:downloadservice [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Service Class | | | ''@category'' | Service Class | |
| | ''@author'' | M.Noermoehammad | | | ''@author'' | M.Noermoehammad | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (3) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''private'' | ''(untyped)'' | ''$downloadModel'' | | 26 | |
| | | ''private'' | ''(untyped)'' | ''$mediaDao'' | | 27 | |
| | | ''private'' | ''(untyped)'' | ''$sanitizer'' | | 28 | |
| |
| ======= Methods (24) ======= | ======= Methods (24) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | (undocumented) | 30 | | | public | ''__construct()'' | (undocumented) | 30 | |
| | public | ''validateDownloadRequest()'' | Validate download request | 43 | | | public | ''validateDownloadRequest()'' | Validate download request | 43 | |
| | public | ''getDownloadInfo()'' | Get download info by identifier | 58 | | | public | ''getDownloadInfo()'' | Get download info by identifier | 58 | |
| | public | ''getMediaByIdentifier()'' | Get media by identifier | 69 | | | public | ''getMediaByIdentifier()'' | Get media by identifier | 69 | |
| | public | ''isDownloadExpired()'' | Check if download is expired | 86 | | | public | ''isDownloadExpired()'' | Check if download is expired | 86 | |
| | public | ''isMimeTypeAllowed()'' | Check if MIME type is allowed | 103 | | | public | ''isMimeTypeAllowed()'' | Check if MIME type is allowed | 103 | |
| | public | ''createDownloadRecord()'' | Create download record | 115 | | | public | ''createDownloadRecord()'' | Create download record | 115 | |
| | public | ''deleteDownloadRecord()'' | Delete download record | 137 | | | public | ''deleteDownloadRecord()'' | Delete download record | 137 | |
| | public | ''deleteDownloadRecords()'' | Delete multiple download records | 148 | | | public | ''deleteDownloadRecords()'' | Delete multiple download records | 148 | |
| | public | ''expireDownloadRecord()'' | Expire a download record | 165 | | | public | ''expireDownloadRecord()'' | Expire a download record | 165 | |
| | public | ''expireDownloadRecords()'' | Expire multiple download records | 182 | | | public | ''expireDownloadRecords()'' | Expire multiple download records | 182 | |
| | public | ''regenerateDownloadRecord()'' | Regenerate download identifier | 199 | | | public | ''regenerateDownloadRecord()'' | Regenerate download identifier | 199 | |
| | public | ''regenerateDownloadRecords()'' | Regenerate multiple download records | 220 | | | public | ''regenerateDownloadRecords()'' | Regenerate multiple download records | 220 | |
| | public | ''generateDownloadIdentifier()'' | Generate download identifier | 236 | | | public | ''generateDownloadIdentifier()'' | Generate download identifier | 236 | |
| | public | ''refreshDownloadExpiry()'' | Refresh download expiry | 259 | | | public | ''refreshDownloadExpiry()'' | Refresh download expiry | 259 | |
| | public | ''getDownloadUrl()'' | Get download URL | 278 | | | public | ''getDownloadUrl()'' | Get download URL | 278 | |
| | public | ''recordDownloadAttempt()'' | Record download attempt | 299 | | | public | ''recordDownloadAttempt()'' | Record download attempt | 299 | |
| | public | ''getDownloadStatistics()'' | Get download statistics | 317 | | | public | ''getDownloadStatistics()'' | Get download statistics | 317 | |
| | public | ''getDownloadCountByMedia()'' | Get download count by media | 348 | | | public | ''getDownloadCountByMedia()'' | Get download count by media | 348 | |
| | public | ''getDownloadsByMedia()'' | Get downloads by media | 359 | | | public | ''getDownloadsByMedia()'' | Get downloads by media | 359 | |
| | public | ''getDownloadHistory()'' | Get download history | 370 | | | public | ''getDownloadHistory()'' | Get download history | 370 | |
| | public | ''getFileTypeDistribution()'' | Get file type distribution | 380 | | | public | ''getFileTypeDistribution()'' | Get file type distribution | 380 | |
| | public | ''getRecentDownloads()'' | Get recent downloads | 391 | | | public | ''getRecentDownloads()'' | Get recent downloads | 391 | |
| | public | ''getAllDownloads()'' | Get all downloads with media info | 401 | | | public | ''getAllDownloads()'' | Get all downloads with media info | 401 | |
| |
| |
| //lines 30–35 (6)// | //lines 30–35 (6)// |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$downloadModel'' | [[scriptlog:lib:model:downloadmodel|''DownloadModel'']] | //required// | //none// | | | ''$downloadModel'' | [[scriptlog:lib:model:downloadmodel|''DownloadModel'']] | //required// | //none// | |
| | ''$mediaDao'' | [[scriptlog:lib:dao:mediadao|''MediaDao'']] | //required// | //none// | | | ''$mediaDao'' | [[scriptlog:lib:dao:mediadao|''MediaDao'']] | //required// | //none// | |
| |
| |
| Validate download request | Validate download request |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|null | **Returns:** ''(none declared)'' — array|null |
| Get download info by identifier | Get download info by identifier |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|null | **Returns:** ''(none declared)'' — array|null |
| Get media by identifier | Get media by identifier |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|null | **Returns:** ''(none declared)'' — array|null |
| Check if download is expired | Check if download is expired |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Check if MIME type is allowed | Check if MIME type is allowed |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mimeType'' | ''(untyped)'' | //required// | //none// | | | ''$mimeType'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Create download record | Create download record |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$mediaId'' | ''(untyped)'' | //required// | //none// | |
| | ''$ipAddress'' | ''(untyped)'' | //required// | //none// | | | ''$ipAddress'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Delete download record | Delete download record |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Delete multiple download records | Delete multiple download records |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifiers'' | ''(untyped)'' | //required// | //none// | | | ''$identifiers'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Expire a download record | Expire a download record |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Expire multiple download records | Expire multiple download records |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifiers'' | ''(untyped)'' | //required// | //none// | | | ''$identifiers'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Regenerate download identifier | Regenerate download identifier |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string|false | **Returns:** ''(none declared)'' — string|false |
| Regenerate multiple download records | Regenerate multiple download records |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifiers'' | ''(untyped)'' | //required// | //none// | | | ''$identifiers'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Refresh download expiry | Refresh download expiry |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Get download URL | Get download URL |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$_mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$_mediaId'' | ''(untyped)'' | //required// | //none// | |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Record download attempt | Record download attempt |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$mediaId'' | ''(untyped)'' | //required// | //none// | |
| | ''$identifier'' | ''(untyped)'' | //required// | //none// | | | ''$identifier'' | ''(untyped)'' | //required// | //none// | |
| | ''$ipAddress'' | ''(untyped)'' | //required// | //none// | | | ''$ipAddress'' | ''(untyped)'' | //required// | //none// | |
| | ''$userAgent'' | ''(untyped)'' | //required// | //none// | | | ''$userAgent'' | ''(untyped)'' | //required// | //none// | |
| | ''$status'' | ''(untyped)'' | '''success''' | //none// | | | ''$status'' | ''(untyped)'' | '''success''' | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Get download count by media | Get download count by media |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$mediaId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Get downloads by media | Get downloads by media |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$mediaId'' | ''(untyped)'' | //required// | //none// | | | ''$mediaId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Get download history | Get download history |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$limit'' | ''(untyped)'' | ''50'' | //none// | | | ''$limit'' | ''(untyped)'' | ''50'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Get recent downloads | Get recent downloads |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$limit'' | ''(untyped)'' | ''10'' | //none// | | | ''$limit'' | ''(untyped)'' | ''10'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| ======= Imports ======= | ======= Imports ======= |
| |
| ^ Alias ^ Fully-qualified name ^ | ^ Alias ^ Fully-qualified name ^ |
| | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | |
| | ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | | | ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | |
| | ''DownloadModel'' | [[scriptlog:lib:model:downloadmodel|''Scriptlog\Model\DownloadModel'']] | | | ''DownloadModel'' | [[scriptlog:lib:model:downloadmodel|''Scriptlog\Model\DownloadModel'']] | |
| |
| |