projects
/
misc
/
hallinta-metro
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e352b0b
)
Send error message to developer
author
Joey Schulze
<joey@infodrom.org>
Thu, 14 Mar 2013 13:45:41 +0000
(14:45 +0100)
committer
Joey Schulze
<joey@infodrom.org>
Thu, 14 Mar 2013 13:45:41 +0000
(14:45 +0100)
utils.php
patch
|
blob
|
history
diff --git
a/utils.php
b/utils.php
index
016f15b
..
7ad39ac
100644
(file)
--- a/
utils.php
+++ b/
utils.php
@@
-5,6
+5,8
@@
define('TEMPLATE', 'ordersatz.tex');
define('FNAME_VARS', 'ordersatz_vars.tex');
define('FNAME_ITEMS', 'ordersatz_items.tex');
define('FAXNUMBER','2002-364');
define('FNAME_VARS', 'ordersatz_vars.tex');
define('FNAME_ITEMS', 'ordersatz_items.tex');
define('FAXNUMBER','2002-364');
+define('ERROR_SAFT','joey@finlandia');
+define('ERROR_MAIL','joey@finlandia');
function mk_tempdir()
{
function mk_tempdir()
{
@@
-177,8
+179,17
@@
function ordersatz_write($id, $dir, $send)
system("latex ordersatz > ordersatz.out 2>&1 && dvips ordersatz >> ordersatz.out 2>&1 && ps2pdf ordersatz.ps", $ret);
system("latex ordersatz > ordersatz.out 2>&1 && dvips ordersatz >> ordersatz.out 2>&1 && ps2pdf ordersatz.ps", $ret);
- if ($ret !== 0)
+ if ($ret !== 0) {
+ $fname = sprintf("ordersatz-%d-%d.tar.bz2", $id, time());
+ $cmd = sprintf("tar cfj %s ordersatz.tex ordersatz_vars.tex ordersatz_items.tex ordersatz.out && " .
+ "mail -s 'Probleme beim Compilieren des Ordersatzes %d' %s < %s && " .
+ "sendfile -Q -c='Probleme beim Compilieren des Ordersatzes %d' %s %s",
+ $fname,
+ $id, ERROR_MAIL, $fname
+ $id, $fname, ERROR_SAFT);
+ system($cmd);
return "Probleme beim Compilieren des Ordersatzes";
return "Probleme beim Compilieren des Ordersatzes";
+ }
if (!file_exists('ordersatz.ps'))
return "Postscript-Datei nicht erstellt";
if (!file_exists('ordersatz.ps'))
return "Postscript-Datei nicht erstellt";