clarified modules;
authorwenzelm
Tue, 23 Jan 2024 12:18:06 +0100
changeset 79515 fa581264522e
parent 79514 9204c034a5bf
child 79516 eeacad2a7aaa
clarified modules;
src/Pure/System/linux.scala
src/Pure/Tools/phabricator.scala
--- a/src/Pure/System/linux.scala	Mon Jan 22 22:18:20 2024 +0100
+++ b/src/Pure/System/linux.scala	Tue Jan 23 12:18:06 2024 +0100
@@ -145,4 +145,14 @@
     require(length >= 6, "password too short")
     Isabelle_System.bash("pwgen " + length + " 1").check.out
   }
+
+
+  /* PHP */
+
+  def php_version(): String =
+    Isabelle_System.bash("""php --run 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;'""")
+      .check.out
+
+  def php_conf_dir(name: String): Path =
+    Path.explode("/etc/php") + Path.basic(php_version()) + Path.basic(name) + Path.explode("conf.d")
 }
--- a/src/Pure/Tools/phabricator.scala	Mon Jan 22 22:18:20 2024 +0100
+++ b/src/Pure/Tools/phabricator.scala	Tue Jan 23 12:18:06 2024 +0100
@@ -18,17 +18,6 @@
 object Phabricator {
   /** defaults **/
 
-  /* PHP */
-
-  def php_version(): String =
-    Isabelle_System.bash("""php --run 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;'""")
-      .check.out
-
-  def php_conf_dir(name: String): Path =
-    Path.explode("/etc/php") + Path.basic(php_version()) +  // educated guess
-    Path.basic(name) + Path.explode("conf.d")
-
-
   /* webservers */
 
   sealed abstract class Webserver {
@@ -49,7 +38,7 @@
     def systemctl(cmd: String): String = "systemctl " + cmd + " " + system_name
 
     def php_init(): Unit =
-      File.write(php_conf_dir(php_name) + Path.basic(isabelle_phabricator_name(ext = "ini")),
+      File.write(Linux.php_conf_dir(php_name) + Path.basic(isabelle_phabricator_name(ext = "ini")),
         "post_max_size = 32M\n" +
         "opcache.validate_timestamps = 0\n" +
         "memory_limit = 512M\n" +
@@ -112,7 +101,7 @@
 
   location ~ \.php$ {
     include snippets/fastcgi-php.conf;
-    fastcgi_pass unix:/var/run/php/php""" + php_version() + """-fpm.sock;
+    fastcgi_pass unix:/var/run/php/php""" + Linux.php_version() + """-fpm.sock;
   }
 
   location /index.php {