Skip to content

Commit

Permalink
Improve extension configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Oct 18, 2022
1 parent 15ba6fc commit fc81b5d
Show file tree
Hide file tree
Showing 43 changed files with 477 additions and 173 deletions.
8 changes: 8 additions & 0 deletions conf.d/bcmath.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('bcmath'))->withOptions('--enable-bcmath'));
};
8 changes: 8 additions & 0 deletions conf.d/bz2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('bz2'))->withOptions('--with-bz2=/usr/bzip2'));
};
8 changes: 8 additions & 0 deletions conf.d/ctype.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('ctype'))->withOptions('--enable-ctype'));
};
8 changes: 8 additions & 0 deletions conf.d/curl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('curl'))->withOptions('--with-curl'));
};
8 changes: 8 additions & 0 deletions conf.d/exif.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('exif'))->withOptions('--enable-exif'));
};
8 changes: 8 additions & 0 deletions conf.d/fileinfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('fileinfo'))->withOptions('--enable-fileinfo'));
};
8 changes: 8 additions & 0 deletions conf.d/filter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('filter'))->withOptions('--enable-filter'));
};
10 changes: 10 additions & 0 deletions conf.d/gd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('gd'))
->withOptions('--enable-gd --with-jpeg=/usr --with-freetype=/usr')
);
};
8 changes: 8 additions & 0 deletions conf.d/gmp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('gmp'))->withOptions('--with-gmp=/usr/gmp'));
};
8 changes: 8 additions & 0 deletions conf.d/iconv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('iconv'))->withOptions('--with-iconv=/usr/libiconv'));
};
13 changes: 13 additions & 0 deletions conf.d/imagick.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('imagick'))
->withOptions('--with-imagick=/usr/imagemagick')
->withPeclVersion('3.6.0')
->withHomePage('https://github.com/Imagick/imagick')
->withLicense('https://github.com/Imagick/imagick/blob/master/LICENSE', Extension::LICENSE_PHP)
);
};
10 changes: 10 additions & 0 deletions conf.d/inotify.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('inotify'))
->withOptions('--enable-inotify')
->withPeclVersion('3.0.0'));
};
8 changes: 8 additions & 0 deletions conf.d/intl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('intl'))->withOptions('--enable-intl'));
};
8 changes: 8 additions & 0 deletions conf.d/mbstring.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('mbstring'))->withOptions('--enable-mbstring'));
};
10 changes: 10 additions & 0 deletions conf.d/mongodb.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('mongodb'))
->withOptions('--enable-mongodb')
->withPeclVersion('1.14.0'));
};
8 changes: 8 additions & 0 deletions conf.d/mysqli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('mysqli'))->withOptions('--with-mysqli'));
};
8 changes: 8 additions & 0 deletions conf.d/mysqlnd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('mysqlnd'))->withOptions('--enable-mysqlnd'));
};
8 changes: 8 additions & 0 deletions conf.d/opcache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('opcache'))->withOptions('--enable-opcache'));
};
11 changes: 11 additions & 0 deletions conf.d/openssl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension(
(new Extension('openssl'))
->withOptions('--with-openssl=/usr/openssl --with-openssl-dir=/usr/openssl')
);
};
8 changes: 8 additions & 0 deletions conf.d/pcntl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('pcntl'))->withOptions('--enable-pcntl'));
};
8 changes: 8 additions & 0 deletions conf.d/pdo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('pdo'))->withOptions('--enable-pdo'));
};
8 changes: 8 additions & 0 deletions conf.d/pdo_mysql.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('pdo_mysql'))->withOptions('--with-pdo_mysql'));
};
8 changes: 8 additions & 0 deletions conf.d/pdo_sqlite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('pdo_sqlite'))->withOptions('--with-pdo-sqlite'));
};
8 changes: 8 additions & 0 deletions conf.d/phar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('phar'))->withOptions('--enable-phar'));
};
8 changes: 8 additions & 0 deletions conf.d/posix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('posix'))->withOptions('--enable-posix'));
};
21 changes: 21 additions & 0 deletions conf.d/protobuf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('protobuf'))
->withOptions('--enable-protobuf')
->withPeclVersion('3.21.6')
->withHomePage('https://developers.google.com/protocol-buffers'));

$p->setExtCallback('protobuf', function (Preprocessor $p) {
// compatible with redis
if ($p->osType === 'macos') {
echo `sed -i '.bak' 's/arginfo_void,/arginfo_void_protobuf,/g' ext/protobuf/*.c ext/protobuf/*.h ext/protobuf/*.inc`;
echo `find ext/protobuf/ -name \*.bak | xargs rm -f`;
} else {
echo `sed -i 's/arginfo_void,/arginfo_void_protobuf,/g' ext/protobuf/*.c ext/protobuf/*.h ext/protobuf/*.inc`;
}
});
};
8 changes: 8 additions & 0 deletions conf.d/readline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('readline'))->withOptions('--with-libedit'));
};
13 changes: 13 additions & 0 deletions conf.d/redis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('redis'))
->withOptions('--enable-redis')
->withPeclVersion('5.3.5')
->withHomePage('https://github.com/phpredis/phpredis')
->withLicense('https://github.com/phpredis/phpredis/blob/develop/COPYING', Extension::LICENSE_PHP)
);
};
8 changes: 8 additions & 0 deletions conf.d/session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('session'))->withOptions('--enable-session'));
};
8 changes: 8 additions & 0 deletions conf.d/soap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('soap'))->withOptions('--enable-soap'));
};
8 changes: 8 additions & 0 deletions conf.d/sockets.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('sockets'))->withOptions('--enable-sockets'));
};
8 changes: 8 additions & 0 deletions conf.d/sodium.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('sodium'))->withOptions('--with-sodium'));
};
8 changes: 8 additions & 0 deletions conf.d/sqlite3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('sqlite3'))->withOptions('--with-sqlite3'));
};
12 changes: 12 additions & 0 deletions conf.d/swoole.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('swoole'))
->withOptions('--enable-swoole --enable-sockets --enable-mysqlnd --enable-swoole-curl --enable-cares --disable-brotli')
->withLicense('https://github.com/swoole/swoole-src/blob/master/LICENSE', Extension::LICENSE_APACHE2)
->withHomePage('https://github.com/swoole/swoole-src')
);
};
10 changes: 10 additions & 0 deletions conf.d/swoole_loader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('swoole_loader'))
->withOptions('--disable-data_encrypt')
);
};
8 changes: 8 additions & 0 deletions conf.d/tokenizer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('tokenizer'))->withOptions('--enable-tokenizer'));
};
10 changes: 10 additions & 0 deletions conf.d/xml.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('xml'))
->withOptions('--enable-xml --enable-simplexml --enable-xmlreader --enable-xmlwriter --enable-dom --with-libxml')
);
};
8 changes: 8 additions & 0 deletions conf.d/xsl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('xsl'))->withOptions('--with-xsl'));
};
13 changes: 13 additions & 0 deletions conf.d/yaml.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use SwooleCli\Preprocessor;
use SwooleCli\Extension;

return function (Preprocessor $p) {
$p->addExtension((new Extension('yaml'))
->withOptions('--with-yaml=/usr/libyaml')
->withPeclVersion('2.2.2')
->withHomePage('https://github.com/php/pecl-file_formats-yaml')
->withLicense('https://github.com/php/pecl-file_formats-yaml/blob/php7/LICENSE', Extension::LICENSE_MIT)
);
};
Loading

0 comments on commit fc81b5d

Please sign in to comment.