diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | application/controllers/file.php | 6 | ||||
-rw-r--r-- | application/libraries/Customautoloader.php | 3 | ||||
m--------- | application/third_party/QrCode | 0 | ||||
-rw-r--r-- | docker/Dockerfile | 2 | ||||
-rw-r--r-- | install.php | 8 |
7 files changed, 12 insertions, 11 deletions
diff --git a/.gitmodules b/.gitmodules index 7209fd166..8e18180fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "application/third_party/mockery"] path = application/third_party/mockery url = https://github.com/padraic/mockery.git +[submodule "application/third_party/QrCode"] + path = application/third_party/QrCode + url = https://github.com/endroid/QrCode.git @@ -45,7 +45,6 @@ not need to register to be allowed to post. * [pygmentize](http://pygments.org/) for code highlighting * [ansi2html](http://pypi.python.org/pypi/ansi2html) for shell output rendering (ANSI color codes) -* [qrencode](http://megaui.net/fukuchi/works/qrencode/index.en.html) for qrcode generation * [imagemagick](http://www.imagemagick.org/) for additional thumbnail generation * [node.js](https://nodejs.org/) for javascript minification 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 diff --git a/docker/Dockerfile b/docker/Dockerfile index 395faf4d6..70e82f9e2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -y && \ apt-get install -y php5 php5-mysql php5-gd php5-imagick libtext-markdown-perl expect \ - python-pygments qrencode imagemagick git python-pip realpath curl apt-transport-https + python-pygments imagemagick git python-pip realpath curl apt-transport-https RUN echo 'deb https://deb.nodesource.com/node_4.x trusty main' > /etc/apt/sources.list.d/nodesource.list RUN echo 'deb-src https://deb.nodesource.com/node_4.x trusty main' >> /etc/apt/sources.list.d/nodesource.list diff --git a/install.php b/install.php index 3d486d911..1deb8cc2a 100644 --- a/install.php +++ b/install.php @@ -60,14 +60,6 @@ if ($buf != "0") { $errors .= " - Error when testing ansi2html: Return code was \"$buf\".\n"; } -// test qrencode -ob_start(); -passthru("qrencode -V 2>&1", $buf); -ob_end_clean(); -if ($buf != "0") { - $errors .= " - Error when testing qrencode: Return code was \"$buf\".\n"; -} - // test imagemagick ob_start(); passthru("convert --version 2>&1", $buf); |