Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ClassLoader] Use symfony/polyfill-apcu #17358

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

Merged
merged 1 commit into from
Jan 14, 2016
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Fixes APC usage on PHP 7 or when APCu bc-layer is disabled

@fabpot
Copy link
Member

fabpot commented Jan 14, 2016

👍

@jakzal
Copy link
Contributor

jakzal commented Jan 14, 2016

Shouldn't tests be updated as well?

@nicolas-grekas
Copy link
Member Author

@jakzal this test class does not exist in 2.3, but yes you're right

@@ -67,7 +67,7 @@ class ApcClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!extension_loaded('apc')) {
if (!ini_get('apc.enabled') || ('cli' === PHP_SAPI && !ini_get('apc.enable_cli'))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be a potential bc break for people who installed apc but didn't enable it. And I don't feel like it's the classes responsibility to check if apc is enabled. it should only make sure the methods can be called, i.e how it was before.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated using if (!function_exists('apcu_fetch')) {

@@ -67,7 +67,7 @@ class ApcClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!extension_loaded('apc')) {
if (!function_exists('apcu_fetch')) {
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO "enabled" should be replaced by "installed"

Copy link
Member Author

Choose a reason for hiding this comment

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

let's go for "installed"

@Tobion
Copy link
Contributor

Tobion commented Jan 14, 2016

Thank you @nicolas-grekas.

@Tobion Tobion merged commit 623595f into symfony:2.3 Jan 14, 2016
Tobion added a commit that referenced this pull request Jan 14, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

[ClassLoader] Use symfony/polyfill-apcu

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixes APC usage on PHP 7 or when APCu bc-layer is disabled

Commits
-------

623595f [ClassLoader] Use symfony/polyfill-apcu
@nicolas-grekas nicolas-grekas deleted the apcu branch January 15, 2016 09:14
fabpot added a commit that referenced this pull request Jan 25, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

[ClassLoader] Use symfony/polyfill-apcu

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

#17358 updated ApcClassLoader to use polyfill-apcu, but not ApcUniversalClassLoader

2.7 / 2.8 tests are in LegacyApcUniversalClassLoaderTest

Commits
-------

a0dc399 [ClassLoader] Use symfony/polyfill-apcu
@fabpot fabpot mentioned this pull request Feb 3, 2016
This was referenced Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants