1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 17:44:37 +02:00

Improved detection of deprecated functions/methods and display in DEBUG mode: deprecated.

This commit is contained in:
Cameron
2020-12-21 10:00:28 -08:00
parent 63527c4f19
commit 630f3f415f
30 changed files with 224 additions and 82 deletions

View File

@@ -217,6 +217,8 @@ class e_date
*/
function convert($string=null, $mask = 'inputdate')
{
trigger_error('<b>'.__METHOD__.' is deprecated.</b> Use $tp->toDate() instead.', E_USER_DEPRECATED); // NO LAN
if($string == null) return false;
return is_numeric($string) ? $this->convert_date($string, $mask) : $this->toTime($string, $mask);
}
@@ -779,6 +781,8 @@ class e_date
*/
public function strptime($str, $format)
{
trigger_error('<b>'.__METHOD__.' is deprecated.</b> Use eShims::strptime() instead', E_USER_DEPRECATED); // NO LAN
$vals = eShims::strptime($str, $format); // PHP5 is more accurate than below.
$vals['tm_amon'] = strftime('%b', mktime(0, 0, 0, $vals['tm_mon'] + 1));
$vals['tm_fmon'] = strftime('%B', mktime(0, 0, 0, $vals['tm_mon'] + 1));