apache: fix phpVersion action
authorClinton Ebadi <clinton@unknownlamer.org>
Wed, 24 Feb 2021 02:53:45 +0000 (21:53 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Wed, 24 Feb 2021 03:19:54 +0000 (22:19 -0500)
Was not updated with PhpVersion environment variable to output once
wrapper directive per extension instead of forcing all extensions.

lib/apache.dtl
src/plugins/apache.sml

index 9269ee1..b663f0e 100644 (file)
@@ -44,8 +44,6 @@ extern val php73 : php_version;
 extern val php74 : php_version;
 {{FastCGI based php 7.4.}}
 
-val fast_php : php_version = php56;
-
 extern val vhost : host -> Vhost => [Domain]
   {WebPlaces : [web_place],
   SSL : ssl,
index 9d751e8..59e96b3 100644 (file)
@@ -475,6 +475,7 @@ val php_version = fn (EVar "php56", _) => SOME 56
                    | (EVar "php72", _) => SOME 72
                   | (EVar "php73", _) => SOME 73
                   | (EVar "php74", _) => SOME 74
+                  | (EVar "php80", _) => SOME 80
                   | _ => NONE
 
 fun vhostBody (env, makeFullHost) =
@@ -1207,13 +1208,16 @@ val () = Env.action_one "diskCache"
 val () = Env.action_one "phpVersion"
         ("version", php_version)
         (fn version => (write "\tAddHandler fcgid-script .php .phtml\n";
-                             (* FIXME: only set kerberos wrapper of waklog is on *)
-                             (* won't be trivial, since we don't have access to node here *)
-                             write "\n\tFcgidWrapper \"";
-                             write (Config.Apache.fastCgiWrapperOf (Domain.getUser ()));
-                             write " ";
-                             write (Config.Apache.phpFastCgiWrapper version);
-                             write "\" .php .phtml\n"))
+                        (* FIXME: only set kerberos wrapper of waklog is on *)
+                        (* won't be trivial, since we don't have access to node here *)
+                        app (fn ext => (write "\n\tFcgidWrapper \"";
+                                        write (Config.Apache.fastCgiWrapperOf (Domain.getUser ()));
+                                        write " ";
+                                        write (Config.Apache.phpFastCgiWrapper version);
+                                        write "\" ";
+                                        write ext;
+                                        write "\n"))
+                            [".php", ".phtml"]))
 
 val () = Env.action_two "addType"
         ("mime type", Env.string, "extension", Env.string)