1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Issue #5096 - possible fix for older versions of PHP.

This commit is contained in:
camer0n
2023-11-03 16:07:00 -07:00
parent bfb515f2b5
commit 45661f44c3
3 changed files with 5 additions and 7 deletions

View File

@@ -68,7 +68,7 @@ class cron_admin_ui extends e_admin_ui
'cron_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'text', 'data'=>'str', 'width' => '35%', 'readonly' => 1), 'cron_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'text', 'data'=>'str', 'width' => '35%', 'readonly' => 1),
'cron_function' => array('title'=> LAN_CRON_2, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left first', 'readonly' => 1), 'cron_function' => array('title'=> LAN_CRON_2, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left first', 'readonly' => 1),
'cron_tab' => array('title'=> LAN_CRON_3, 'type' => 'method', 'width' => 'auto'), // Display name 'cron_tab' => array('title'=> LAN_CRON_3, 'type' => 'method', 'width' => 'auto'), // Display name
'cron_lastrun' => array('title'=> LAN_CRON_4, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2), 'cron_lastrun' => array('title'=> LAN_CRON_4, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2, 'readParms'=>['mask'=>'dd MM yyyy hh:ii:ss']),
'cron_active' => array('title'=> LAN_ACTIVE, 'type' => 'boolean', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'), 'cron_active' => array('title'=> LAN_ACTIVE, 'type' => 'boolean', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'),
'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'noedit'=>TRUE, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'right') 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'noedit'=>TRUE, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'right')
); );

View File

@@ -65,11 +65,13 @@ trait StrftimeTrait
return date_format($datetime, $format); return date_format($datetime, $format);
} }
$timezone = 'GMT'.date('O');
$formatter = new \IntlDateFormatter( $formatter = new \IntlDateFormatter(
self::getSensibleLocale(), self::getSensibleLocale(),
\IntlDateFormatter::NONE, \IntlDateFormatter::NONE,
\IntlDateFormatter::NONE, \IntlDateFormatter::NONE,
'GMT'.date('O'), // More accurate timezone. @see https://stackoverflow.com/questions/31707395/why-php-intldateformatter-returns-wrong-date-1-hour $timezone, // More accurate timezone. @see https://stackoverflow.com/questions/31707395/why-php-intldateformatter-returns-wrong-date-1-hour
null, null,
$format $format
); );

View File

@@ -1223,16 +1223,12 @@ class cronScheduler
{ {
if($this->debug) if($this->debug)
{ {
$this->cron->debug('e107: Cron could not find method: '.$job['function'], E_ERROR); $this->cron->debug('Cron could not find method: '.$job['function'], E_ERROR);
} }
return $status; return $status;
} }
if($this->debug)
{
$this->cron->debug('e107: Cron could not find method: '.$class . "::" . $job['function'].'()', E_NOTICE);
}
// Exception handling. // Exception handling.
$method = $job['function']; $method = $job['function'];