notpecl

command module
v0.0.0-...-f459114 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 2 Imported by: 0

README

notpecl

notpecl is a little CLI tool to replace the deprecated pecl tool.

Why?

The version versions of the official Docker image for PHP 7.4 did not include pecl as this tool has been deprecated. However, as there were no working replacement at this time, Docker maintainers decided to include pecl in 7.4 images. See this issue.

Moreover, as I needed an easy way to resolve version constraints on PHP community extensions from a Go tool, zbuild, the best seemed to build my own tool.

Usage

  • install: Download and build an extension locally. This is the one you probably want to use ;
  • download: Download and unpack extension archives (tgz with a package.xml) ;
  • build: Build an extension from its source code ;

Like pecl, this tool has an interactive UI for config questions and also supports running in noninteractive mode.

This tool supports version constraints expressed like Composer:

# This is going to install the last v5.1 patch version.
$ notpecl install redis:~5.1.0

Moreover, notpecl only resolve versions with stable stability by default. You can override that by appending ̀@<minimum-stability> to any version constraint:

# This is going to install yaml v2.0.0RC8
$ notpecl install yaml:2.0.0RC8@beta
# This is going to install the last patch version the v0.2 branch of uv extension
$ notpecl install uv:~0.2.0@beta

For more details about version constraints, see the versions page from Composer documentation.

For reference, here's the complete list of stability supported by notpecl, in descending order:

  • stable
  • beta
  • alpha
  • devel
  • snapshot

Install

You can either download notpecl or compile it by yourself:

1a. Download it
wget -O /usr/local/sbin/notpecl https://storage.googleapis.com/notpecl/notpecl
chmod +x /usr/local/sbin/notpecl
1b. Within a Dockerfile
FROM php:7.4-fpm-buster

RUN curl -f -o /usr/local/sbin/notpecl https://storage.googleapis.com/notpecl/notpecl && \
    chmod +x /usr/local/sbin/notpecl && \
    notpecl install redis:5.1.1 && \
    docker-php-ext-enable redis && \
    rm -rf /usr/local/sbin/notpecl
2. Build from sources

You have to build it by yourself but a proper release will come soon:

go get github.com/NiR-/notpecl
go install github.com/NiR-/notpecl

Credits

Original idea by Albin Kerouanton, supported by KNPLabs

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
peclapi package implements a HTTP-based client for the REST API initially used by pecl.
peclapi package implements a HTTP-based client for the REST API initially used by pecl.
Package pecltest is a generated GoMock package.
Package pecltest is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL