mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2025-04-26 07:06:18 +02:00
minor corrections and distribution of the generated file
This commit is contained in:
parent
6535d4d7dd
commit
890c2397e3
6 changed files with 85 additions and 31 deletions
37
canciones-updater.php
Normal file
37
canciones-updater.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
$song_list = "";
|
||||
foreach ($_POST["song"] as $i)
|
||||
if ($i) $song_list .= "$i ";
|
||||
|
||||
$cmd = "python3 /opt/cancionero-web-python/src/create_songbook.py";
|
||||
$cmd .= " --latex /opt/cancionero-web-python/latex/cancionero.tex";
|
||||
$cmd .= " --other-latex /opt/cancionero-web-python/latex/canciones/";
|
||||
$cmd .= " --other-index 400";
|
||||
$cmd .= " --output-dir /srv/http/canciones-updater/canciones/";
|
||||
$cmd .= " --output-file result.html";
|
||||
$cmd .= " --songs $song_list";
|
||||
echo "<pre>";
|
||||
passthru("$cmd 2>&1", $return_code);
|
||||
echo "</pre>";
|
||||
|
||||
if ($return_code) {
|
||||
http_response_code(500);
|
||||
echo "An error occurred!<br/>See the data below<br/>";
|
||||
echo "The return code was $return_code<br/>";
|
||||
echo "Command: <pre>$cmd</pre>";
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script>
|
||||
document.location.replace("https://canciones.sanleandro-obispo.net/misa/update_index.php")
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
You can see the result <a href="https://canciones.sanleandro-obispo.net/misa/update_index.php">here</a>.
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue