feat: charger_pdf utiliser maintenant la fonction de gamufonctions generer_pdf
This commit is contained in:
parent
ff9c550c22
commit
f2d5d05347
2 changed files with 3 additions and 25 deletions
|
@ -4,29 +4,6 @@ if (!defined('_ECRIRE_INC_VERSION')){
|
||||||
}
|
}
|
||||||
|
|
||||||
function inc_charger_pdf_dist($fichier_pdf, $contexte = [], $args = []){
|
function inc_charger_pdf_dist($fichier_pdf, $contexte = [], $args = []){
|
||||||
|
$f = charger_fonction('generer_pdf','gamu');
|
||||||
$login = lire_config('curl_login');
|
return $f($fichier_pdf, $contexte);
|
||||||
$password = lire_config('curl_mdp');
|
|
||||||
|
|
||||||
$contexte['spipdf'] = $contexte['spipdf'] ?? $fichier_pdf ;
|
|
||||||
$contexte['alea'] = time();
|
|
||||||
$url = generer_url_public('spipdf', $contexte, true, false);
|
|
||||||
|
|
||||||
$CurlConnect = curl_init();
|
|
||||||
// pour une connexion https locale avec certificat auto-signé
|
|
||||||
if (defined('_DEBUG_AUTORISER')) {
|
|
||||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYHOST, false);
|
|
||||||
curl_setopt($CurlConnect, CURLOPT_SSL_VERIFYPEER, false);
|
|
||||||
}
|
|
||||||
curl_setopt($CurlConnect, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($CurlConnect, CURLOPT_RETURNTRANSFER, 1 );
|
|
||||||
//curl_setopt($CurlConnect, CURLOPT_POSTFIELDS, $request);
|
|
||||||
curl_setopt($CurlConnect, CURLOPT_USERPWD, $login.':'.$password);
|
|
||||||
$retour = curl_exec($CurlConnect);
|
|
||||||
if( ! $retour = curl_exec($CurlConnect)) {
|
|
||||||
trigger_error(curl_error($CurlConnect));
|
|
||||||
}
|
|
||||||
curl_close($CurlConnect);
|
|
||||||
|
|
||||||
return $retour;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<necessite nom="bigform" compatibilite="[1.2.3;[" />
|
<necessite nom="bigform" compatibilite="[1.2.3;[" />
|
||||||
<necessite nom="crayons" compatibilite="[2.0.10;[" />
|
<necessite nom="crayons" compatibilite="[2.0.10;[" />
|
||||||
<necessite nom="facteur" compatibilite="[4.0.0;[" />
|
<necessite nom="facteur" compatibilite="[4.0.0;[" />
|
||||||
|
<necessite nom="gamufonctions" compatibilite="[1.3.4;[" />
|
||||||
|
|
||||||
<pipeline nom="remplacements_slug" action='' />
|
<pipeline nom="remplacements_slug" action='' />
|
||||||
<pipeline nom="post_gamumail_ok" action='' />
|
<pipeline nom="post_gamumail_ok" action='' />
|
||||||
|
|
Loading…
Add table
Reference in a new issue