Skip to content

Commit f44048e

Browse files
Additional Extension Support
1 parent f94d69d commit f44048e

File tree

8 files changed

+217
-12
lines changed

8 files changed

+217
-12
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ sudo yerd php 8.3 extensions remove gd
131131
sudo yerd php 8.3 extensions add gd --rebuild
132132
```
133133

134-
**Available Extensions**: mbstring, bcmath, opcache, curl, openssl, zip, sockets, mysqli, pdo-mysql, gd, jpeg, freetype, xml, json, session, hash, filter, pcre, zlib, bz2, iconv, intl, pgsql, pdo-pgsql, sqlite3, pdo-sqlite, fileinfo, exif, gettext, gmp, ldap, soap, ftp, pcntl
134+
**Available Extensions**: mbstring, bcmath, opcache, curl, openssl, zip, sockets, mysqli, pdo-mysql, gd, jpeg, freetype, xml, json, session, hash, filter, pcre, zlib, bz2, iconv, intl, pgsql, pdo-pgsql, sqlite3, pdo-sqlite, fileinfo, exif, gettext, gmp, ldap, soap, ftp, pcntl, imap, imagick, redis
135135

136136
#### Maintenance Operations
137137

@@ -152,6 +152,27 @@ sudo yerd php 8.2 uninstall
152152
sudo yerd php 8.2 uninstall --yes
153153
```
154154

155+
Note, the imap extension may require special handling, you will be informed of the actions required when you attempt to add the extension, for example:
156+
157+
```bash
158+
⚠️ SPECIAL INSTALLATION REQUIREMENTS:
159+
─────────────────────────────────────
160+
161+
📦 Extension 'imap' (dependency: imap):
162+
Run: yay -S c-client (requires AUR helper)
163+
164+
─────────────────────────────────────
165+
ℹ️ Please install these dependencies before rebuilding PHP
166+
167+
These extensions will be added to PHP 8.3 on the next rebuild
168+
imap imagick
169+
170+
ℹ️ These changes won't apply until PHP is rebuilt
171+
ℹ️ PHP can be rebuilt with the following command:
172+
173+
sudo yerd php 8.3 rebuild
174+
```
175+
155176
### Composer Management
156177
157178
```bash
@@ -173,6 +194,9 @@ sudo yerd web install
173194
174195
# Remove web components
175196
sudo yerd web uninstall
197+
198+
# If you are having problems with Chrome trusting SSL certificates
199+
sudo yerd web trust
176200
```
177201
178202
### Site Management

install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,8 @@ main() {
327327
echo
328328
echo "Next steps:"
329329
echo "1. Run: yerd --help"
330-
echo "2. Check system status: yerd status"
331-
echo "3. List PHP versions: yerd php list"
332-
echo "4. Install PHP: sudo yerd php add 8.4"
330+
echo "2. List PHP versions: yerd php list"
331+
echo "3. Install PHP: sudo yerd php 8.4 install"
333332
echo
334333
}
335334

internal/constants/dependencies.go

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ var PackageManagerConfigs = map[string]PackageManagerConfig{
8888

8989
// DependencyConfig represents all configuration for a single dependency
9090
type DependencyConfig struct {
91-
Name string
92-
SystemPackages map[string][]string
93-
PkgConfigNames map[string][]string
94-
CommonPkgConfig []string
95-
Commands []string
96-
Libraries []string
91+
Name string
92+
SystemPackages map[string][]string
93+
PkgConfigNames map[string][]string
94+
CommonPkgConfig []string
95+
Commands []string
96+
Libraries []string
97+
RequiresSpecialHandling map[string]bool
98+
InstallNotes map[string]string
9799
}
98100

99101
// DependencyRegistry is the single source of truth for all dependency configurations
@@ -429,6 +431,47 @@ var DependencyRegistry = map[string]*DependencyConfig{
429431
},
430432
Commands: []string{"wget", "tar"},
431433
},
434+
"imagick": {
435+
Name: "imagick",
436+
SystemPackages: map[string][]string{
437+
APT: {"libmagickwand-dev", "imagemagick"},
438+
YUM: {"ImageMagick-devel"},
439+
DNF: {"ImageMagick-devel"},
440+
PACMAN: {"imagemagick"},
441+
ZYPPER: {"ImageMagick-devel"},
442+
APKL: {"imagemagick-dev"},
443+
},
444+
CommonPkgConfig: []string{"MagickWand", "ImageMagick"},
445+
},
446+
"imap": {
447+
Name: "imap",
448+
SystemPackages: map[string][]string{
449+
APT: {"libc-client-dev", "libkrb5-dev"},
450+
YUM: {"libc-client-devel", "krb5-devel"},
451+
},
452+
RequiresSpecialHandling: map[string]bool{
453+
DNF: true,
454+
PACMAN: true,
455+
APKL: true,
456+
},
457+
InstallNotes: map[string]string{
458+
DNF: "Run: sudo dnf install epel-release && sudo dnf install libc-client-devel",
459+
PACMAN: "Run: yay -S c-client (requires AUR helper)",
460+
APKL: "Run: apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ c-client-dev",
461+
},
462+
},
463+
"pecl": {
464+
Name: "pecl",
465+
SystemPackages: map[string][]string{
466+
APT: {"php-pear", "php-dev"}, // Debian/Ubuntu
467+
YUM: {"php-pear", "php-devel"}, // CentOS/RHEL 7
468+
DNF: {"php-pear", "php-devel"}, // RHEL 8+/Fedora
469+
PACMAN: {"php", "autoconf", "make", "gcc"}, // Arch (PECL comes with php)
470+
ZYPPER: {"php-pear", "php-devel"}, // openSUSE
471+
APKL: {"php-pear", "php-dev"}, // Alpine
472+
},
473+
Commands: []string{"pecl"},
474+
},
432475
}
433476

434477
// GetDependencyConfig returns the dependency configuration for a given name

internal/constants/php.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,164 +11,220 @@ type Extension struct {
1111
Name string
1212
ConfigFlag string
1313
Dependencies []string
14+
IsPECL bool
15+
PECLName string
1416
}
1517

1618
var availablePhpVersions = []string{"8.1", "8.2", "8.3", "8.4"}
1719
var availableExtensions = map[string]Extension{
1820
"mbstring": {
1921
Name: "mbstring",
2022
ConfigFlag: "--enable-mbstring",
23+
IsPECL: false,
2124
},
2225
"bcmath": {
2326
Name: "bcmath",
2427
ConfigFlag: "--enable-bcmath",
28+
IsPECL: false,
2529
},
2630
"opcache": {
2731
Name: "opcache",
2832
ConfigFlag: "--enable-opcache",
33+
IsPECL: false,
2934
},
3035
"curl": {
3136
Name: "curl",
3237
ConfigFlag: "--with-curl",
3338
Dependencies: []string{"libcurl"},
39+
IsPECL: false,
3440
},
3541
"openssl": {
3642
Name: "openssl",
3743
ConfigFlag: "--with-openssl",
3844
Dependencies: []string{"openssl"},
45+
IsPECL: false,
3946
},
4047
"zip": {
4148
Name: "zip",
4249
ConfigFlag: "--with-zip",
4350
Dependencies: []string{"libzip"},
51+
IsPECL: false,
4452
},
4553
"sockets": {
4654
Name: "sockets",
4755
ConfigFlag: "--enable-sockets",
56+
IsPECL: false,
4857
},
4958
"mysqli": {
5059
Name: "mysqli",
5160
ConfigFlag: "--with-mysqli",
5261
Dependencies: []string{"mysql"},
62+
IsPECL: false,
5363
},
5464
"pdo-mysql": {
5565
Name: "pdo-mysql",
5666
ConfigFlag: "--with-pdo-mysql",
5767
Dependencies: []string{"mysql"},
68+
IsPECL: false,
5869
},
5970
"gd": {
6071
Name: "gd",
6172
ConfigFlag: "--enable-gd",
6273
Dependencies: []string{"libgd"},
74+
IsPECL: false,
6375
},
6476
"jpeg": {
6577
Name: "jpeg",
6678
ConfigFlag: "--with-jpeg",
6779
Dependencies: []string{"libjpeg"},
80+
IsPECL: false,
6881
},
6982
"freetype": {
7083
Name: "freetype",
7184
ConfigFlag: "--with-freetype",
7285
Dependencies: []string{"freetype2"},
86+
IsPECL: false,
7387
},
7488
"xml": {
7589
Name: "xml",
7690
ConfigFlag: "--enable-xml",
91+
IsPECL: false,
7792
},
7893
"json": {
7994
Name: "json",
8095
ConfigFlag: "--enable-json",
96+
IsPECL: false,
8197
},
8298
"session": {
8399
Name: "session",
84100
ConfigFlag: "--enable-session",
101+
IsPECL: false,
85102
},
86103
"hash": {
87104
Name: "hash",
88105
ConfigFlag: "--enable-hash",
106+
IsPECL: false,
89107
},
90108
"filter": {
91109
Name: "filter",
92110
ConfigFlag: "--enable-filter",
111+
IsPECL: false,
93112
},
94113
"pcre": {
95114
Name: "pcre",
96115
ConfigFlag: "--with-pcre-jit",
97116
Dependencies: []string{"pcre2"},
117+
IsPECL: false,
98118
},
99119
"zlib": {
100120
Name: "zlib",
101121
ConfigFlag: "--with-zlib",
102122
Dependencies: []string{"zlib"},
123+
IsPECL: false,
103124
},
104125
"bz2": {
105126
Name: "bz2",
106127
ConfigFlag: "--with-bz2",
107128
Dependencies: []string{"bzip2"},
129+
IsPECL: false,
108130
},
109131
"iconv": {
110132
Name: "iconv",
111133
ConfigFlag: "--with-iconv",
134+
IsPECL: false,
112135
},
113136
"intl": {
114137
Name: "intl",
115138
ConfigFlag: "--enable-intl",
116139
Dependencies: []string{"icu"},
140+
IsPECL: false,
117141
},
118142
"pgsql": {
119143
Name: "pgsql",
120144
ConfigFlag: "--with-pgsql",
121145
Dependencies: []string{"postgresql"},
146+
IsPECL: false,
122147
},
123148
"pdo-pgsql": {
124149
Name: "pdo-pgsql",
125150
ConfigFlag: "--with-pdo-pgsql",
126151
Dependencies: []string{"postgresql"},
152+
IsPECL: false,
127153
},
128154
"sqlite3": {
129155
Name: "sqlite3",
130156
ConfigFlag: "--with-sqlite3",
131157
Dependencies: []string{"sqlite"},
158+
IsPECL: false,
132159
},
133160
"pdo-sqlite": {
134161
Name: "pdo-sqlite",
135162
ConfigFlag: "--with-pdo-sqlite",
136163
Dependencies: []string{"sqlite"},
164+
IsPECL: false,
137165
},
138166
"fileinfo": {
139167
Name: "fileinfo",
140168
ConfigFlag: "--enable-fileinfo",
169+
IsPECL: false,
141170
},
142171
"exif": {
143172
Name: "exif",
144173
ConfigFlag: "--enable-exif",
174+
IsPECL: false,
145175
},
146176
"gettext": {
147177
Name: "gettext",
148178
ConfigFlag: "--with-gettext",
149179
Dependencies: []string{"gettext"},
180+
IsPECL: false,
150181
},
151182
"gmp": {
152183
Name: "gmp",
153184
ConfigFlag: "--with-gmp",
154185
Dependencies: []string{"gmp"},
186+
IsPECL: false,
155187
},
156188
"ldap": {
157189
Name: "ldap",
158190
ConfigFlag: "--with-ldap",
159191
Dependencies: []string{"ldap"},
192+
IsPECL: false,
160193
},
161194
"soap": {
162195
Name: "soap",
163196
ConfigFlag: "--enable-soap",
197+
IsPECL: false,
164198
},
165199
"ftp": {
166200
Name: "ftp",
167201
ConfigFlag: "--enable-ftp",
202+
IsPECL: false,
168203
},
169204
"pcntl": {
170205
Name: "pcntl",
171206
ConfigFlag: "--enable-pcntl",
207+
IsPECL: false,
208+
},
209+
"imagick": {
210+
Name: "imagick",
211+
ConfigFlag: "",
212+
Dependencies: []string{"imagick"},
213+
IsPECL: true,
214+
PECLName: "imagick",
215+
},
216+
"imap": {
217+
Name: "imap",
218+
ConfigFlag: "--with-imap",
219+
Dependencies: []string{"imap"},
220+
IsPECL: false,
221+
},
222+
"redis": {
223+
Name: "redis",
224+
ConfigFlag: "",
225+
Dependencies: []string{},
226+
IsPECL: true,
227+
PECLName: "redis",
172228
},
173229
}
174230
var defaultExtensions = []string{

0 commit comments

Comments
 (0)