Skip to content

Commit

Permalink
feature: Swoole扩展默认关闭use_shortname
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqizjl committed Nov 4, 2022
1 parent 441a939 commit 61c2fb5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ function install_curl(Preprocessor $p)
'mongodb' => function ($p) {
$p->addExtension((new Extension('mongodb'))
->withOptions('--enable-mongodb --with-mongodb-sasl=no')
->withPeclVersion('1.14.1'));
->withPeclVersion('1.14.2'));
}
];

Expand All @@ -504,12 +504,12 @@ function install_curl(Preprocessor $p)

if ($type != "windows"){
$extEnabled[] = "mongodb";
$endCallback[] = function ($p) {
echo `curl https://raw.githubusercontent.com/mongodb/mongo-c-driver/master/src/libbson/src/bson/bson-cmp.h > ext/mongodb/src/libmongoc/src/libbson/src/bson/bson-cmp.h`;
echo `cat ext/mongodb/src/libmongoc/src/libbson/src/bson/bson-cmp.h`;
};
}

$endCallback[] = function($p) {
// Swoole Patch
echo `patch -p0 < ./sapi/swoole.patch`;
};

for ($i = 1; $i < $argc; $i++) {
$op = $argv[$i][0];
Expand Down
11 changes: 11 additions & 0 deletions sapi/swoole.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ext/swoole/ext-src/php_swoole.cc.original 2022-11-04 22:52:10
+++ ext/swoole/ext-src/php_swoole.cc 2022-11-04 22:52:44
@@ -302,7 +302,7 @@
/**
* use short class name
*/
-STD_ZEND_INI_BOOLEAN("swoole.use_shortname", "On", PHP_INI_SYSTEM, OnUpdateBool, use_shortname, zend_swoole_globals, swoole_globals)
+STD_ZEND_INI_BOOLEAN("swoole.use_shortname", "Off", PHP_INI_SYSTEM, OnUpdateBool, use_shortname, zend_swoole_globals, swoole_globals)
/**
* unix socket buffer size
*/

0 comments on commit 61c2fb5

Please sign in to comment.