diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-06-09 17:32:33 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-06-09 22:07:40 +0200 |
commit | 6458123e1276147095f296522a61823676006f3f (patch) | |
tree | 6e3d7c613302310b892df08900de2166c97ed5fd /application | |
parent | 8c572f55b17b86cbfa56f18f0491e05092f755b1 (diff) |
Use PHP library for QR codes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r-- | application/controllers/file.php | 6 | ||||
-rw-r--r-- | application/libraries/Customautoloader.php | 3 | ||||
m--------- | application/third_party/QrCode | 0 |
3 files changed, 8 insertions, 1 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 56928015f..7c49988bf 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -131,7 +131,11 @@ class File extends MY_Controller { handle_etag($etag); header("Content-disposition: inline; filename=\"".$id."_qr.png\"\n"); header("Content-Type: image/png\n"); - echo (new \libraries\ProcRunner(array('qrencode', '-s', '10', '-o', '-', site_url($id).'/')))->execSafe()['stdout']; + $qr = new \Endroid\QrCode\QrCode(); + $qr->setText(site_url($id).'/') + ->setSize(350) + ->setErrorCorrection('low') + ->render(); exit(); case "info": diff --git a/application/libraries/Customautoloader.php b/application/libraries/Customautoloader.php index 6a616ba7f..426364ee3 100644 --- a/application/libraries/Customautoloader.php +++ b/application/libraries/Customautoloader.php @@ -17,6 +17,9 @@ class CustomAutoloader{ public function loader($className) { $namespaces = array( + 'Endroid\QrCode' => [ + ["path" => APPPATH."/third_party/QrCode/src/"], + ], '' => [ ["path" => APPPATH], ["path" => APPPATH."/third_party/mockery/library/"] diff --git a/application/third_party/QrCode b/application/third_party/QrCode new file mode 160000 +Subproject 4638f11b6944cccce997db7fa7508b5a7ad1a61 |