To build it:
zig buildphpize./configuremake
To test it:
php -d extension=./modules/my_php_extension.so -r "echo hello_world();"
To build it:
zig buildphpize./configuremakeTo test it:
php -d extension=./modules/my_php_extension.so -r "echo hello_world();"
| [package] | |
| name = "hello_world" | |
| version = "0.1.0" | |
| edition = "2021" | |
| [lib] | |
| crate-type = ["cdylib"] | |
| [dependencies] | |
| anyhow = "*" |
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.
SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on
| // For Zig 0.12 | |
| const std = @import("std"); | |
| const net = std.net; | |
| const ArenaAllocator = std.heap.ArenaAllocator; | |
| pub fn main() anyerror!void { | |
| var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
| const allocator = gpa.allocator(); |
All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.
| PASS=yourcertificatemasterpassword | |
| SUBJ=/C=PL/ST=MyState/L=MyLocation/O=MyOrganization/OU=MyOrganisationUnit/CN=localhost/emailAddress=admin@localhost | |
| # Targets | |
| localhostCA.crt: localhostCA.pem | |
| openssl x509 \ | |
| -in localhostCA.pem \ | |
| -inform PEM \ | |
| -out localhostCA.crt |
| const std = @import("std"); | |
| const net = std.net; | |
| const fs = std.fs; | |
| const os = std.os; | |
| pub const io_mode = .evented; | |
| pub fn main() anyerror!void { | |
| var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; | |
| const allocator = &general_purpose_allocator.allocator; |
| <?php | |
| function compileCPP(string $sourcePath, string $binaryPath): bool { | |
| $descriptorspec = [ | |
| 0 => ['pipe', 'r'], | |
| 1 => ['pipe', 'w'], | |
| 2 => ['pipe', 'w'] | |
| ]; | |
| $cwd = '/tmp'; |