From 57e41a037dd919619dfca2c4eb7cd40e228b3a44 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 22 Dec 2023 09:05:55 +0100
Subject: Wizard: simplify module instructions using witch-to command

---
 wizard/index.php | 49 +++++++++++++++++++------------------------------
 1 file changed, 19 insertions(+), 30 deletions(-)

(limited to 'wizard/index.php')

diff --git a/wizard/index.php b/wizard/index.php
index 56a7fc62..9efa60c8 100644
--- a/wizard/index.php
+++ b/wizard/index.php
@@ -341,46 +341,35 @@ if ($php && $os && $type && !$err) {
                 printf("<pre>    dnf config-manager --set-enabled remi</pre></li><br />");
             }
 
-            //if ($dist == 'Fedora' || $yum == 'yum') {
-            if ($yum == 'yum') {
+            if ($mod) {
+                printf("<li>PHP version <b>%s</b> packages are available for <b>%s</b> in <b>remi-modular</b> repository</li><br />", $php, $os);
+
+                printf("<li>You have to enable the module stream for $php, and update the old version if installed:");
+                printf("<pre>    dnf module switch-to php:remi-%s</pre>", $php);
+                printf("</li><br />");
+
+		        printf("<li>If no version is installed, command to <b>install</b> the php stream default profile:");
+                printf("<pre>    dnf module install php:remi-%s</pre>", $php);
+		        printf("</li><br />");
+            } else {
                 printf("<li>PHP version <b>%s</b> packages are available for <b>%s</b> in <b>%s</b> repository</li><br />", $php, $os, $repo);
 	            printf("<li>Command to enable the repository:");
-            }
-			/*
-            if ($dist == 'Fedora') {
-                printf("<pre>    dnf config-manager --set-enabled %s</pre></li><br />", $repo);
-                if ($mod) {
-                    printf("<li>Command to disable the modular repository:");
-                    printf("<pre>    dnf config-manager --set-disabled remi-modular</pre></li><br />");
-                    printf("<li>Alternatively, you may prefer the modern way, by enabling the module stream for $php:");
-                }
-            } else
-			*/
-			if ($yum == 'yum') { // EL-6, 7
+
                 printf("<pre>    yum-config-manager --disable 'remi-php*'");
                 printf(   "\n    yum-config-manager --enable   %s</pre></li><br />", $repo);
 
                 printf("<li>You can check the list of the enabled repositories:");
                 printf("<pre>    yum repolist</pre></li><br />");
                 printf("<li>If the <b>priorities</b> plugin is enabled, ensure %s have higher priority (a lower value) than %s</li><br />", $repo, ($dist == 'Fedora' ? 'fedora' : 'base and updates'));
-            } else { // EL-8, module only
-                printf("<li>You have to enable the module stream for $php:");
-            }
-
-            if ($mod) {
-                printf("<pre>    dnf module reset php");
-                printf(   "\n    dnf module install php:remi-%s</pre>", $php);
-                printf("</li><br />");
-            }
-
-            printf("<li>If an old version is installed, command to <b>upgrade</b>:");
-            printf("<pre>    $yum update</pre>");
-            printf("</li><br />");
 
-            printf("<li>If no version is installed, command to <b>install</b> the php command:");
-            printf("<pre>    $yum install php-cli</pre>");
-            printf("</li><br />");
+		        printf("<li>If an old version is installed, command to <b>upgrade</b>:");
+		        printf("<pre>    $yum update</pre>");
+		        printf("</li><br />");
 
+		        printf("<li>If no version is installed, command to <b>install</b> the php command:");
+		        printf("<pre>    $yum install php-cli</pre>");
+		        printf("</li><br />");
+			}
             printf("<li>Command to install <b>additional</b> packages (xxx for SAPI or extension name):");
             printf("<pre>    $yum install php-xxx</pre>");
             printf("</li><br />");
-- 
cgit