Skip to content

Commit

Permalink
Fix APCU_BC pecl extension generating errors upon install (#401)
Browse files Browse the repository at this point in the history
* Fix APCU_BC generating errors
* Add upgrade file due to non-BC change

--------------------
Remove APCU_BC due to it generating errors. PECL `APC` now supports PHP 7.0+ as of version 5.1.0.

https://pecl.php.net/package/APCu
  • Loading branch information
Neodork authored Aug 27, 2019
1 parent 1999488 commit 3744bf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
12 changes: 12 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
UPGRADE FROM 1.0.x to 2.0
=======================

### APCU_BC install

* Due to issues with the `apcu_bc` pecl extension install and [growing support for PHP 7.0+](https://pecl.php.net/package/APCu)
within the `apcu` pecl extension, deprecate the use of `apcu_bc`. To ensure new `apcu` install
do the following for every PHP version installed:

* Uninstall your pecl installed apcu extensions `pecl uninstall apcu && pecl uninstall apcu_bc`

* Remove the `apcu.so` and `apc.so` extensions from `/usr/local/etc/valet-php/<version>/php.ini`
25 changes: 4 additions & 21 deletions cli/Valet/Pecl.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,11 @@ class Pecl extends AbstractPecl
'default' => false,
'extension_type' => self::ZEND_EXTENSION_TYPE
],
self::APCU_BC_EXTENSION => [
'5.6' => false,
'extension_type' => self::NORMAL_EXTENSION_TYPE
],
self::APCU_EXTENSION => [
'7.3' => false,
'7.2' => false,
'7.1' => false,
'7.0' => false,
'7.3' => '5.1.17',
'7.2' => '5.1.17',
'7.1' => '5.1.17',
'7.0' => '5.1.17',
'5.6' => '4.0.11',
'extension_type' => self::NORMAL_EXTENSION_TYPE
],
Expand Down Expand Up @@ -264,9 +260,6 @@ private function removeIniDefinition($extension)
private function alternativeDisable($extension)
{
switch ($extension) {
case self::APCU_BC_EXTENSION:
$this->disable(self::APCU_EXTENSION);
break;
default:
break;
}
Expand All @@ -284,10 +277,6 @@ private function alternativeDisable($extension)
private function alternativeUninstall($extension)
{
switch ($extension) {
case self::APCU_BC_EXTENSION:
$version = $this->getVersion($extension);
$this->uninstall(self::APCU_EXTENSION, $version);
break;
default:
break;
}
Expand Down Expand Up @@ -462,8 +451,6 @@ public function isInstalled($extension)
private function alternativeInstall($extension, $phpIniFile)
{
switch ($extension) {
case self::APCU_BC_EXTENSION:
return $this->replaceIniDefinition(self::APCU_EXTENSION, $phpIniFile);
default:
return $phpIniFile;
}
Expand Down Expand Up @@ -513,8 +500,6 @@ private function isDefaultExtension($extension)
protected function getExtensionAlias($extension)
{
switch ($extension) {
case self::APCU_BC_EXTENSION:
return self::APCU_BC_ALIAS;
default:
return $extension;
}
Expand Down Expand Up @@ -566,8 +551,6 @@ private function isEnabledCorrectly($extension)
private function isAlternativeEnabledCorrectly($extension)
{
switch ($extension) {
case self::APCU_BC_EXTENSION:
return $this->isEnabledCorrectly(self::APCU_EXTENSION);
default:
return true;
}
Expand Down

0 comments on commit 3744bf5

Please sign in to comment.