Skip to content

Do not activate the sfACPUCache if not supported #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

thePanz
Copy link
Member

@thePanz thePanz commented Dec 1, 2017

Deny to create an "inactive" sfAPCCache cache, when the apcu extension is not supported, instead
of creating the object that does not work as expected.

As for php7 the apcu extension requries the apcu-bc extension for backward compatibility reasons

Deny to create an "inactive" sfAPCCache cache, when the apcu extension is not supported, instead
of creating the object that does not work as expected.
As for php7 the apcu extension requries the apcu-bc extension for backward compatibility reasons
Copy link
Contributor

@alquerci alquerci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to create a PSR-6 and PSR-16 adapter in order to be able to use maintain cache implementation such as symfony/cache and others.

Copy link
Contributor

@alquerci alquerci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a test for this case?

// apcu used in php 5.x. The "apcu-bc" extension to be enabled to provide backward compatibility.
if (!function_exists('apc_store') || !ini_get('apc.enabled'))
{
throw new sfConfigurationException('sfAPCCache class needs the "apc" extension and the "apc_store" function to be enabled.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing an exception here is a BC breaks. Then to provide a BC layer I propose to introduce an option for that.


$this->enabled = function_exists('apc_store') && ini_get('apc.enabled');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to take the opportunity to fix the detection whether it is enabled?

See symfony/symfony#29041

@thePanz
Copy link
Member Author

thePanz commented Jul 24, 2020

Closing in favor of: https://github.com/FriendsOfSymfony1/CacheLegacyBridge

@thePanz thePanz closed this Jul 24, 2020
@thePanz thePanz deleted the fix-apcu-usage-and-availability branch July 24, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants