From: Adam Chlipala Date: Sat, 19 Jan 2008 20:25:55 +0000 (+0000) Subject: phpVersion X-Git-Tag: release_2010-11-19~64 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/83bc6c4539f4a5feb7104e3eaa0d1807573d48cc phpVersion --- diff --git a/lib/php.dtl b/lib/php.dtl new file mode 100644 index 0000000..369bae5 --- /dev/null +++ b/lib/php.dtl @@ -0,0 +1,7 @@ +{{PHP configuration}} + +extern type php_version; +extern val php4 : php_version; +extern val php5 : php_version; + +extern val phpVersion : php_version -> [^Vhost]; diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 300ffa4..450cfbb 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -977,7 +977,17 @@ val () = Env.action_one "diskCache" (fn path => (write "\tCacheEnable disk \""; write path; write "\"\n")) - + +val php_version = fn (EVar "php4", _) => SOME 4 + | (EVar "php5", _) => SOME 5 + | _ => NONE + +val () = Env.action_one "phpVersion" + ("version", php_version) + (fn version => (write "\tAddHandler x-httpd-php"; + write (Int.toString version); + write " .php .phtml\n")) + val () = Domain.registerResetLocal (fn () => ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/vhosts/*")))