|
| __construct ($aObject, $oStorage) |
|
| storeTranscodedFileInQueueStorage ($mixedHandler, $sTmpFile, &$sFileUrlResult) |
|
| addToQueue ($mixedHandler, $iProfileId=0) |
|
| applyFilter_Resize ($sFile, $aParams) |
|
| isFileReady_Folder ($mixedHandlerOrig, $isCheckOutdated=true) |
|
| isFileReady_Storage ($mixedHandlerOrig, $isCheckOutdated=true) |
|
| isPrivate_Folder ($mixedHandler) |
|
| isPrivate_Storage ($mixedHandler) |
|
| getFilePath_Folder ($mixedHandler) |
|
| storeFileLocally_Folder ($mixedHandler) |
|
| storeFileLocally_Storage ($mixedHandler) |
|
| storeFileLocally_Queue ($mixedHandler) |
|
| getOrigFileUrl_Folder ($mixedHandler) |
|
| getOrigFileUrl_Storage ($mixedHandler) |
|
| initFilters () |
|
| clearCacheDB () |
|
| processHandlerForRetinaDevice ($mixedHandler) |
|
|
| $_sLog = '' |
|
| $_aObject |
|
| $_oStorage |
|
| $_oDb |
|
| $_sRetinaSuffix = '@2x' |
|
| $_sQueueTable = '' |
|
| $_sQueueStorage = '' |
|
| $_iDevicePixelRatio = false |
|
Base class for
- See also
- BxDolTranscoderImage and
-
BxDolTranscoderVideo transcoders
◆ __construct()
BxDolTranscoder::__construct |
( |
| $aObject, |
|
|
| $oStorage ) |
|
protected |
◆ cleanup()
BxDolTranscoder::cleanup |
( |
| ) |
|
Delete (queue for deletion) all resized files for the current object
◆ cleanupObjectsArray()
static BxDolTranscoder::cleanupObjectsArray |
( |
| $mixed | ) |
|
|
static |
Cleanup (queue for deletion all resized files) It can be called upon module disbale event.
- Parameters
-
$mixed | array of transcoders objects, or just one object |
◆ getDb()
BxDolTranscoder::getDb |
( |
| ) |
|
Get database object instance
◆ getFileUrl()
BxDolTranscoder::getFileUrl |
( |
| $mixedHandler | ) |
|
Get transcoded file url. If transcoded file is ready then direct url to the file is returned. If there is no transcoded data available, then special url is returned, upon opening this url image is transcoded automatically and redirects to the ready transcoed image.
- Parameters
-
$mixedHandler | - file handler |
- Returns
- file url, or false on error.
Reimplemented in BxDolTranscoderImage, and BxDolTranscoderProxy.
◆ getFileUrlById()
BxDolTranscoder::getFileUrlById |
( |
| $mixedHandler | ) |
|
◆ getFileUrlNotReady()
BxDolTranscoder::getFileUrlNotReady |
( |
| $mixedHandler | ) |
|
◆ getFilterParams()
BxDolTranscoder::getFilterParams |
( |
| $sName | ) |
|
Get filter params
- Parameters
-
- Returns
- array of filter params if filter was found, or false if given filter isn't enabled for the transcoder
◆ getObjectInstance()
static BxDolTranscoder::getObjectInstance |
( |
| $sObject | ) |
|
|
static |
Get transcode object instance.
- Parameters
-
$sObject | - name of transcode object. |
- Returns
- false on error or instance of transcoder class.
Implements iBxDolFactoryObject.
◆ getStorage()
BxDolTranscoder::getStorage |
( |
| ) |
|
Get storage object where transcoded data is stored
◆ getTranscoderObjects()
static BxDolTranscoder::getTranscoderObjects |
( |
| ) |
|
|
staticprotected |
Get transcoder objects array
- Returns
- array
◆ isFileReady()
BxDolTranscoder::isFileReady |
( |
| $mixedHandler, |
|
|
| $isCheckOutdated = true ) |
Check if transcoded data is available. No need to call it directly, it is called automatically when it is needed.
- Parameters
-
$mixedHandler | - file handler |
$isCheckOutdated | - check if transcoded file is outdated |
- Returns
- false if there is no ready transcoded file is available or it is outdated, true if file is ready
Reimplemented in BxDolTranscoderImage.
◆ isMimeTypeSupported()
BxDolTranscoder::isMimeTypeSupported |
( |
| $sMimeType | ) |
|
◆ onAlertResponseFileDeleteLocal()
static BxDolTranscoder::onAlertResponseFileDeleteLocal |
( |
| $oAlert, |
|
|
| $sObject ) |
|
static |
Called automatically, upon local(transcoded) file deletetion.
◆ onAlertResponseFileDeleteOrig()
static BxDolTranscoder::onAlertResponseFileDeleteOrig |
( |
| $oAlert, |
|
|
| $sObject ) |
|
static |
Called automatically, upon original file deletetion.
◆ onDeleteFileLocal()
BxDolTranscoder::onDeleteFileLocal |
( |
| $iFileId | ) |
|
Called automatically, upon local(transcoded) file deletetion.
◆ onDeleteFileOrig()
BxDolTranscoder::onDeleteFileOrig |
( |
| $mixedHandler | ) |
|
Called automatically, upon original file deletetion.
◆ processCompleted()
static BxDolTranscoder::processCompleted |
( |
| ) |
|
|
static |
Store completed files from tmp queue storage to the final storage Must be performed on the actual site.
◆ processQueue()
static BxDolTranscoder::processQueue |
( |
| $bQueuePruning = true | ) |
|
|
static |
Process files queued for transcoding Can be performed on separate server.
◆ prune()
BxDolTranscoder::prune |
( |
| ) |
|
Delete outdated files by last access time.
- Returns
- number of pruned/deleted files
◆ pruning()
static BxDolTranscoder::pruning |
( |
| ) |
|
|
static |
Delete outdated transcoed data from all transcoeeed objects, by last access time. It called on cron, usually every day.
- Returns
- total number of pruned/deleted files
◆ registerHandlers()
BxDolTranscoder::registerHandlers |
( |
| ) |
|
Register necessary alert handlers for automatic deletetion of transcoded data if source file is deleted. Make sure that you call it once, before first usage, for example upon module installation.
◆ registerHandlersArray()
static BxDolTranscoder::registerHandlersArray |
( |
| $mixed | ) |
|
|
static |
Register handlers array It can be called upon module enable event.
- Parameters
-
$mixed | array of transcoders objects, or just one object |
◆ registerHandlersSystem()
static BxDolTranscoder::registerHandlersSystem |
( |
| ) |
|
|
static |
◆ transcode()
BxDolTranscoder::transcode |
( |
| $mixedHandler, |
|
|
| $iProfileId = 0 ) |
Transcode file, no need to call it directly, it is called automatically when it is needed.
- Parameters
-
$mixedHandler | - file handler |
$iProfileId | - optional profile id, to assign transcoded file ownership to, usually it is NOT assigned to any particular profile, so just leave it default |
- Returns
- true on success, false on error
Hooks:
'system', 'transcode' - hook before file is transcoded
- $unit_name - equals
system
- $action - equals
transcode
- $object_id - file handler
- $sender_id - equals
false
- $extra_params - array of additional params with the following array keys:
Hooks:
'system', 'transcoded' - hook after file is transcoded
- $unit_name - equals
system
- $action - equals
transcoded
- $object_id - file handler
- $sender_id - equals
false
- $extra_params - array of additional params with the following array keys:
Reimplemented in BxDolTranscoderImage.
◆ unregisterHandlers()
BxDolTranscoder::unregisterHandlers |
( |
| ) |
|
Unregister alert handlers for automatic deletetion of transcoded data if source file is deleted. Make sure that you call it once, for example upon module uninstallation.
◆ unregisterHandlersArray()
static BxDolTranscoder::unregisterHandlersArray |
( |
| $mixed | ) |
|
|
static |
Unregister handlers array It can be called upon module disbale event.
- Parameters
-
$mixed | array of transcoders objects, or just one object |
The documentation for this class was generated from the following file:
- inc/classes/BxDolTranscoder.php