-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the php-alpm wiki!
This extension lets you drive Arch Linux's libalpm (the library behind
pacman) from PHP: read pacman databases, inspect packages, and (carefully)
run install/remove/upgrade transactions.
php-alpm is still 0.x. There is no backwards-compatibility guarantee
until 1.0. AlpmTransaction in particular is the least battle-tested part
of the extension — if you only need to read information out of a pacman
database (AlpmHandle, AlpmDb, AlpmPkg), you should hit very few
problems.
- PHP >= 8.2
- libalpm >= 16.0 (pacman >= 7.1)
Get the code:
$ git clone https://github.com/markzz/php-alpm.git
$ cd php-alpmIf you're not on Arch Linux, you'll need to build and install pacman
(which provides libalpm) first. install_pacman.sh in the repo root is
what CI uses to do this on Ubuntu and is the best up-to-date reference for
build dependencies; run it with a pacman git ref to build:
$ ./install_pacman.sh v7.1.0Then build the extension the normal PHP extension way:
$ phpize
$ ./configure --enable-alpm
$ make
# make installThis gets you alpm.so in your PHP modules folder. Add
extension=alpm.so to your php.ini to enable it.
- Classes — overview of every class the extension provides
- Functions — the handful of top-level functions
-
Constants —
ALPM_*constants used for siglevels, flags, etc.
If you're new to this, start with AlpmHandle — it's the object you create first and the one everything else hangs off of.
Read CONTRIBUTING.md in the repo for the C coding style before sending
patches. Sign off your commits (git commit -s) if you can. Fork on
GitHub and open a pull request, or send git-formatted patches to
mark.king@markzz.com — whichever's easier for you.
Stub definitions for IDE autocompletion live in stubs/alpm.php in the
repo and are kept in sync with the extension on every release; they're a
good quick-reference alongside this wiki.