tiny-slitaz annotate step4.php @ rev 6
Refresh style (thanks Aleksej)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Nov 01 16:56:16 2015 +0100 (2015-11-01) |
parents | 577e6e91216d |
children | 69b7df0ddb67 |
rev | line source |
---|---|
pascal@0 | 1 <?php |
pascal@0 | 2 |
pascal@0 | 3 if (isset($_POST['packages']) && !isset($_POST['toconfigure'])) { |
pascal@0 | 4 $_POST['toconfigure'] = shell_exec("./helper --depends ". |
pascal@0 | 5 $_POST['tmp_dir']." ".$_POST['packages']); |
pascal@0 | 6 } |
pascal@0 | 7 |
pascal@0 | 8 if (isset($_POST['configuring'])) { |
pascal@0 | 9 $pkg = $_POST['configuring']; |
pascal@0 | 10 $fp = fopen($_POST['tmp_dir']."vars","w"); |
pascal@0 | 11 foreach ($_POST as $key => $val) { |
pascal@0 | 12 if (in_array($key, $usedvars)) continue; |
pascal@0 | 13 fwrite($fp,"export ".$key."='".$val."'\n"); |
pascal@0 | 14 } |
pascal@0 | 15 fclose($fp); |
pascal@0 | 16 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']); |
pascal@0 | 17 } |
pascal@0 | 18 |
pascal@0 | 19 $output = ''; |
pascal@5 | 20 if (!empty($_POST['toconfigure'])) { |
pascal@0 | 21 $pkgs = explode(" ",$_POST['toconfigure']); |
pascal@0 | 22 foreach ($pkgs as $key => $pkg) { |
pascal@0 | 23 shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']); |
pascal@0 | 24 $output = shell_exec("./helper --get-form $pkg ". |
pascal@0 | 25 $_POST['tmp_dir']); |
pascal@0 | 26 unset($pkgs[$key]); |
pascal@0 | 27 $_POST['toconfigure'] = implode(" ", $pkgs); |
pascal@0 | 28 if ($output == "") { |
pascal@0 | 29 shell_exec("sudo ./helper --post-install $pkg ". |
pascal@0 | 30 $_POST['tmp_dir']); |
pascal@0 | 31 continue; |
pascal@0 | 32 } |
pascal@0 | 33 ?> |
pascal@0 | 34 |
pascal@6 | 35 <div class="box"> |
pascal@6 | 36 <h3>[Step 4/5] <?php echo $pkg; ?> configuration</h3> |
pascal@0 | 37 |
pascal@0 | 38 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> |
pascal@0 | 39 |
pascal@6 | 40 <input name="configuring" value="<?php echo $pkg; ?>" type="hidden" /> |
pascal@6 | 41 <div class="large"> |
pascal@6 | 42 <?php |
pascal@0 | 43 echo $output; |
pascal@0 | 44 post_hidden(); |
pascal@0 | 45 ?> |
pascal@6 | 46 </div> |
pascal@0 | 47 |
pascal@6 | 48 <div align="center"> |
pascal@6 | 49 <input name="continue" value="Continue" type="submit" /> |
pascal@6 | 50 </div> |
pascal@0 | 51 |
pascal@0 | 52 </form> |
pascal@6 | 53 </div> |
pascal@0 | 54 |
pascal@0 | 55 <?php |
pascal@0 | 56 echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']); |
pascal@0 | 57 break; |
pascal@0 | 58 } |
pascal@0 | 59 |
pascal@0 | 60 } |
pascal@0 | 61 ?> |