php's phar extension,PHP Extension installer

pickle - PHP Extension installer 68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37653135336430342d373962652d343765362d623265652d3630636463323636356464352f736d616c6c2e706e67

Pickle installs PHP extensions easily on all platforms.

68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f467269656e64734f665048502f7069636b6c652e737667

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f467269656e64734f665048502f7069636b6c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f467269656e64734f665048502f7069636b6c652f6261646765732f636f7665726167652e706e673f623d6d6173746572

68747470733a2f2f7472617669732d63692e6f72672f467269656e64734f665048502f7069636b6c652e7376673f6272616e63683d6d6173746572

Installation

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 avoid CS issues, you should use php-cs-fixer:

$ php-cs-fixer fix src/

Support

Support is available via the issue

tracker in the Github project page

or via IRC, EFNet, channel #pickle.

Running tests

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值