php: Run nixpkgs-fmt on all php related files

This commit is contained in:
Elis Hirwing 2021-06-26 09:46:46 +02:00
parent 42cadf5a76
commit 94d07b7492
No known key found for this signature in database
GPG key ID: D57EFA625C9A925F
10 changed files with 789 additions and 563 deletions

View file

@ -1,5 +1,5 @@
{ system ? builtins.currentSystem
, config ? {}
, config ? { }
, pkgs ? import ../../.. { inherit system config; }
, php ? pkgs.php
}:
@ -8,7 +8,8 @@ let
php' = php.buildEnv {
extensions = { enabled, all }: with all; enabled ++ [ apcu ];
};
in {
in
{
fpm = import ./fpm.nix { inherit system pkgs; php = php'; };
httpd = import ./httpd.nix { inherit system pkgs; php = php'; };
pcre = import ./pcre.nix { inherit system pkgs; php = php'; };

View file

@ -1,4 +1,4 @@
import ../make-test-python.nix ({pkgs, lib, php, ...}: {
import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
name = "php-${php.version}-fpm-nginx-test";
meta.maintainers = lib.teams.php.members;
@ -8,21 +8,23 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
services.nginx = {
enable = true;
virtualHosts."phpfpm" = let
testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
in {
root = "${testdir}/web";
locations."~ \\.php$".extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.foobar.socket};
fastcgi_index index.php;
include ${pkgs.nginx}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
'';
locations."/" = {
tryFiles = "$uri $uri/ index.php";
index = "index.php index.html index.htm";
virtualHosts."phpfpm" =
let
testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
in
{
root = "${testdir}/web";
locations."~ \\.php$".extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.foobar.socket};
fastcgi_index index.php;
include ${pkgs.nginx}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
'';
locations."/" = {
tryFiles = "$uri $uri/ index.php";
index = "index.php index.html index.htm";
};
};
};
};
services.phpfpm.pools."foobar" = {

View file

@ -1,4 +1,4 @@
import ../make-test-python.nix ({pkgs, lib, php, ...}: {
import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
name = "php-${php.version}-httpd-test";
meta.maintainers = lib.teams.php.members;
@ -6,14 +6,16 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
services.httpd = {
enable = true;
adminAddr = "admin@phpfpm";
virtualHosts."phpfpm" = let
testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
in {
documentRoot = "${testdir}/web";
locations."/" = {
index = "index.php index.html";
virtualHosts."phpfpm" =
let
testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
in
{
documentRoot = "${testdir}/web";
locations."/" = {
index = "index.php index.html";
};
};
};
phpPackage = php;
enablePHP = true;
};

View file

@ -1,6 +1,7 @@
let
testString = "can-use-subgroups";
in import ../make-test-python.nix ({lib, php, ...}: {
in
import ../make-test-python.nix ({ lib, php, ... }: {
name = "php-${php.version}-httpd-pcre-jit-test";
meta.maintainers = lib.teams.php.members;
@ -12,14 +13,15 @@ in import ../make-test-python.nix ({lib, php, ...}: {
phpPackage = php;
enablePHP = true;
phpOptions = "pcre.jit = true";
extraConfig = let
testRoot = pkgs.writeText "index.php"
''
<?php
preg_match('/(${testString})/', '${testString}', $result);
var_dump($result);
'';
in
extraConfig =
let
testRoot = pkgs.writeText "index.php"
''
<?php
preg_match('/(${testString})/', '${testString}', $result);
var_dump($result);
'';
in
''
Alias / ${testRoot}/