Commit b3e20045 authored by Lionel VEST's avatar Lionel VEST
Browse files

*

parent cebe878e
......@@ -6,7 +6,7 @@ function read($connection,$input)
if ($input->body->action == 'convert_to_pdf')
{
$path = str_replace('/files/'. $input->db . '/', '', $input->body->file);
exec("LC_ALL=fr_FR.UTF-8 export HOME=/srv/api/tmp/ && libreoffice --headless --convert-to pdf '/srv/files/" . $input->db . "/" . $path . "' --outdir '/srv/files/" . $input->db . "/" . substr($path,0,strrpos($path,'/')) . "' 2>&1",$output);
exec("LC_ALL=fr_FR.UTF-8 export HOME=/srv/api/tmp && libreoffice --headless --convert-to pdf '/srv/files/" . $input->db . "/" . $path . "' --outdir '/srv/files/" . $input->db . "/" . substr($path,0,strrpos($path,'/')) . "' 2>&1",$output);
if (is_file('/srv/files/' . $input->db . '/' . substr($path,0,strrpos($path,'.')) . '.pdf'))
return array("code" => 200, "message" => "Conversion effectuée avec succès");
else
......@@ -27,7 +27,7 @@ function read($connection,$input)
if (is_file('/srv/files/demo@demoptimus.fr/==DOSSIERS==/' . $zip_to_create))
return array("code" => 200, "message" => "Conversion effectuée avec succès");
else
return array("code" => 400, "message" => "La conversion a échoué", "errors" => "LC_ALL=fr_FR.UTF-8 export HOME=/srv/api/tmp/ && cd '" . $path . "'; zip -r '" . $zip_to_create . "' '" . implode("' '",$input->body->items) . "' 2>&1");
return array("code" => 400, "message" => "La conversion a échoué", "errors" => "LC_ALL=fr_FR.UTF-8 export HOME=/srv/api/tmp && cd '" . $path . "'; zip -r '" . $zip_to_create . "' '" . implode("' '",$input->body->items) . "' 2>&1");
}
return array("code" => 400, "message" => "Aucune action n'a été renseignée");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment