|
@@ -1,9 +1,12 @@
|
|
|
<?php
|
|
<?php
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @created 21.12.2017
|
|
* @created 21.12.2017
|
|
|
* @author Smiley <smiley@chillerlan.net>
|
|
* @author Smiley <smiley@chillerlan.net>
|
|
|
* @copyright 2017 Smiley
|
|
* @copyright 2017 Smiley
|
|
|
* @license MIT
|
|
* @license MIT
|
|
|
|
|
+ *
|
|
|
|
|
+ * @noinspection PhpComposerExtensionStubsInspection
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
namespace chillerlan\QRCodeExamples;
|
|
namespace chillerlan\QRCodeExamples;
|
|
@@ -11,6 +14,7 @@ namespace chillerlan\QRCodeExamples;
|
|
|
use chillerlan\QRCode\{QRCode, QROptions};
|
|
use chillerlan\QRCode\{QRCode, QROptions};
|
|
|
use chillerlan\QRCode\Data\QRMatrix;
|
|
use chillerlan\QRCode\Data\QRMatrix;
|
|
|
use chillerlan\QRCode\Common\EccLevel;
|
|
use chillerlan\QRCode\Common\EccLevel;
|
|
|
|
|
+use function gzencode, header;
|
|
|
|
|
|
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
|
|
|
|
|
@@ -18,25 +22,29 @@ $data = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
|
|
|
$gzip = true;
|
|
$gzip = true;
|
|
|
|
|
|
|
|
$options = new QROptions([
|
|
$options = new QROptions([
|
|
|
- 'version' => 7,
|
|
|
|
|
- 'outputType' => QRCode::OUTPUT_MARKUP_SVG,
|
|
|
|
|
- 'imageBase64' => false,
|
|
|
|
|
- 'eccLevel' => EccLevel::L,
|
|
|
|
|
- 'addQuietzone' => true,
|
|
|
|
|
|
|
+ 'version' => 7,
|
|
|
|
|
+ 'outputType' => QRCode::OUTPUT_MARKUP_SVG,
|
|
|
|
|
+ 'imageBase64' => false,
|
|
|
|
|
+ 'eccLevel' => EccLevel::L,
|
|
|
|
|
+ 'addQuietzone' => true,
|
|
|
// if set to true, the light modules won't be rendered
|
|
// if set to true, the light modules won't be rendered
|
|
|
- 'imageTransparent' => false,
|
|
|
|
|
|
|
+ 'imageTransparent' => false,
|
|
|
// empty the default value to remove the fill* attributes from the <path> elements
|
|
// empty the default value to remove the fill* attributes from the <path> elements
|
|
|
- 'markupDark' => '',
|
|
|
|
|
- 'markupLight' => '',
|
|
|
|
|
|
|
+ 'markupDark' => '',
|
|
|
|
|
+ 'markupLight' => '',
|
|
|
// draw the modules as circles isntead of squares
|
|
// draw the modules as circles isntead of squares
|
|
|
'drawCircularModules' => true,
|
|
'drawCircularModules' => true,
|
|
|
- 'circleRadius' => 0.4,
|
|
|
|
|
|
|
+ 'circleRadius' => 0.4,
|
|
|
|
|
+ // connect paths
|
|
|
|
|
+ 'svgConnectPaths' => true,
|
|
|
// keep modules of thhese types as square
|
|
// keep modules of thhese types as square
|
|
|
- 'keepAsSquare' => [QRMatrix::M_FINDER|QRMatrix::IS_DARK, QRMatrix::M_FINDER_DOT, QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK],
|
|
|
|
|
- // connect
|
|
|
|
|
- 'svgConnectPaths' => true,
|
|
|
|
|
|
|
+ 'keepAsSquare' => [
|
|
|
|
|
+ QRMatrix::M_FINDER|QRMatrix::IS_DARK,
|
|
|
|
|
+ QRMatrix::M_FINDER_DOT,
|
|
|
|
|
+ QRMatrix::M_ALIGNMENT|QRMatrix::IS_DARK,
|
|
|
|
|
+ ],
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
|
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
|
|
|
- 'svgDefs' => '
|
|
|
|
|
|
|
+ 'svgDefs' => '
|
|
|
<linearGradient id="rainbow" x1="100%" y2="100%">
|
|
<linearGradient id="rainbow" x1="100%" y2="100%">
|
|
|
<stop stop-color="#e2453c" offset="2.5%"/>
|
|
<stop stop-color="#e2453c" offset="2.5%"/>
|
|
|
<stop stop-color="#e07e39" offset="21.5%"/>
|
|
<stop stop-color="#e07e39" offset="21.5%"/>
|