1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Replaced e_date::strptime() with eShims::strptime()

- NEW: Added \e107\Shims\Internal\StrptimeTrait, which implements PHP internal function
       strptime(). On not-Windows, the built-in function is called. If that function fails
       or if the operating system is Windows, the alternative pure PHP implementation is
       attempted. The first successful call is returned, or false if none are successful.
- MOD: Deprecated e_date::strptime() in favor of eShims::strptime()
- FIX: License misatributed for e_date::strptime() (now eShims::strptime()). The library
       used was public domain, not CC BY-NC-SA 2.0 FR by Lionel Sauron.
- MOD: Removed STRPTIME_COMPAT constant now that eShims::strptime() exists
- MOD: Removed support for calling e_date::strptime() with:
       - a localized full month name
       - a localized abbreviated month name
       - AM or PM
       - am or pm
       because these features were only implemented in Windows mode (STRPTIME_COMPAT).
- MOD: php_compatibility_handler.php now defines global strptime() using the
       eShims::strptime() implementation
- NEW: Test all(?) the possibilities of eShims::strptime()
This commit is contained in:
Nick Liu
2020-01-22 09:07:00 +01:00
parent f93ab61372
commit f23aec7395
5 changed files with 270 additions and 179 deletions

View File

@@ -26,17 +26,12 @@ if (!defined('e107_INIT'))
*/
if (!function_exists('strptime'))
{
define('STRPTIME_COMPAT', true);
function strptime($str, $format)
function strptime($date, $format)
{
return e107::getDate()->strptime($str,$format);
}
return eShims::strptime($date, $format);
}
}
//PHP < 5.2 compatibility