Skip to content

Commit 22b5b48

Browse files
authored
[flake] php extensions example project (#631)
## Summary Added an example devbox-project that has a php extension package. This has been useful for doing adhoc testing when developing the feature of "flakes with php extensions". In a future PR, I'll add a testscript (and possibly remove this one). ## How was it tested? ``` > devbox shell # with package `php81Extensions.ds` > php index.php Original vector elements idx: 0 and elem: hello idx: 1 and elem: world done # without package `php81Extensions.ds` > php index.php ds extension is not enabled ```
1 parent 115a215 commit 22b5b48

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[global]
2+
pid = ${PHPFPM_PID_FILE}
3+
error_log = ${PHPFPM_ERROR_LOG_FILE}
4+
daemonize = yes
5+
6+
[www]
7+
; user = www-data
8+
; group = www-data
9+
listen = 127.0.0.1:${PHPFPM_PORT}
10+
; listen.owner = www-data
11+
; listen.group = www-data
12+
pm = dynamic
13+
pm.max_children = 5
14+
pm.start_servers = 2
15+
pm.min_spare_servers = 1
16+
pm.max_spare_servers = 3
17+
chdir = /
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"packages": [
3+
"php81",
4+
"php81Packages.composer",
5+
"php81Extensions.ds"
6+
],
7+
"shell": {
8+
"init_hook": null
9+
},
10+
"nixpkgs": {
11+
"commit": "f80ac848e3d6f0c12c52758c0f25c10c97ca3b62"
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
// Check that the extension is loaded.
4+
if (!extension_loaded('ds')) {
5+
echo("ds extension is not enabled\n");
6+
exit(1);
7+
}
8+
9+
$vec = new \Ds\Vector(["hello", "world"]);
10+
11+
echo("Original vector elements\n");
12+
foreach ($vec as $idx => $elem) {
13+
echo("idx: $idx and elem: $elem\n");
14+
}
15+
echo("done\n");

0 commit comments

Comments
 (0)