Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Commit

Permalink
permanent fix for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
demonrik committed Oct 31, 2018
1 parent c1409a0 commit 7f479bd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
22 changes: 18 additions & 4 deletions app/includes/dvrui_debug.php
@@ -1,9 +1,23 @@
<?php
error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT));
require_once("vars.php");
if (function_exists('opcache_reset') && DVRUI_Vars::DVRUI_DEBUG) {
opcache_reset();
}

class DVRUI_Debug {
public function log($entry) {

}
if (DVRUI_Vars::DVRUI_DEBUG) {
ini_set("log_errors", DVRUI_Vars::DVRUI_DEBUG);
ini_set("error_log", "/tmp/php-dvrui.log");
ini_set('log_errors_max_len', 1024);
error_log( "======= Debug Log START =========" );
error_log( "DVRUI Version: " . DVRUI_Vars::DVRUI_version);
}

if (PHP_MAJOR_VERSION >= 7) {
error_log( "PHP > 7 detected" );
set_error_handler(function ($errno, $errstr) {
return strpos($errstr, 'Declaration of') === 0;
}, E_WARNING);
}

?>
1 change: 1 addition & 0 deletions app/includes/dvrui_recordings.php
Expand Up @@ -84,6 +84,7 @@ public function processSeriesList($hdhr, $categories) {
}

private function processRecordingData($recording, $storageID) {
$recID = '';
$playURL = '';
$cmdURL = '';
$category = '';
Expand Down
2 changes: 1 addition & 1 deletion app/includes/dvrui_upcoming.php
Expand Up @@ -249,7 +249,7 @@ public function getEpTitle($pos) {
}
public function getEpOriginalAirDate($pos) {
if ($pos < count($this->upcoming_list)) {
return date('D M/d Y',$this->upcoming_list[$pos][$this->epData_OriginalAirDate]);
return date('D M/d Y',strtotime($this->upcoming_list[$pos][$this->epData_OriginalAirDate]));
} else {
return '';
}
Expand Down
22 changes: 4 additions & 18 deletions app/index.php
@@ -1,26 +1,12 @@
<?php

require_once("vars.php");
if (function_exists('opcache_reset') && DVRUI_Vars::DVRUI_DEBUG) {
opcache_reset();
}

ini_set("log_errors", DVRUI_Vars::DVRUI_DEBUG);
ini_set("error_log", "/tmp/php-dvrui.log");
ini_set('log_errors_max_len', 1024);
error_log( "======= Debug Log START =========" );

if (PHP_MAJOR_VERSION >= 7) {
error_log( "PHP > 7 detected" );
set_error_handler(function ($errno, $errstr) {
return strpos($errstr, 'Declaration of') === 0;
}, E_WARNING);
}
require_once("vars.php");
require_once("includes/dvrui_debug.php");

error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT));
define('TINYAJAX_PATH', '.');
require_once("TinyAjax.php");
require_once("TinyAjaxBehavior.php");

require_once("rules.php");
require_once("recordings.php");
require_once("series.php");
Expand Down Expand Up @@ -111,6 +97,6 @@
$pagecontent .= $footer;
echo($pagecontent);

// error_log( "======= Debug Log END =========" );
error_log( "======= Debug Log END =========" );
?>

4 changes: 2 additions & 2 deletions app/vars.php
@@ -1,7 +1,7 @@
<?php
final class DVRUI_Vars
{
const DVRUI_version ="0.6.4";
const DVRUI_version ="0.6.5";
const DVRUI_name ="HDHomeRun DVR UI";
const DVRUI_git ="https://github.com/demonrik/HDHR-DVRUI.git";
const DVRUI_apiurl ="http://api.hdhomerun.com/";
Expand All @@ -13,6 +13,6 @@ final class DVRUI_Vars
const DVRUI_discover_cache = 360;
const DVRUI_upcoming_cache = 3600;

const DVRUI_DEBUG = false;
const DVRUI_DEBUG = true;
}
?>

0 comments on commit 7f479bd

Please sign in to comment.