33,7 → 33,7 |
public function setUrl($url = '') { |
$this->contenu = $url; |
} |
|
|
/** |
* Taille du QRcode en pixel. Cela sera forcément un carré. |
* |
42,7 → 42,7 |
public function setTaille($taille) { |
$this->taille = $taille; |
} |
|
|
/** |
* Generate QR code image |
* |
56,10 → 56,6 |
$cheminImg = $this->dossierQrCode.$idQrCode; |
if (file_exists($cheminImg) == false) { |
$ch = curl_init(); |
// For Debugging |
//curl_setopt($ch, CURLOPT_VERBOSE, TRUE); |
//curl_setopt($ch, CURLOPT_STDERR, $f = fopen("$cheminImg.txt", "w+")); |
|
curl_setopt($ch, CURLOPT_URL, $this->API_CHART_URL); |
curl_setopt($ch, CURLOPT_POST, true); |
curl_setopt($ch, CURLOPT_POSTFIELDS, "chs={$this->taille}x{$this->taille}&cht=qr&chl=".urlencode($this->contenu)); |
68,10 → 64,7 |
curl_setopt($ch, CURLOPT_TIMEOUT, 30); |
$img = curl_exec($ch); |
curl_close($ch); |
|
// For Debugging |
//fclose($f); |
|
|
file_put_contents($cheminImg, $img); |
} |
$urlQrCode = sprintf($this->urlQrCodeTpl, $idQrCode); |