Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 990 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 990 Rev 1105
Line 54... Line 54...
54
			$idQrCode .= '.png';
54
			$idQrCode .= '.png';
55
		}
55
		}
56
		$cheminImg = $this->dossierQrCode.$idQrCode;
56
		$cheminImg = $this->dossierQrCode.$idQrCode;
57
		if (file_exists($cheminImg) == false) {
57
		if (file_exists($cheminImg) == false) {
58
			$ch = curl_init();
58
			$ch = curl_init();
-
 
59
			// For Debugging
-
 
60
			//curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
-
 
61
			//curl_setopt($ch, CURLOPT_STDERR, $f = fopen("$cheminImg.txt", "w+"));
-
 
62
 
59
			curl_setopt($ch, CURLOPT_URL, $this->API_CHART_URL);
63
			curl_setopt($ch, CURLOPT_URL, $this->API_CHART_URL);
60
			curl_setopt($ch, CURLOPT_POST, true);
64
			curl_setopt($ch, CURLOPT_POST, true);
61
			curl_setopt($ch, CURLOPT_POSTFIELDS, "chs={$this->taille}x{$this->taille}&cht=qr&chl=".urlencode($this->contenu));
65
			curl_setopt($ch, CURLOPT_POSTFIELDS, "chs={$this->taille}x{$this->taille}&cht=qr&chl=".urlencode($this->contenu));
62
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
66
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
63
			curl_setopt($ch, CURLOPT_HEADER, false);
67
			curl_setopt($ch, CURLOPT_HEADER, false);
64
			curl_setopt($ch, CURLOPT_TIMEOUT, 30);
68
			curl_setopt($ch, CURLOPT_TIMEOUT, 30);
65
			$img = curl_exec($ch);
69
			$img = curl_exec($ch);
66
			curl_close($ch);
70
			curl_close($ch);
Line -... Line 71...
-
 
71
 
-
 
72
			// For Debugging
-
 
73
			//fclose($f);
67
			
74
 
68
			file_put_contents($cheminImg, $img);
75
			file_put_contents($cheminImg, $img);
69
		}
76
		}
70
		$urlQrCode = sprintf($this->urlQrCodeTpl, $idQrCode);
77
		$urlQrCode = sprintf($this->urlQrCodeTpl, $idQrCode);
71
		return $urlQrCode;
78
		return $urlQrCode;