Hello,
I am not really new with Joomla!. But this is my first issue here and also the first time that I am contributing to this project.
So I am sorry for my bad English and please be patiently with me if I get something wrong.
It's not possible to choose apc as session handler if you are running php >= 7.0
I think this is caused by libraries/vendor/joomla/session/Joomla/Session/Storage/Apc.php
,
which this function has for detecting apc/apcu:
public static function isSupported()
{
return extension_loaded('apc');
}
To support php >= 7.0 it should be:
public static function isSupported()
{
return extension_loaded('apcu');
}
Or we need an extra handler like already done in Joomla 4 with libraries/vendor/joomla/session/src/Handler/ApcHandler.php
Best regards
Felix
Labels |
Added:
?
|
Title |
|
Title |
|
Category | ⇒ | Libraries |
Status | New | ⇒ | Discussion |
Thanks for the quick answer. So I guess this will be little bit more complicated as I thought.
I have a few question, to understand the whole thing.
As far as I understand, we do need new handler, because all apc_*
functions need to be rewritten in to apcu_*
. As far as I know they should have a quite similar syntax or even the same?
The new handler need also to check apcu
by extension_loaded('apcu')
.
Would we really need two handler apc
and apcu
? Why not only support apcu
, if apc
is deprecated? Is this to be compatible with PHP < 5.5?
The APC handler has been there for a long time, and will be dropped in 4.0 since support for that extension is dead. We just never got around to adding an APCu handler in the session API (it was done for the cache API though). And as you found, in the Framework's Session package we did clean things up and make a proper APCu handler.
So honestly it's just one of those things where nobody did the work to add that support.
Would we really need two handler apc and apcu? Why not only support apcu, if apc is deprecated? Is this to be compatible with PHP < 5.5?
If I'm not mistaken PHP's ext/apc
is only supported on PHP 5.3 and 5.4, while ext/apcu
is PHP 5.5+. IIRC there's also an extension on PECL that can bridge APC to APCu on PHP 5 (maybe even "trick" the extension_loaded()
check) but I don't recall if that extension works on PHP 7. Either way migrating APC to APCu is the right course of action, this is just the one area it wasn't done in for whatever reason.
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-03-25 19:10:56 |
Closed_By | ⇒ | mbabker |
PHP's
ext/apc
andext/apcu
are two separate things, so yes, a separate handler for the APCu extension would be needed to work specifically with the newer APCu extension.The original APC extension was in essence deprecated and abandoned at PHP 5.5 in favor of OPCache and APCu became the de facto continuation of this. IIRC there is still an
apcu-bc
package on PECL that can proxy the oldapc_*
functions toapcu_*
but even that would never make theextension_loaded('apc')
check pass.