Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:service:downloadservice

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:service:downloadservice [2026/09/26 09:09] – admin adminscriptlog:lib:service:downloadservice [2026/09/26 09:34] (current) – admin admin
Line 12: Line 12:
 ======= 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 =======
Line 27: Line 27:
 //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 |
  
  
Line 68: Line 71:
 //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// |
  
  
Line 83: Line 86:
 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
Line 99: Line 102:
 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
Line 115: Line 118:
 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
Line 131: Line 134:
 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
Line 147: Line 150:
 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
Line 163: Line 166:
 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
Line 180: Line 183:
 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
Line 196: Line 199:
 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
Line 212: Line 215:
 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
Line 228: Line 231:
 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
Line 244: Line 247:
 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
Line 260: Line 263:
 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
Line 291: Line 294:
 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
Line 307: Line 310:
 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
Line 324: Line 327:
 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
Line 359: Line 362:
 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
Line 375: Line 378:
 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
Line 391: Line 394:
 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
Line 422: Line 425:
 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
Line 444: Line 447:
 ======= 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'']] |
  
  
scriptlog/lib/service/downloadservice.1790413760.txt.gz · Last modified: by admin