Replies: 8 comments 9 replies
-
bin/setup-runtime
composer install
bin/spc download php-src,zlib,ext-fricc2,pkg-config,micro --debug
bin/spc build fricc2 --build-cli --debug
downloader need fricc2Patch |
Beta Was this translation helpful? Give feedback.
-
@jingjingxyk thanks for your reply, but can it be used with micro sapi ? What I want is to encrypt the PHP files in the PHAR file ? |
Beta Was this translation helpful? Give feedback.
-
I now tried to manually made the changes of your commit and rebuild the SPC phar. ./spc download --with-php=8.1 --for-extensions "ctype,curl,dom,fileinfo,filter,ftp,gd,igbinary,inotify,libxml,mbstring,memcache,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,shmop,simplexml,sockets,sodium,spx,sqlite3,ssh2,swoole,swoole-hook-mysql,swoole-hook-pgsql,swoole-hook-sqlite,sysvmsg,sysvsem,sysvshm,uuid,xml,xmlreader,zip,zlib,zstd,fricc2,nodeid,sapihelper" --prefer-pre-built -G "swoole:master:https://github.com/swoole/swoole-src.git"
In DependencyUtil.php line 169:
Extension [fricc2] not exist ! I think there is an incosistency between 'fricc2' and 'fricc2load' ? If I use fricc2load in the build command: ./spc build --build-micro "ctype,curl,dom,fileinfo,filter,ftp,gd,igbinary,inotify,libxml,mbstring,memcache,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pgsql,phar,posix,readline,redis,shmop,simplexml,sockets,sodium,spx,sqlite3,ssh2,swoole,swoole-hook-mysql,swoole-hook-pgsql,swoole-hook-sqlite,sysvmsg,sysvsem,sysvshm,uuid,xml,xmlreader,zip,zlib,zstd,fricc2load" --with-upx-pack -I "foo=bar" -I "baz=boo" -P patcher.php --debug I get this error: [13:26:42] [DEBU] Executed at: phar:///tmp/spc/src/SPC/builder/unix/UnixBuilderBase.php:164
[13:26:42] [ERRO] Uncaught SPC\exception\RuntimeException: micro failed sanity check: micro_ext_test, condition [0], ret[255], out[[micro-test-start]Running micro with ctype testRunning micro with curl testRunning micro with dom testRunning micro with fileinfo testRunning micro with filter testRunning micro with ftp testRunning micro with zlib testRunning micro with gd testRunning micro with session testRunning micro with igbinary testRunning micro with inotify testRunning micro with xml testRunning micro with libxml testRunning micro with mbstring testRunning micro with memcache testRunning micro with msgpack testRunning micro with mysqlnd testRunning micro with mysqli testRunning micro with Zend Opcache testRunning micro with openssl testRunning micro with pcntl testRunning micro with pdo testRunning micro with pgsql testRunning micro with phar testRunning micro with posix testRunning micro with readline testRunning micro with redis testRunning micro with shmop testRunning micro with simplexml testRunning micro with sockets testRunning micro with sodium testRunning micro with spx testRunning micro with sqlite3 testRunning micro with ssh2 testRunning micro with swoole testRunning micro with pdo_mysql testRunning micro with swoole testRunning micro with swoole testRunning micro with swoole testRunning micro with sysvmsg testRunning micro with sysvsem testRunning micro with sysvshm testRunning micro with uuid testRunning micro with xmlreader testRunning micro with zip testRunning micro with zstd testRunning micro with fricc2load testFatal error: Uncaught AssertionError: assert(extension_loaded('fricc2load')) in /tmp/source/micro_ext_test.exe:143Stack trace:#0 /tmp/source/micro_ext_test.exe(143): assert(false, 'assert(extensio...')#1 {main} thrown in /tmp/source/micro_ext_test.exe on line 143] at phar:///tmp/spc/src/SPC/builder/unix/UnixBuilderBase.php(168)
[13:26:42] [ERRO] #0 phar:///tmp/spc/src/SPC/builder/linux/LinuxBuilder.php(201): SPC\builder\unix\UnixBuilderBase->sanityCheck()
#1 phar:///tmp/spc/src/SPC/command/BuildCliCommand.php(173): SPC\builder\linux\LinuxBuilder->buildPHP()
#2 phar:///tmp/spc/src/SPC/command/BaseCommand.php(107): SPC\command\BuildCliCommand->handle()
#3 phar:///tmp/spc/vendor/symfony/console/Command/Command.php(326): SPC\command\BaseCommand->execute()
#4 phar:///tmp/spc/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#5 phar:///tmp/spc/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#6 phar:///tmp/spc/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#7 phar:///tmp/spc/bin/spc(20): Symfony\Component\Console\Application->run()
#8 /tmp/spc(9): require('...')
#9 {main} Please help ! |
Beta Was this translation helpful? Give feedback.
-
I found need only fri2ccLoad ! |
Beta Was this translation helpful? Give feedback.
-
so src/SPC/builder/extension/fricc2.php should be like this: <?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('fricc2load')]
class fricc2load extends Extension
{
public function getUnixConfigureArg(): string
{
return '--enable-fricc2=static';
}
} But I don't understand the commented-out line in src/SPC/store/SourcePatcher.php: //FileSystem::addSourceExtractHook('fri2ccload', [SourcePatcher::class, 'patchFri2ccload']); Where is the code for patchFri2ccload ? Also, in "ext-fricc2load": { <!-- Shouldn't this line have 'fricc2load' instead ?
"type": "git",
"path": "php-src/ext/fricc2load",
"rev": "main",
"url": "https://github.com/hoowa/FRICC2.git",
"patch": "patchFri2ccLoad", <!-- What does this line do ? Where is the code for 'patchFri2ccLoad' ?
"license": {
"type": "file",
"path": "LICENSE"
}
}, ? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
What PHP version are you building micro with ? When I tested fricc2 yesterday (without spc) I got the EXACT same output "hellokitty" etc. UNTIL I compiled against PHP 8.1.30 (and not PHP8.2 which I was using) @crazywhalecc Please have another look ! |
Beta Was this translation helpful? Give feedback.
-
OK thank you for your efforts ! |
Beta Was this translation helpful? Give feedback.
-
Hi !
I stumbled on https://github.com/hoowa/PHP-FRICC2
which appears to be a encoder for PHP code that appears to be able to be statically built so I thought that it could be a replacement for tonyenc ?
@crazywhalecc Let me know what you think !
Beta Was this translation helpful? Give feedback.
All reactions