|
|
@@ -165,7 +165,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$sFileData = bx_file_get_contents ($aQueue['file_url_result']);
|
|
|
if (false === $sFileData) {
|
|
|
$o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "download file failed: {$aQueue['file_url_result']}\n");
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, get transcoded file from URL ({$aQueue['file_url_result']}) failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, get transcoded file from URL ({$aQueue['file_url_result']}) failed", BX_LOG_ERR);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -173,7 +173,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
if (!file_put_contents($sTmpFile, $sFileData)) {
|
|
|
$o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "store downloaded file failed\n");
|
|
|
@unlink($sTmpFile);
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file to tmp file ({$sTmpFile}) failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file to tmp file ({$sTmpFile}) failed", BX_LOG_ERR);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -182,7 +182,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_DELETE); // mark to delete it (deletion is performed on the server where it was transcoded)
|
|
|
} else {
|
|
|
$o->getDb()->updateQueueStatus($aQueue['file_id_source'], BX_DOL_QUEUE_FAILED, "store file failed:\n" . $o->getLog());
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file ({$aQueue['file_id_source']}) in final storage failed: " . $o->getLog());
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: processCompleted failed, store transcoded file ({$aQueue['file_id_source']}) in final storage failed: " . $o->getLog(), BX_LOG_ERR);
|
|
|
}
|
|
|
|
|
|
// delete tmp local file
|
|
|
@@ -290,14 +290,14 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
// delete main file
|
|
|
$iFileId = $this->_oDb->getFileIdByHandler($mixedHandler);
|
|
|
if ($iFileId && !$this->_oStorage->deleteFile($iFileId)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete failed", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// delete retina file
|
|
|
$iFileId = $this->_oDb->getFileIdByHandler($mixedHandler . $this->_sRetinaSuffix);
|
|
|
if ($iFileId && !$this->_oStorage->deleteFile($iFileId)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete retina file failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: onDeleteFileOrig failed for handler ({$mixedHandler}) delete retina file failed", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -376,13 +376,13 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
|
|
|
$iFileId = $this->_oDb->getFileIdByHandler($mixedHandler);
|
|
|
if (!$iFileId) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file id wasn't found");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file id wasn't found", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$aFile = $this->_oStorage->getFile($iFileId);
|
|
|
if (!$aFile) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file wasn't found in the source storage");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}) source file wasn't found in the source storage", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -393,7 +393,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
}
|
|
|
|
|
|
if ($this->_sQueueTable && !$this->addToQueue($mixedHandler)) { // add file to queue (when queue is enabled) if it isn't transcoded yet
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}), can't add file to queue");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFileUrl failed for handler ({$mixedHandler}), can't add file to queue", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -645,7 +645,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$oStorage = BxDolStorage::getObjectInstance($this->_sQueueStorage);
|
|
|
if (!$oStorage->deleteFile($a['file_id_result'])) {
|
|
|
$this->_oDb->updateQueueStatus($mixedHandler, BX_DOL_QUEUE_FAILED, $sErrMsg . $this->getLog());
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: deleteFromQueue failed for handler ({$mixedHandler}): " . $this->getLog());
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: deleteFromQueue failed for handler ({$mixedHandler}): " . $this->getLog(), BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -660,7 +660,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$iFileId = $this->_oStorage->storeFileFromPath ($sTmpFile, $isPrivate, $iProfileId);
|
|
|
if (!$iFileId) {
|
|
|
$this->addToLog($this->_oStorage->getErrorString());
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFile failed for handler ({$mixedHandler}): " . $this->_oStorage->getErrorString());
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFile failed for handler ({$mixedHandler}): " . $this->_oStorage->getErrorString(), BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -684,7 +684,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$iFileIdResult = $oStorage->storeFileFromPath ($sTmpFile, 1, 0);
|
|
|
if (!$iFileIdResult) {
|
|
|
$this->addToLog($oStorage->getErrorString());
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFileInQueueStorage failed for handler ({$mixedHandler}): " . $oStorage->getErrorString());
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeTranscodedFileInQueueStorage failed for handler ({$mixedHandler}): " . $oStorage->getErrorString(), BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -723,7 +723,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
if (IMAGE_ERROR_SUCCESS == $o->resize($sFile))
|
|
|
return true;
|
|
|
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Resize failed for file ({$sFile}): " . $o->getError());
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: applyFilter_Resize failed for file ({$sFile}): " . $o->getError(), BX_LOG_ERR);
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
@@ -809,7 +809,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
$sPath = BX_DIRECTORY_PATH_ROOT . $sPath;
|
|
|
|
|
|
if (!file_exists($sPath)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFilePath_Folder failed, file ({$sPath}) doesn't exist for handler ({$mixedHandler})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getFilePath_Folder failed, file ({$sPath}) doesn't exist for handler ({$mixedHandler})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -820,13 +820,13 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
{
|
|
|
$sPath = $this->getFilePath_Folder($mixedHandler);
|
|
|
if (!$sPath) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, source file ({$sPath}) doesn't exist for handler ({$mixedHandler})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, source file ({$sPath}) doesn't exist for handler ({$mixedHandler})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sTmpFile = $this->getTmpFilename ($mixedHandler);
|
|
|
if (!copy($sPath, $sTmpFile)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, copy from file ({$sPath}) to file ({$sTmpFile}) failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Folder failed, copy from file ({$sPath}) to file ({$sTmpFile}) failed", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -837,31 +837,31 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
{
|
|
|
$oStorageOriginal = BxDolStorage::getObjectInstance($this->_aObject['source_params']['object']);
|
|
|
if (!$oStorageOriginal) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, source storage({$this->_aObject['source_params']['object']}) isn't available");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, source storage({$this->_aObject['source_params']['object']}) isn't available", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$aFile = $oStorageOriginal->getFile($mixedHandler);
|
|
|
if (!$aFile) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sUrl = $oStorageOriginal->getFileUrlById($mixedHandler);
|
|
|
if (!$sUrl) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file({$mixedHandler}) wasn't found in source storage ({$this->_aObject['source_params']['object']})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sFileData = bx_file_get_contents ($sUrl, [], 'get', []);
|
|
|
if (false === $sFileData) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, getting file from URL({$sUrl}) failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, getting file from URL({$sUrl}) failed", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sTmpFile = $this->getTmpFilename ($aFile['file_name']);
|
|
|
if (!file_put_contents($sTmpFile, $sFileData)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file save failed ({$sTmpFile})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Storage failed, file save failed ({$sTmpFile})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -872,19 +872,19 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
{
|
|
|
$aQueue = $this->_oDb->getFromQueue($mixedHandler);
|
|
|
if (!$aQueue || !$aQueue['file_url_source']) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file ({$mixedHandler}) wasn't found in queue");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file ({$mixedHandler}) wasn't found in queue", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sFileData = bx_file_get_contents ($aQueue['file_url_source'], [], 'get', []);
|
|
|
if (false === $sFileData) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, getting file from URL({$aQueue['file_url_source']}) failed");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, getting file from URL({$aQueue['file_url_source']}) failed", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$sTmpFile = $this->getTmpFilename ($mixedHandler);
|
|
|
if (!file_put_contents($sTmpFile, $sFileData)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file save failed ({$sTmpFile})");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: storeFileLocally_Queue failed, file save failed ({$sTmpFile})", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -895,7 +895,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
{
|
|
|
$sPath = $this->_aObject['source_params']['path'] . $mixedHandler;
|
|
|
if (!file_exists(BX_DIRECTORY_PATH_ROOT . $sPath)) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Folder failed, source file ({$sPath}) doesn't exist");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Folder failed, source file ({$sPath}) doesn't exist", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -906,7 +906,7 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
|
|
|
{
|
|
|
$oStorageOriginal = BxDolStorage::getObjectInstance($this->_aObject['source_params']['object']);
|
|
|
if (!$oStorageOriginal) {
|
|
|
- bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Storage failed, source storage ({$this->_aObject['source_params']['object']}) doesn't exist");
|
|
|
+ bx_log('sys_transcoder', "[{$this->_aObject['object']}] ERROR: getOrigFileUrl_Storage failed, source storage ({$this->_aObject['source_params']['object']}) doesn't exist", BX_LOG_ERR);
|
|
|
return false;
|
|
|
}
|
|
|
|