From 0f02e9a9a2fb4c52de26ee5e56894c4ead98c515 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 10 Aug 2020 18:13:59 -0700 Subject: [PATCH] Removed some PHP notices occurring in CLI mode. --- class2.php | 2 +- e107_handlers/cron_class.php | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/class2.php b/class2.php index 73e8e7c5f..467b87a86 100755 --- a/class2.php +++ b/class2.php @@ -1532,7 +1532,7 @@ if(!defined("THEME_LAYOUT")) $pref = e107::getPref(); $cusPagePref = (!empty($user_pref['sitetheme_custompages'])) ? $user_pref['sitetheme_custompages'] : varset($pref['sitetheme_custompages'],array()); $cusPageDef = (empty($user_pref['sitetheme_deflayout'])) ? varset($pref['sitetheme_deflayout'],'') : $user_pref['sitetheme_deflayout']; - $deflayout = e107::getTheme()->getThemeLayout($cusPagePref, $cusPageDef, e_REQUEST_URL, $_SERVER['SCRIPT_FILENAME']); + $deflayout = e107::getTheme()->getThemeLayout($cusPagePref, $cusPageDef, e_REQUEST_URL, varset($_SERVER['SCRIPT_FILENAME'])); define("THEME_LAYOUT",$deflayout); diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index d5bc47617..751e83e28 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -168,6 +168,17 @@ class _system_cron $message .= $this->renderTable($_SERVER); $message .= "

_ENV

"; $message .= $this->renderTable($_ENV); + $message .= "

LAST ERROR

"; + $message .= "
".print_r(error_get_last(), true)."
"; + $message .= "

HEADERS LIST

"; + $message .= "
".print_r(headers_list(),true)."
"; + $message .= "

Included Files

"; + $included_files = get_included_files(); + + foreach ($included_files as $filename) + { + $message .= $filename."
"; + } $eml = array( 'subject' => "TEST Email Sent by cron. ".date("r"), @@ -459,7 +470,7 @@ class CronParser function calcLastRan($string) { - $tstart = microtime(); + $tstart = microtime(true); $this->debug = ""; $this->lastRan = 0; $this->year = NULL; @@ -589,7 +600,7 @@ class CronParser } } - $tend = microtime(); + $tend = microtime(true); $this->taken = $tend - $tstart; $this->debug("Parsing $string taken " . $this->taken . " seconds");