PHP Extension installer

Last update: May 11, 2022

pickle - PHP Extension installer SensioLabsInsight

Pickle installs PHP extensions easily on all platforms.

Code Climate Scrutinizer Code Quality Code Coverage Build Status

Installation

Grab the latest phar at https://github.com/FriendsOfPHP/pickle/releases/latest

wget https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar

and run using

$ php pickle.phar

or add the execute flag

$ chmod +x pickle.phar

then run as:

$ pickle.phar info apcu

You can also rename the phar to "pickle"

$ mv pickle.phar pickle

so it can be called using pickle only.

And finally you can add it to your path or copy it in /usr/local/bin or your favorite binary directory.

On windows, use

$ php pickle.phar

or create a .bat containing:

@echo OFF
setlocal DISABLEDELAYEDEXPANSION
c:\path\to\php.exe "c:\path\to\pickle.phar" %*

If someone would be kind enough to write an installer script, we would be eternally thankful :)

Introduction

Pickle is a new PHP extension installer. It is based on Composer and the plan is to get Composer to fully support it. See https://github.com/composer/composer/pull/2898#issuecomment-48439196 for the Composer part of the discussions.

Pickle fully supports existing extensions in http://pecl.php.net, running the following will install the latest available version of the memcache extension:

$ pickle install memcache

Windows is fully supported, to install binaries or from the sources (work in progress and given that you have a working build environment in place).

The concept behind Pickle is to ease the life of both developers and end users.

For end users, nothing changes much except that Pickle is based on modern concepts and works with multiple protocols (git or http(s) URLs).

For developers, it drastically reduces the release work. Extension meta information is not duplicated anymore. Configuration options, files to package etc. are automatically fetched from the sources and the respective files are updated during the release process. There is no risk anymore of forgetting to update the version here or there, or to neglect to include a file.

Installation From Sources

While the phar usage is recommended, one is indeed able to use it from git.

Clone this repository and install the dependencies with Composer:

$ composer install

