mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Activation du mode debug à l'aide d'une variable d'environnement et on
ne supprime pas les fichiers de transformation en mode debug
This commit is contained in:
parent
20ae508289
commit
6c7ccaf810
12
app.php
12
app.php
@ -2,7 +2,10 @@
|
||||
|
||||
$f3 = require(__DIR__.'/vendor/fatfree/lib/base.php');
|
||||
|
||||
$f3->set('DEBUG',1);
|
||||
if(getenv("DEBUG")) {
|
||||
$f3->set('DEBUG', getenv("DEBUG"));
|
||||
}
|
||||
|
||||
$f3->set('ROOT', __DIR__);
|
||||
$f3->set('UI', $f3->get('ROOT')."/templates/");
|
||||
$f3->set('UPLOADS', $f3->get('ROOT').'/data/');
|
||||
@ -96,6 +99,10 @@ $f3->route('POST /image2svg',
|
||||
|
||||
header('Content-Type: image/svg+xml');
|
||||
echo file_get_contents($imageFile.".svg");
|
||||
|
||||
if($f3->get('DEBUG')) {
|
||||
return;
|
||||
}
|
||||
array_map('unlink', glob($imageFile."*"));
|
||||
}
|
||||
);
|
||||
@ -116,6 +123,9 @@ $f3->route('POST /@key/save',
|
||||
|
||||
Web::instance()->send($f3->get('UPLOADS').$key.'_signe.pdf');
|
||||
|
||||
if($f3->get('DEBUG')) {
|
||||
return;
|
||||
}
|
||||
array_map('unlink', glob($f3->get('UPLOADS').$key."_*.svg"));
|
||||
unlink($f3->get('UPLOADS').$key.'.svg.pdf');
|
||||
unlink($f3->get('UPLOADS').$key.'_signe.pdf');
|
||||
|
Loading…
Reference in New Issue
Block a user