File tree Expand file tree Collapse file tree 4 files changed +72
-10
lines changed Expand file tree Collapse file tree 4 files changed +72
-10
lines changed Original file line number Diff line number Diff line change 163
163
" onig"
164
164
]
165
165
},
166
+ "memcache" : {
167
+ "type" : " external" ,
168
+ "source" : " ext-memcache" ,
169
+ "arg-type" : " custom" ,
170
+ "lib-depends" : [
171
+ " zlib"
172
+ ],
173
+ "ext-depends" : [
174
+ " session"
175
+ ]
176
+ },
166
177
"mongodb" : {
167
178
"type" : " external" ,
168
179
"source" : " mongodb" ,
220
231
" postgresql"
221
232
]
222
233
},
223
- "pgsql" : {
224
- "type" : " builtin" ,
225
- "arg-type" : " with-prefix" ,
226
- "lib-depends" : [
227
- " postgresql"
228
- ]
229
- },
230
234
"pdo_sqlite" : {
231
235
"type" : " builtin" ,
232
236
"arg-type" : " with" ,
238
242
" sqlite"
239
243
]
240
244
},
245
+ "pgsql" : {
246
+ "type" : " builtin" ,
247
+ "arg-type" : " with-prefix" ,
248
+ "lib-depends" : [
249
+ " postgresql"
250
+ ]
251
+ },
241
252
"phar" : {
242
253
"type" : " builtin" ,
243
254
"ext-depends" : [
Original file line number Diff line number Diff line change 61
61
"path" : " LICENSE"
62
62
}
63
63
},
64
+ "ext-memcache" : {
65
+ "type" : " url" ,
66
+ "url" : " https://pecl.php.net/get/memcache" ,
67
+ "path" : " php-src/ext/memcache" ,
68
+ "filename" : " memcache.tgz" ,
69
+ "license" : {
70
+ "type" : " file" ,
71
+ "path" : " LICENSE"
72
+ }
73
+ },
64
74
"ext-ssh2" : {
65
75
"type" : " url" ,
66
76
"url" : " https://pecl.php.net/get/ssh2" ,
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace SPC \builder \extension ;
6
+
7
+ use SPC \builder \Extension ;
8
+ use SPC \util \CustomExt ;
9
+
10
+ #[CustomExt('memcache ' )]
11
+ class memcache extends Extension
12
+ {
13
+ public function getUnixConfigureArg (): string
14
+ {
15
+ return '--enable-memcache --with-zlib-dir= ' . BUILD_ROOT_PATH ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change @@ -48,9 +48,33 @@ public static function patchPHPBuildconf(BuilderBase $builder): void
48
48
file_put_contents (SOURCE_PATH . '/php-src/ext/curl/config.m4 ' , $ file1 . "\n" . $ files . "\n" . $ file2 );
49
49
}
50
50
51
- // if ($builder->getExt('pdo_sqlite')) {
52
- // FileSystem::replaceFile()
53
- // }
51
+ if ($ builder ->getExt ('memcache ' )) {
52
+ FileSystem::replaceFile (
53
+ SOURCE_PATH . '/php-src/ext/memcache/config9.m4 ' ,
54
+ REPLACE_FILE_STR ,
55
+ 'if test -d $abs_srcdir/src ; then ' ,
56
+ 'if test -d $abs_srcdir/main ; then '
57
+ );
58
+ FileSystem::replaceFile (
59
+ SOURCE_PATH . '/php-src/ext/memcache/config9.m4 ' ,
60
+ REPLACE_FILE_STR ,
61
+ 'export CPPFLAGS="$CPPFLAGS $INCLUDES" ' ,
62
+ 'export CPPFLAGS="$CPPFLAGS $INCLUDES -I$abs_srcdir/main" '
63
+ );
64
+ // add for in-tree building
65
+ file_put_contents (
66
+ SOURCE_PATH . '/php-src/ext/memcache/php_memcache.h ' ,
67
+ <<<'EOF'
68
+ #ifndef PHP_MEMCACHE_H
69
+ #define PHP_MEMCACHE_H
70
+
71
+ extern zend_module_entry memcache_module_entry;
72
+ #define phpext_memcache_ptr &memcache_module_entry
73
+
74
+ #endif
75
+ EOF
76
+ );
77
+ }
54
78
}
55
79
56
80
public static function patchSwow (): bool
You can’t perform that action at this time.
0 commit comments