Skip to content

Commit

Permalink
[flake] enable php extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
savil committed Feb 16, 2023
1 parent 1aa41bc commit 3df1cb5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/testdata/php/php-extensions/devbox.d/php81/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[global]
pid = ${PHPFPM_PID_FILE}
error_log = ${PHPFPM_ERROR_LOG_FILE}
daemonize = yes

[www]
; user = www-data
; group = www-data
listen = 127.0.0.1:${PHPFPM_PORT}
; listen.owner = www-data
; listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
13 changes: 13 additions & 0 deletions examples/testdata/php/php-extensions/devbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"packages": [
"php81",
"php81Packages.composer",
"php81Extensions.ds"
],
"shell": {
"init_hook": null
},
"nixpkgs": {
"commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
}
}
15 changes: 15 additions & 0 deletions examples/testdata/php/php-extensions/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

// Check that the extension is loaded.
if (!extension_loaded('ds')) {
echo("ds extension is not enabled\n");
exit(1);
}

$vec = new \Ds\Vector(["hello", "world"]);

echo("Original vector elements\n");
foreach ($vec as $idx => $elem) {
echo("idx: $idx and elem: $elem\n");
}
echo("done\n");

0 comments on commit 3df1cb5

Please sign in to comment.