increased debug verbosity
This commit is contained in:
parent
19c130c8cf
commit
1b4c5bcd06
2 changed files with 15 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
1.37:
|
||||||
|
* Increased debug verbosity
|
||||||
|
|
||||||
1.35:
|
1.35:
|
||||||
* Use XML compliant controls=1 syntax
|
* Use XML compliant controls=1 syntax
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ if (file_exists($probelang)) {
|
||||||
include_once dirname(__FILE__) . '/lang_en.inc.php';
|
include_once dirname(__FILE__) . '/lang_en.inc.php';
|
||||||
include_once dirname(__FILE__) . '/podcast_player.php';
|
include_once dirname(__FILE__) . '/podcast_player.php';
|
||||||
|
|
||||||
@define("SERENDIPITY_EVENT_PODCAST_VERSION", "1.36");
|
@define("SERENDIPITY_EVENT_PODCAST_VERSION", "1.37");
|
||||||
|
|
||||||
class serendipity_event_podcast extends serendipity_event {
|
class serendipity_event_podcast extends serendipity_event {
|
||||||
/**
|
/**
|
||||||
|
@ -849,6 +849,8 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFileMime($ext, $fallback = '') {
|
function getFileMime($ext, $fallback = '') {
|
||||||
|
$this->log("getFileMime: $ext, $fallback");
|
||||||
|
|
||||||
switch(strtolower($ext)) {
|
switch(strtolower($ext)) {
|
||||||
case 'm4a':
|
case 'm4a':
|
||||||
return 'audio/mp4';
|
return 'audio/mp4';
|
||||||
|
@ -872,7 +874,7 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
function GetFileInfo($url) {
|
function GetFileInfo($url) {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
$this->log("GetFileInfo");
|
$this->log("GetFileInfo for $url");
|
||||||
|
|
||||||
$fileInfo = array();
|
$fileInfo = array();
|
||||||
|
|
||||||
|
@ -893,7 +895,7 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
|
|
||||||
$cache = new Cache_Lite($cacheOptions);
|
$cache = new Cache_Lite($cacheOptions);
|
||||||
if ($fileInfo = $cache->get($cacheId)){
|
if ($fileInfo = $cache->get($cacheId)){
|
||||||
$this->log("GetFileInfo: Cached infos found");
|
$this->log("GetFileInfo: Cached infos found in file $cacheId");
|
||||||
//return directly on cache hit
|
//return directly on cache hit
|
||||||
return $fileInfo;
|
return $fileInfo;
|
||||||
}
|
}
|
||||||
|
@ -917,6 +919,8 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
$localMediaFile = $serendipity['serendipityPath'] . $rel_path;
|
$localMediaFile = $serendipity['serendipityPath'] . $rel_path;
|
||||||
|
|
||||||
$fileInfo['localMediaFile'] = $localMediaFile;
|
$fileInfo['localMediaFile'] = $localMediaFile;
|
||||||
|
|
||||||
|
$this->log("Absolute_url: $absolute_url - Relative: $localMediaFile");
|
||||||
|
|
||||||
// Remember extension of file
|
// Remember extension of file
|
||||||
list($sName, $fileInfo['extension']) = serendipity_parseFileName($localMediaFile);
|
list($sName, $fileInfo['extension']) = serendipity_parseFileName($localMediaFile);
|
||||||
|
@ -946,6 +950,7 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
serendipity_request_start();
|
serendipity_request_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->Log("Execute HTTP_Request for $url");
|
||||||
$http = new HTTP_Request($url);
|
$http = new HTTP_Request($url);
|
||||||
$http->setMethod(HTTP_REQUEST_METHOD_HEAD);
|
$http->setMethod(HTTP_REQUEST_METHOD_HEAD);
|
||||||
|
|
||||||
|
@ -953,6 +958,7 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
$fileInfo['length'] = intval($http->getResponseHeader('content-length'));
|
$fileInfo['length'] = intval($http->getResponseHeader('content-length'));
|
||||||
$fileInfo['md5'] = $http->getResponseHeader('content-md5'); //will return false if not present
|
$fileInfo['md5'] = $http->getResponseHeader('content-md5'); //will return false if not present
|
||||||
$fileInfo['mime'] =$http->getResponseHeader('content-type');
|
$fileInfo['mime'] =$http->getResponseHeader('content-type');
|
||||||
|
$this->Log("Filling MIME with HTTP Header: " . print_r($fileInfo, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('serendipity_request_end')) {
|
if (function_exists('serendipity_request_end')) {
|
||||||
|
@ -1042,6 +1048,8 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
function GetID3Infos($filename, &$fileInfoArray) {
|
function GetID3Infos($filename, &$fileInfoArray) {
|
||||||
// Set default fileinformation:
|
// Set default fileinformation:
|
||||||
$fileInfoArray['mime'] = serendipity_guessMime($fileInfoArray['extension']);
|
$fileInfoArray['mime'] = serendipity_guessMime($fileInfoArray['extension']);
|
||||||
|
|
||||||
|
$this->log("GetID3Infos, Guessed mime: " . $fileInfoArray['mime']);
|
||||||
$fileInfoArray['width'] = 0;
|
$fileInfoArray['width'] = 0;
|
||||||
$fileInfoArray['height'] = 0;
|
$fileInfoArray['height'] = 0;
|
||||||
|
|
||||||
|
@ -1085,6 +1093,7 @@ class serendipity_event_podcast extends serendipity_event{
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$fileInfoArray['mime'] = 'error/filenotfound';
|
$fileInfoArray['mime'] = 'error/filenotfound';
|
||||||
|
$this->log("File $filename not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue