----------------------------------------------------------------------
($intext, $outfile = false)
| 3266 | |
| 3267 | //---------------------------------------------------------------------- |
| 3268 | public function encode($intext, $outfile = false) |
| 3269 | { |
| 3270 | $code = new QRcode(); |
| 3271 | |
| 3272 | if($this->eightbit) { |
| 3273 | $code->encodeString8bit($intext, $this->version, $this->level); |
| 3274 | } else { |
| 3275 | $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); |
| 3276 | } |
| 3277 | |
| 3278 | QRtools::markTime('after_encode'); |
| 3279 | |
| 3280 | if ($outfile!== false) { |
| 3281 | file_put_contents($outfile, join("\n", QRtools::binarize($code->data))); |
| 3282 | } else { |
| 3283 | return QRtools::binarize($code->data); |
| 3284 | } |
| 3285 | } |
| 3286 | |
| 3287 | //---------------------------------------------------------------------- |
| 3288 | public function encodePNG($intext, $outfile = false,$saveandprint=false) |
no test coverage detected