If you like to create your own phar from the pickle sources, you will need to install Box (http://box-project.github.io/box2/). Then clone the repository and run the following commands:

$ cd pickle
$ composer install --no-dev --optimize-autoloader
$ php -d phar.readonly=0 box.phar build

Usage

Usage is pretty straightforward. For example, to install the memcache extension run the following command:

$ bin/pickle install memcache

If you need to install a specific version of an extension, you may do so:

$ bin/pickle install [email protected]

You can also use pickle from your extension directory, the following command:

$ cd myext
$ bin/pickle install

A list of the commands is available using:

$ bin/pickle list

To get extended help for a given command, use:

$ bin/pickle help install

To convert a package (based on package.xml current PECL installer), use:

$ bin/pickle convert /home/pierre/myext/

Or run it from the extension source directory.

Contributing

Fork the project, create a feature branch and send us a pull request.

To ensure a consistent code base, you should make sure the code follows the PSR-1 and PSR-2 coding standards.

To check CS issues, you can use the cs-check composer command:

$ composer run cs-check

To automatically fix CS issues, you can use the cs-fix composer command:

$ composer run cs-fix

Support

Support is available via the issue tracker in the Github project page or via IRC, EFNet, channel #pickle.

Running tests

You should run the tests by setting the PICKLE_PECL_TESTSERVER environment variable to yes (or true or 1). This implies that test are executed using a well-defined environment instead of using a live web server.

# On Unix-like systems
export PICKLE_PECL_TESTSERVER=yes
# On Windows systems
set PICKLE_PECL_TESTSERVER=yes

Unit tests are written using atoum. You will get atoum, among other dependencies, when running composer install. To run tests, you will need to run the following command:

$ vendor/bin/atoum

# To run tests in a loop, ideal to do TDD
$ vendor/bin/atoum --loop

There are also some Behat tests. You will get Behat, among other dependencies, when running composer install. To run tests, you will need to run the following command:

$ vendor/bin/behat

# To choose the test suite you want to run
$ vendor/bin/behat -s pickle

Behat tests also test the phar, generate it prior to run the full test as described here (composer install --no-dev mode).

Pickle is covered using 4 Behat tests suites:

  • pickle runs tests against pickle's sources
  • pickle_phar runs tests against pickle's Phar which you have to manually build
  • pecl tests PECL extensions conversion with pickle's sources
  • phar_pecl tests PECL extensions conversion with pickle's Phar

GitHub

https://github.com/FriendsOfPHP/pickle
Comments
  • 1. Bump composer/composer from 1.10.24 to 1.10.26

    Bumps composer/composer from 1.10.24 to 1.10.26.

    Release notes

    Sourced from composer/composer's releases.

    1.10.26

    • Security: Fixed command injection vulnerability in HgDriver/GitDriver (GHSA-x7cr-6qr6-2hh6 / CVE-2022-24828)

    1.10.25

    • Fixed selfupdate on Windows + PHP 8.1 regression (#10446)
    Changelog

    Sourced from composer/composer's changelog.

    [1.10.26] 2022-04-13

    • Security: Fixed command injection vulnerability in HgDriver/GitDriver (GHSA-x7cr-6qr6-2hh6 / CVE-2022-24828)

    [1.10.25] 2022-01-21

    • Fixed selfupdate on Windows + PHP 8.1 regression (#10446)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Reviewed by dependabot[bot] at 2022-04-22 21:29
  • 2. Install version by GH branch

    For development, I need other version than the tagged ones.

    The doc does not mention this usecase - https://github.com/FriendsOfPHP/pickle#usage

    This issue is a question. Does pickle support is, eg. does it know which GH repo to use and how to specify the wanted git branch as a version?

    Reviewed by mvorisek at 2022-03-15 06:54
  • 3. window install failed

    PS C:\Users\mt\Downloads> php .\pickle.phar install redis
    +---------------+---------------------------------------------------------------+
    | php Path      | C:\Users\mt\soft\install\php-8.1.1-nts-Win32-vs16-x64\php.exe |
    | php Version   | 8.1.1                                                         |
    | Compiler      | vs16                                                          |
    | Architecture  | x64                                                           |
    | Thread safety | no                                                            |
    | Extension dir | C:\Users\mt\soft\install\php-8.1.1-nts-Win32-vs16-x64\ext     |
    | php.ini       | C:\Users\mt\soft\install\php-8.1.1-nts-Win32-vs16-x64\php.ini |
    +---------------+---------------------------------------------------------------+
    PHP Fatal error:  Uncaught Error: Call to undefined method Pickle\Package\PHP\Command\Install\Windows\Binary::setInput() in phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php:143
    Stack trace:
    #0 phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php(211): Pickle\Console\Command\InstallerCommand->binaryInstallWindows('redis', Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #1 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Command/Command.php(298): Pickle\Console\Command\InstallerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #2 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(1005): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #3 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Pickle\Console\Command\InstallerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #4 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))#5 phar://C:/Users/mt/Downloads/pickle.phar/bin/pickle(38): Symfony\Component\Console\Application->run()
    #6 C:\Users\mt\Downloads\pickle.phar(10): require('phar://C:/Users...')
    #7 {main}
      thrown in phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php on line 143
    
    Fatal error: Uncaught Error: Call to undefined method Pickle\Package\PHP\Command\Install\Windows\Binary::setInput() in phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php:143
    Stack trace:
    #0 phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php(211): Pickle\Console\Command\InstallerCommand->binaryInstallWindows('redis', Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #1 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Command/Command.php(298): Pickle\Console\Command\InstallerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #2 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(1005): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #3 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Pickle\Console\Command\InstallerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #4 phar://C:/Users/mt/Downloads/pickle.phar/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))#5 phar://C:/Users/mt/Downloads/pickle.phar/bin/pickle(38): Symfony\Component\Console\Application->run()
    #6 C:\Users\mt\Downloads\pickle.phar(10): require('phar://C:/Users...')
    #7 {main}
      thrown in phar://C:/Users/mt/Downloads/pickle.phar/src/Console/Command/InstallerCommand.php on line 143
    
    Reviewed by miaotiao at 2022-01-07 15:46
  • 4. Pickle picks RC instead of latest stable

    $ pickle install --defaults redis
      - Installing redis (latest-stable): Downloading (100%)
    +-----------------------------------+----------+
    | Package name                      | redis    |
    | Package version (current release) | 5.3.5RC1 |
    | Package status                    | RC       |
    +-----------------------------------+----------
    

    Why does it install RC version (tagged as beta on pecl) instead of the latest real stable?

    Reviewed by ruudk at 2021-11-18 06:18
  • 5. Unable to install openswoole in alpine (docker)

    Error:

    Couldn't parse or find the version defined in the (?:PHP_)?OPENSWOOLE_(?:EXT_)?VERSION macro

    installation of pickle worked:

    bash-5.1# wget https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar
    --2021-11-01 18:23:13--  https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar
    Resolving github.com (github.com)... 140.82.121.3
    Connecting to github.com (github.com)|140.82.121.3|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github.com/FriendsOfPHP/pickle/releases/download/v0.7.7/pickle.phar [following]
    --2021-11-01 18:23:13--  https://github.com/FriendsOfPHP/pickle/releases/download/v0.7.7/pickle.phar
    Reusing existing connection to github.com:443.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github-releases.githubusercontent.com/20719020/bcc4d118-6e68-4271-a245-567d8d6b9736?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20211101%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20211101T182313Z&X-Amz-Expires=300&X-Amz-Signature=2f3e583c0e3b7ace1e45693855a63fcc2da7be4f4a94d13e04bf2fe6e083d0bb&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=20719020&response-content-disposition=attachment%3B%20filename%3Dpickle.phar&response-content-type=application%2Foctet-stream [following]
    

    then I run:

    mv pickle.phar /usr/local/bin/pickle
    chmod +x /usr/local/bin/pickle
    

    pickle --version reports:

    bash-5.1# pickle --version
    
     ██████╗ ██╗ ██████╗██╗  ██╗██╗     ███████╗
     ██╔══██╗██║██╔════╝██║ ██╔╝██║     ██╔════╝
     ██████╔╝██║██║     █████╔╝ ██║     █████╗
     ██╔═══╝ ██║██║     ██╔═██╗ ██║     ██╔══╝
     ██║     ██║╚██████╗██║  ██╗███████╗███████╗
     ╚═╝     ╚═╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚══════╝  v0.7.7
    

    but this is the error I get when I try to install openswoole

    bash-5.1# pickle install openswoole
      - Installing openswoole (latest-stable): Downloading (100%)         
    
    In Version.php line 81:
                                                                                                    
      Couldn't parse or find the version defined in the (?:PHP_)?OPENSWOOLE_(?:EXT_)?VERSION macro  
                                                                                                    
    
    install [--no-convert] [--defaults] [--source] [--with-configure-options WITH-CONFIGURE-OPTIONS] [--save-logs SAVE-LOGS] [--dry-run] [--php PHP] [--ini INI] [--tmp-dir TMP-DIR] [--version-override [VERSION-OVERRIDE]] [--] [<path>]
    
    Reviewed by FLasH3r at 2021-11-01 18:29
Related tags
PHP Extension installer

pickle - PHP Extension installer Pickle installs PHP extensions easily on all platforms. Installation Grab the latest phar at https://github.com/Frien

May 11, 2022
Universal extension installer for Magento 2, see introductory blog post here
Universal extension installer for Magento 2, see introductory blog post here

ExtDN Installer for Magento 2 modules The installation of extensions for Magento 2 has a few scenarios to cover depending on your starting position (M

Apr 1, 2022
This is wegare tools but all-in-one installer only, exclude GUI

All In One Installer for Wegare Tools This is wegare tools, but this is all-in-one. Here is the source https://github.com/wegare123?tab=repositories I

Dec 12, 2021
OSX/Linux Docker containers installer for Magento 2

Magento 2 OSX/Linux Docker Requirements MacOS: Docker, docker-sync, Git Linux: Docker, Docker-compose, Git on Debian based OS (Example: Ubuntu, Linux

May 7, 2022
An installer package that let's you install NodeJS and NPM as a Composer dependency.

NodeJS installer for Composer This is an installer that will download NodeJS and NPM and install them in your Composer dependencies. Installation is s

Apr 2, 2022
Composer installer for PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

May 24, 2022
pine - A CLI installer for timber
pine - A CLI installer for timber

pine - A CLI installer for timber A CLI tool written in PHP based on symfony console to easily create a WordPress (Timber) project. Installation compo

Sep 6, 2021
This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

Feb 25, 2022
Magento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items.
Magento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items.

Clean Admin Menu - Magento 2 Extension It will merge all 3rd party extension's menu items in backend's primary menu to a common menu item named "Exten

May 2, 2022
Magento 2 Blog Extension is a better blog extension for Magento 2 platform. These include all useful features of Wordpress CMS
Magento 2 Blog Extension is a better blog extension for Magento 2 platform. These include all useful features of Wordpress CMS

Magento 2 Blog extension FREE Magento 2 Better Blog by Mageplaza is integrated right into the Magento backend so you can manage your blog and your e-c

May 15, 2022
Generate stubs for any PHP extension.

php-ext-stubs-generator Installation Run $ composer require --dev lctrs/php-ext-stubs-generator Usage $ php vendor/bin/generate-stubs-for-ext extensio

May 2, 2022
PHP extension for V8 JavaScript engine

php-v8 PHP extension for V8 JavaScript engine This extension requires PHP >= 7.2. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1

May 19, 2022
Easily install PHP extension in Docker containers

Easy installation of PHP extensions in official PHP Docker images This repository contains a script that can be used to easily install a PHP extension

May 24, 2022
A PHP API extension the 'An API of Ice and Fire'

This documentation is meant to enable you to consume our API and get you started right away using your favourite programming language. All endpoints and HTTP methods to be used have been detailed with a sample example for e

Mar 26, 2022
JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

Apr 15, 2022
PHPStan extension to support #[Readonly] constructor properties

icanhazstring/phpstan-readonly-property Support #[Readonly] promoted constructor properties for PHPStan. This library is used to have a full transitio

Apr 5, 2022
Okex API Like the official document interface, Support for arbitrary extension.

It is recommended that you read the official document first Okex docs https://www.okex.com/docs/en Okex Simulation Test API https://www.okex.com/docs/

May 1, 2022
Magento specific extension for phpstan

bitexpert/phpstan-magento This package provides some additional features for PHPStan to make it work for Magento 2 projects. Installation The preferre

May 11, 2022
This Magento 2 extension integrates EasyTranslate into Magento 2.
This Magento 2 extension integrates EasyTranslate into Magento 2.

EasyTranslate Magento 2 Connector This Magento 2 extension integrates EasyTranslate into Magento 2. Mind that you need to have an account with EasyTra

Dec 21, 2021