1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

7 Commits

Author SHA1 Message Date
Nick Liu
beedf081ab
Fix infinite recursion in compatibility strptime() for Windows
\e107\Shims\Internal\InternalTrait::strptime() now tries to run the internal PHP strptime()
function first instead of what's defined, which should defend against accidental infinite
recursion if something else like ./e107_handlers/php_compatibility_handler.php declares
strptime() and calls eShims::strptime().
2020-01-23 09:42:46 +01:00
Nick Liu
f23aec7395
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()
2020-01-22 09:07:27 +01:00
Nick Liu
f93ab61372
Moved readfile() shim to its own trait 2020-01-22 00:40:26 +01:00
Nick Liu
9cf215a0be
Better names for eShims classes
* \e107\Shims\All → \e107\Shims\AllShims
* \e107\Shims\Internal → \e107\Shims\InternalShims
* \e107\Shims\InternalShims → \e107\Shims\InternalShimsTrait

Fixes: #3538
2018-11-03 09:24:05 -05:00
Nick Liu
ded595d704
Renamed e_shims to eShims
To follow @myovchev's convention like eHelper

Per @CaMer0n
2018-10-31 12:32:58 -05:00
Nick Liu
b2de51dd1b
Split e_shims into correct files for autoloading 2018-10-31 09:37:07 -05:00
Nick Liu
60056deb93
Support for namespaced classes; added e_shims
e_shims is an e107 v2-compatible class for the first namespaced core
class, e107\Shims\All.

e107\Shims\All is built from the e107\Shims\InternalShims trait.

e107\Shims\InternalShims currently implements a resilient replacement
for the PHP internal readfile(), which is needed by issue #3528.

As for how the new namespaced classes are handled, the e107 class
(e107_handlers/e107_class.php) has an updated e107::autoload() which
detects namespaced classes and goes to e107::autoload_namespaced().

Namespaced classes handled by e107 are in the \e107 top-level namespace,
and all sub-levels match directory paths under e_HANDLER.
2018-10-31 07:27:38 -05:00