Compare commits
13 Commits
2.0.0
...
chapril-ma
Author | SHA1 | Date | |
---|---|---|---|
|
ae1f94fd08 | ||
|
446158b32d | ||
|
38ccc935ee | ||
|
55fd19672d | ||
|
34ec98fa81 | ||
|
3c6fbcde2f | ||
|
e013ef7abe | ||
|
b4ef98673f | ||
|
dfe393384c | ||
|
020c3274e1 | ||
|
1503b0dfc8 | ||
|
d45ebbea70 | ||
|
f205f36b80 |
13
CHANGELOG.md
@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## 2.0.1 - 2023-07-08
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Indonesian localization
|
||||||
|
* Basque localization
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Update dependencies
|
||||||
|
|
||||||
## 2.0.0 - 2022-06-07
|
## 2.0.0 - 2022-06-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@ -17,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
* Output generated QR code with `data:` URI
|
* Output generated QR code with `data:` URI
|
||||||
* Change the QR code generation library
|
* Change the QR code generation library
|
||||||
* Use less.php instead of lesserphp
|
* Use less.php instead of lesserphp
|
||||||
* Use the prefers-color-scheme CSS feature to let the client choose its prefered theme (dark/light)
|
* Use the prefers-color-scheme CSS feature to let the client choose its preferred theme (dark/light)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ A LibreQR instance is available at <https://qr.antopie.org>.
|
|||||||
|
|
||||||
### Generic
|
### Generic
|
||||||
|
|
||||||
Just place this source code in a Web server with PHP7.4+, extensions `gd`, `mbstring` and `iconv`, and writing rights on the `css/` directory.
|
Just place this source code in a Web server with PHP8.0+, extensions `gd`, `mbstring` and `iconv`, and writing rights on the `css/` directory.
|
||||||
|
|
||||||
#### Security hardening
|
#### Security hardening
|
||||||
|
|
||||||
@ -32,8 +32,7 @@ There is [a package](https://code.antopie.org/miraty/qr_ynh/) for [YunoHost](htt
|
|||||||
|
|
||||||
For historical reasons, LibreQR is technically named `qr` in YunoHost.
|
For historical reasons, LibreQR is technically named `qr` in YunoHost.
|
||||||
|
|
||||||
You can install it from the WebAdmin or with this command :
|
You can install it from the WebAdmin or with this command:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo yunohost app install qr
|
sudo yunohost app install qr
|
||||||
```
|
```
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
// LIBREQR SETTINGS
|
// LIBREQR SETTINGS
|
||||||
|
|
||||||
// Theme's directory name
|
// Theme's directory name
|
||||||
define("THEME", "libreqr");
|
define("THEME", "chapril");
|
||||||
|
|
||||||
// Language used if those requested by the user are not available
|
// Language used if those requested by the user are not available
|
||||||
define("DEFAULT_LOCALE", "en");
|
define("DEFAULT_LOCALE", "fr");
|
||||||
|
|
||||||
// Will be printed at the bottom of the interface
|
// Will be printed at the bottom of the interface
|
||||||
define("CUSTOM_TEXT_ENABLED", false);
|
define("CUSTOM_TEXT_ENABLED", true);
|
||||||
define("CUSTOM_TEXT", "This LibreQR instance is hosted by <a href='https://foo.example/'>foo</a>.");
|
define("CUSTOM_TEXT", "Ce service est fourni par l'association Chapril. Le code source de ce service est disponible <a href='https://forge.april.org/Algov/qrcode.chapril.org'>ici</a>.");
|
||||||
|
|
||||||
// Default values
|
// Default values
|
||||||
define("DEFAULT_REDUNDANCY", "high");
|
define("DEFAULT_REDUNDANCY", "high");
|
||||||
|
37
index.php
@ -10,7 +10,7 @@ use Endroid\QrCode\Color\Color;
|
|||||||
require "config.inc.php";
|
require "config.inc.php";
|
||||||
require "vendor/autoload.php";
|
require "vendor/autoload.php";
|
||||||
|
|
||||||
define("LIBREQR_VERSION", "2.0.0");
|
define("LIBREQR_VERSION", "2.0.1");
|
||||||
|
|
||||||
// Defines the locale to be used
|
// Defines the locale to be used
|
||||||
$locale = DEFAULT_LOCALE;
|
$locale = DEFAULT_LOCALE;
|
||||||
@ -74,7 +74,7 @@ if (
|
|||||||
exit("Wrong value for margin");
|
exit("Wrong value for margin");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_numeric($_POST['size']) AND $_POST['size'] >= 1 AND $_POST['size'] <= 4096) {
|
if (is_numeric($_POST['size']) AND $_POST['size'] >= 21 AND $_POST['size'] <= 4096) {
|
||||||
$params['size'] = $_POST['size'];
|
$params['size'] = $_POST['size'];
|
||||||
} else if (empty($_POST['size'])) {
|
} else if (empty($_POST['size'])) {
|
||||||
$params['size'] = NULL;
|
$params['size'] = NULL;
|
||||||
@ -166,14 +166,43 @@ $cssFileName = Less_Cache::Get(array("style.less" => ""), $options, $colorScheme
|
|||||||
foreach($themeDimensionsIcons as $dimFav) // Set all icons dimensions
|
foreach($themeDimensionsIcons as $dimFav) // Set all icons dimensions
|
||||||
echo ' <link rel="icon" type="image/png" href="themes/' . THEME . '/icons/' . $dimFav . '.png" sizes="' . $dimFav . 'x' . $dimFav . '">' . "\n";
|
echo ' <link rel="icon" type="image/png" href="themes/' . THEME . '/icons/' . $dimFav . '.png" sizes="' . $dimFav . 'x' . $dimFav . '">' . "\n";
|
||||||
?>
|
?>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/themes/chapril/chapril-banner.css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<nav class="chapril-banniere-Nav">
|
||||||
|
<div class="chapril-banniere-Logo" aria-hidden="true">
|
||||||
|
<a href="https://www.chapril.org"><img alt="" src="/themes/chapril/chapril-banner-logo.png"/></a>
|
||||||
|
</div>
|
||||||
|
<div class="chapril-banniere-Menu" aria-hidden="true">
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
<span></span>
|
||||||
|
</summary>
|
||||||
|
<div><a href="https://www.chapril.org/">Accueil Chapril</a></div>
|
||||||
|
<div><a href="https://www.chapril.org/services.html">Services libres</a></div>
|
||||||
|
<div><a href="https://pouet.april.org/@aprilorg">Nous suivre</a></div>
|
||||||
|
<div><a href="https://www.chapril.org/cgu.html">CGU</a></div>
|
||||||
|
<div><a href="https://www.chapril.org/a-propos.html">Mentions légales</a></div>
|
||||||
|
<div><a href="https://www.chapril.org/contact.html">Nous contacter</a></div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://www.chapril.org/" target="_blank">Accueil Chapril</a></div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://www.chapril.org/services.html" target="_blank">Services libres</a></div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://pouet.april.org/@aprilorg" target="_blank">Nous suivre</a></div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://www.chapril.org/cgu.html" target="_blank">CGU</a></div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://www.chapril.org/a-propos.html" target="_blank">Mentions légales</a></div>
|
||||||
|
<div class="chapril-banniere-Entree"><a href="https://www.chapril.org/contact.html" target="_blank">Nous contacter</a></div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<a id="linkTitles" href="./">
|
<a id="linkTitles" href="./">
|
||||||
|
<img alt="" id="logo" src="themes/chapril/logo-dark.png">
|
||||||
<div id="titles">
|
<div id="titles">
|
||||||
<h1>LibreQR</h1>
|
<h1>QrCodeChaprilOrg</h1>
|
||||||
<h2><?= $loc['subtitle'] ?></h2>
|
<h2><?= $loc['subtitle'] ?></h2>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@ -225,7 +254,7 @@ foreach($themeDimensionsIcons as $dimFav) // Set all icons dimensions
|
|||||||
<?= $loc['help_size'] ?>
|
<?= $loc['help_size'] ?>
|
||||||
</p>
|
</p>
|
||||||
</details>
|
</details>
|
||||||
<input type="number" id="size" placeholder="<?= DEFAULT_SIZE ?>" name="size" required="" min="1" max="4096" value="<?= htmlspecialchars($params['size']) ?>">
|
<input type="number" id="size" placeholder="<?= DEFAULT_SIZE ?>" name="size" required="" min="21" max="4096" value="<?= htmlspecialchars($params['size']) ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,7 +14,7 @@ $loc = array(
|
|||||||
|
|
||||||
'help_content' => "
|
'help_content' => "
|
||||||
<p>You can encode whatever text you want.</p>
|
<p>You can encode whatever text you want.</p>
|
||||||
<p>Software which decodes these QR codes could suggest to open them with dedicated software, depending on their <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes' hreflang='en' rel='help external noreferrer'>URI scheme</a>.</p>
|
<p>Software decoding these QR codes could suggest to open them with dedicated software, depending on their <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes' hreflang='en' rel='help external noreferrer'>URI scheme</a>.</p>
|
||||||
<p>For instance, to open a webpage: <code>https://www.example/</code></p>
|
<p>For instance, to open a webpage: <code>https://www.example/</code></p>
|
||||||
<p>To send an email: <code>mailto:contact@email.example</code></p>
|
<p>To send an email: <code>mailto:contact@email.example</code></p>
|
||||||
<p>To share geographic coordinates: <code>geo:48.867564,2.364057</code></p>
|
<p>To share geographic coordinates: <code>geo:48.867564,2.364057</code></p>
|
||||||
@ -33,10 +33,10 @@ $loc = array(
|
|||||||
|
|
||||||
'metaText_qr' => "
|
'metaText_qr' => "
|
||||||
<h3>What's a QR code?</h3>
|
<h3>What's a QR code?</h3>
|
||||||
A QR code is a 2 dimensional barcode in which text is written in binary. It can be decoded with a device equipped with a photo sensor and an adequate software.
|
A QR code is a 2 dimensional barcode in which text is written in binary. It can be decoded with a device equipped with a photo sensor and adequate software.
|
||||||
<a href='https://en.wikipedia.org/wiki/QR_code' hreflang='en' rel='help external noreferrer'>QR code on Wikipedia</a>.
|
<a href='https://en.wikipedia.org/wiki/QR_code' hreflang='en' rel='help external noreferrer'>QR code on Wikipedia</a>.
|
||||||
",
|
",
|
||||||
'metaText_legal' => "LibreQR " . LIBREQR_VERSION . " is a free software whose <a href='https://code.antopie.org/miraty/libreqr/' rel='external noreferrer'>source code</a> is available under the terms of the <abbr title='GNU Affero General Public License version 3 or any later version'><a href='LICENSE.html' hreflang='en' rel='license'>AGPLv3</a>+</abbr>.",
|
'metaText_legal' => "LibreQR " . LIBREQR_VERSION . " is free software whose <a href='https://code.antopie.org/miraty/libreqr/' rel='external noreferrer'>source code</a> is available under the terms of the <abbr title='GNU Affero General Public License version 3 or any later version'><a href='LICENSE.html' hreflang='en' rel='license'>AGPLv3</a>+</abbr>.",
|
||||||
|
|
||||||
'error_generation' => "An error occurred while generating the QR code. Try with different parameters.",
|
'error_generation' => "An error occurred while generating the QR code. Try with different parameters.",
|
||||||
);
|
);
|
||||||
|
42
locales/eu.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
||||||
|
$loc = array(
|
||||||
|
'subtitle' => "QR kode sortzailea",
|
||||||
|
'description' => "Sortu QR kodeak nahieran. Aukeratu edukia, neurria, kolorea…",
|
||||||
|
|
||||||
|
'label_content' => "Kodetzeko testua",
|
||||||
|
'label_redundancy' => "Erredundantzia-tasa",
|
||||||
|
'label_margin' => "Marjinaren tamaina",
|
||||||
|
'label_size' => "Irudiaren neurria",
|
||||||
|
'label_bgColor' => "Hondoaren kolorea",
|
||||||
|
'label_fgColor' => "Kolore nagusia",
|
||||||
|
|
||||||
|
'placeholder' => "Sartu QR kodean kodetzeko testua",
|
||||||
|
|
||||||
|
'help_content' => "
|
||||||
|
<p>Nahi duzun testua kodetu dezakezu.</p>
|
||||||
|
<p>QR kode horiek deskodetzen dituen softwareak software dedikatuarekin irekitzea iradoki lezake, <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes' hreflang='en' rel='help external noreferrer'>URI eskema</a>ren arabera.</p>
|
||||||
|
<p>Adibidez, webgune bat irekitzeko: <code>https://www.adibidea.eus/</code></p>
|
||||||
|
<p>ePosta bidaltzeko: <code>mailto:lur_axpe@adibidea.eus</code></p>
|
||||||
|
<p>Koordenatu geografikoak partekatzeko: <code>geo:42.895367,-2.167805</code></p>",
|
||||||
|
'help_redundancy' => "Erredundantzia QR kodearen informazioa bikoiztean datza, deskodetzean akatsak zuzentzeko. Tasa altuagoak QR kode handiagoa sortuko du, baina behar bezala deskodetzeko aukera handiagoa izango du.
|
||||||
|
",
|
||||||
|
'help_margin' => "QR kodearen inguruko banda zuriaren pixel kopurua.",
|
||||||
|
'help_size' => "Irudiaren zabalera eta altuera pixeletan, marjinarik gabe.",
|
||||||
|
|
||||||
|
'button_create' => "Sortu",
|
||||||
|
'button_download' => "Gorde QR kodea",
|
||||||
|
|
||||||
|
'title_showOnlyQR' => "Erakutsi QR kode hau bakarrik",
|
||||||
|
|
||||||
|
'alt_QR_before' => 'QR kodearen esanahia "',
|
||||||
|
'alt_QR_after' => '"',
|
||||||
|
|
||||||
|
'metaText_qr' => "
|
||||||
|
<h3>Zer da QR kode bat?</h3>
|
||||||
|
QR kodea bi dimentsioko barra-kodea da, testua bitarrean idatzita duena. Argazki-sentsore bat eta software egokia dituen gailu batekin deskodetzen da.
|
||||||
|
<a href='https://eu.wikipedia.org/wiki/QR_kode' hreflang='eu' rel='help external noreferrer'>QR kodea Wikipedian</a>.
|
||||||
|
",
|
||||||
|
'metaText_legal' => "LibreQR " . LIBREQR_VERSION . " software librea da, eta <a href='https://code.antopie.org/miraty/libreqr/' rel='external noreferrer'>iturburu-kodea</a> <abbr title='GNU Affero Lizentzia Publiko Orokorraren 3. bertsioaren edo ondorengo edozein bertsio'><a href='LICENSE.html' hreflang='en' rel='license'>AGPLv3</a>+</abbr>ren arabera dago eskuragarri.",
|
||||||
|
|
||||||
|
'error_generation' => "Errorea gertatu da QR kodea sortzerakoan. Saiatu berriro parametro desberdinak erabiliz.",
|
||||||
|
);
|
42
locales/id.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
||||||
|
$loc = array(
|
||||||
|
'subtitle' => "Pembuat kode QR",
|
||||||
|
'description' => "Membuat kode QR dengan bebas. Pilih konten, ukuran warna, ...",
|
||||||
|
|
||||||
|
'label_content' => "Teks untuk dienkode",
|
||||||
|
'label_redundancy' => "Tingkat redundansi",
|
||||||
|
'label_margin' => "Ukuran tepi",
|
||||||
|
'label_size' => "Ukuran gambar",
|
||||||
|
'label_bgColor' => "Warna latar belakang",
|
||||||
|
'label_fgColor' => "Warna latar depan",
|
||||||
|
|
||||||
|
'placeholder' => "Masukkan teks untuk dienkode di kode QR",
|
||||||
|
|
||||||
|
'help_content' => "
|
||||||
|
<p>Anda bisa mengenkode teks apa pun.</p>
|
||||||
|
<p>Perangkat lunak yang mendekodekan kode QR tersebut bisa memberikan pilihan untuk membuka dengan perangkat lunak tertentu, tergantung pada <a href='https://en.wikipedia.org/wiki/List_of_URI_schemes' hreflang='en' rel='help external noreferrer'>Skema URI</a> mereka.</p>
|
||||||
|
<p>Contohnya, untuk membuka halaman situs: <code>https://www.contoh.id/</code></p>
|
||||||
|
<p>Untuk mengirim surel: <code>mailto:contact@email.example</code></p>
|
||||||
|
<p>Untuk membagikan koordinat geografik: <code>geo:48.867564,2.364057</code></p>
|
||||||
|
",
|
||||||
|
'help_redundancy' => "Redundansi adalah duplikasi informasi di kode QR untuk memperbaiki galat saat pendekodean. Tingkat lebih besar akan menghasilkan kode QR yang lebih besar, tetapi akan dapat hasil lebih baik untuk didekodekan dengan benar.",
|
||||||
|
'help_margin' => "Jumlah piksel di tepi putih di sekitar kode QR.",
|
||||||
|
'help_size' => "Tinggi dan lebar gambar dalam piksel, tanpa tepian.",
|
||||||
|
|
||||||
|
'button_create' => "Buat",
|
||||||
|
'button_download' => "Simpan kode QR ini",
|
||||||
|
|
||||||
|
'title_showOnlyQR' => "Tampilkan kode QR ini saja",
|
||||||
|
|
||||||
|
'alt_QR_before' => 'Arti kode QR "',
|
||||||
|
'alt_QR_after' => '"',
|
||||||
|
|
||||||
|
'metaText_qr' => "
|
||||||
|
<h3>Apa itu Kode QR?</h3>
|
||||||
|
Kode QR adalah kode batang 2 dimensi yang mana teks ditulis dalam biner. Bisa didekodekan dengan perangkat yang memiliki sensor foto dan perangkat lunak yang memadai.
|
||||||
|
<a href='https://id.wikipedia.org/wiki/Kode_QR' hreflang='id' rel='help external noreferrer'>Kode QR di Wikipedia</a>.
|
||||||
|
",
|
||||||
|
'metaText_legal' => "LibreQR " . LIBREQR_VERSION . " adalah perangkat lunak bebas yang <a href='https://code.antopie.org/miraty/libreqr/' rel='external noreferrer'>kode sumber</a> tersedia di bawah ketentuan <abbr title='GNU Affero General Public License versi 3 atau selanjutnya version'><a href='LICENSE.html' hreflang='en' rel='license'>AGPLv3</a>+</abbr>.",
|
||||||
|
|
||||||
|
'error_generation' => "Galat terjadi ketika membuat kode QR. Coba dengan parameter yang berbeda.",
|
||||||
|
);
|
BIN
themes/chapril/chapril-banner-logo.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
162
themes/chapril/chapril-banner.css
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
____ _ _ _ _ ____ ____ ____
|
||||||
|
/ ___| |__ __ _ _ __ _ __(_) | | |__ __ _ _ __ _ __ ___ _ __ / ___/ ___/ ___|
|
||||||
|
| | | '_ \ / _` | '_ \| '__| | | | '_ \ / _` | '_ \| '_ \ / _ \ '__| | | \___ \___ \
|
||||||
|
| |___| | | | (_| | |_) | | | | | | |_) | (_| | | | | | | | __/ | | |___ ___) |__) |
|
||||||
|
\____|_| |_|\__,_| .__/|_| |_|_| |_.__/ \__,_|_| |_|_| |_|\___|_| \____|____/____/
|
||||||
|
|_|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/********************************
|
||||||
|
* Ajustement global
|
||||||
|
*******************************/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin-top: 0;
|
||||||
|
padding-top: 42px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************
|
||||||
|
* Classes .chapril-banniere-
|
||||||
|
*******************************/
|
||||||
|
|
||||||
|
.chapril-banniere-Entree {
|
||||||
|
font-family: sans-serif;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Logo {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Logo a {
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Logo img {
|
||||||
|
display: block;
|
||||||
|
width: auto;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Nav {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
min-height: 42px;
|
||||||
|
background-color: #005184;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Nav a, .chapril-banniere-Nav a:visited {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Nav a:hover {
|
||||||
|
color: #ff9759;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 800px) {
|
||||||
|
|
||||||
|
.chapril-banniere-Entree {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Logo {
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Logo a {
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary {
|
||||||
|
height: 26px;
|
||||||
|
width: 30px;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 12px;
|
||||||
|
border-radius: 2px;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-color: #fff;
|
||||||
|
padding-left: 4px;
|
||||||
|
padding-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary span {
|
||||||
|
display: block;
|
||||||
|
margin-top: 4px;
|
||||||
|
width: 20px;
|
||||||
|
height: 2px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary:hover {
|
||||||
|
border-color: #ff9759;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu summary:hover span {
|
||||||
|
background-color: #ff9759;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Menu div {
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #153a6a;
|
||||||
|
border-top: 1px solid #005184;
|
||||||
|
font-family: sans-serif;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapril-banniere-Nav {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************
|
||||||
|
* Adaptation pour certains services
|
||||||
|
************************************
|
||||||
|
|
||||||
|
/* Dokuwiki. */
|
||||||
|
#dokuwiki__usertools {
|
||||||
|
top: 43px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PAD. */
|
||||||
|
#editorcontainerbox {
|
||||||
|
top: 43px !important;
|
||||||
|
}
|
BIN
themes/chapril/icons/128.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
themes/chapril/icons/16.png
Normal file
After Width: | Height: | Size: 1005 B |
BIN
themes/chapril/icons/192.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
themes/chapril/icons/256.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
themes/chapril/icons/32.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
themes/chapril/icons/384.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
themes/chapril/icons/48.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
themes/chapril/icons/512.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
themes/chapril/icons/64.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
themes/chapril/icons/96.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
themes/chapril/icons/source.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
themes/chapril/logo-dark.png
Normal file
After Width: | Height: | Size: 62 KiB |
1
themes/chapril/logo-light.png
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
logo-dark.png
|
6
themes/chapril/logo.less
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
:root{
|
||||||
|
#logo{
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
}
|
||||||
|
}
|
36
themes/chapril/theme.php
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
||||||
|
|
||||||
|
// List icons dimensions
|
||||||
|
$themeDimensionsIcons = array(16, 32, 48, 64, 96, 128, 192, 256, 384, 512);
|
||||||
|
|
||||||
|
$colorScheme = array(
|
||||||
|
// Light theme
|
||||||
|
"text-light" => "white",
|
||||||
|
"bg-light" => "#67a3f2", // Must be a long hexadecimal color
|
||||||
|
"bgField-light" => "#2e5281",
|
||||||
|
"bgHelp-light" => "#2e5281",
|
||||||
|
"bgTextarea-light" => "#FFFFFF",
|
||||||
|
"textareaText-light" => "black",
|
||||||
|
"textareaPlaceholder-light" => "grey",
|
||||||
|
"border-light" => "#67a3f2",
|
||||||
|
"borderHover-light" => "white",
|
||||||
|
"borderFocus-light" => "white",
|
||||||
|
"borderHelp-light" => "white",
|
||||||
|
"borderQr-light" => "white",
|
||||||
|
// Dark theme
|
||||||
|
"text-dark" => "white",
|
||||||
|
"bg-dark" => "#67a3f2", // Must be a long hexadecimal color
|
||||||
|
"bgField-dark" => "#2e5281",
|
||||||
|
"bgHelp-dark" => "#2e5281",
|
||||||
|
"bgTextarea-dark" => "#FFFFFF",
|
||||||
|
"textareaText-dark" => "black",
|
||||||
|
"textareaPlaceholder-dark" => "grey",
|
||||||
|
"border-dark" => "#67a3f2",
|
||||||
|
"borderWidth-dark" => "2px",
|
||||||
|
"borderHover-dark" => "white",
|
||||||
|
"borderHoverWidth-dark" => "3px",
|
||||||
|
"borderFocus-dark" => "white",
|
||||||
|
"borderFocusWidth-dark" => "4px",
|
||||||
|
"borderHelp-dark" => "white",
|
||||||
|
"borderQr-dark" => "white",
|
||||||
|
);
|
Before Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 727 B |
@ -1,259 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg height="16" width="16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="1" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="5" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="0" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="1" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="1" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="1" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="11" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="1" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="1" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="1" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="2" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="2" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="2" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="2" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="2" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="2" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="3" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="3" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="4" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="4" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="6" y="5" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="5" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="11" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="5" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="5" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="5" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="1" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="5" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="6" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="6" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="11" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="6" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="6" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="6" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="7" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="7" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="1" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="5" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="8" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="8" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="1" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="9" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="9" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="5" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="9" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="9" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="11" y="9" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="9" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="6" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="10" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="10" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="6" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="11" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="11" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="6" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="10" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="12" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="12" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="7" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="8" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="9" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="12" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="13" y="13" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="13" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="1" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="2" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="3" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="4" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="5" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="11" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="14" />
|
|
||||||
<rect fill="#fff" height="1" width="1" x="14" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="14" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="0" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="1" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="2" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="3" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="4" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="5" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="6" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="7" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="8" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="9" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="10" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="11" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="12" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="13" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="14" y="15" />
|
|
||||||
<rect fill="#000" height="1" width="1" x="15" y="15" />
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 163 B |
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
:root {
|
|
||||||
// base64 -w 0 logo-light.png
|
|
||||||
--logo-light: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQMAAACQp+OdAAAABlBMVEX///8AAABVwtN+AAAAWElEQVQoz43O0RHAMAgCUDZg/y3ZgKJtP8PF/LzkiApcFG3IVgVICB0cqCPH368jMvCffsLuPWMLmOQ+FMBxNqvgXCZ8xixGsSNppWsF33hFaLjD27Xioh5ZH8ftcymlGAAAAABJRU5ErkJggg==");
|
|
||||||
// base64 -w 0 logo-dark.png
|
|
||||||
--logo-dark: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABAAQMAAACQp+OdAAAABlBMVEX///8AAABVwtN+AAAAXklEQVQoz43SsRHAIAxDUW3g/bfUBoqckDL/AgWvMFgcKGcIYCkjDSJ2JgwvhhFHZ9cn2vDt/oUNvkcS3MpNRuh0ew6iyyYjbDCPGa2+WxL8lCN6vZYy+nBxED/+xgWM9DYk64ncIgAAAABJRU5ErkJggg==");
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
|
||||||
|
|
||||||
// List icons dimensions
|
|
||||||
$themeDimensionsIcons = array(16, 32, 48, 64, 96, 128, 192, 256, 384, 512);
|
|
||||||
|
|
||||||
$colorScheme = array(
|
|
||||||
// Light theme
|
|
||||||
"text-light" => "black",
|
|
||||||
"bg-light" => "#ffffff", // Must be a long hexadecimal color
|
|
||||||
"bgField-light" => "white",
|
|
||||||
"bgHelp-light" => "white",
|
|
||||||
"bgTextarea-light" => "white",
|
|
||||||
"textareaText-light" => "black",
|
|
||||||
"textareaPlaceholder-light" => "#868686",
|
|
||||||
"border-light" => "black",
|
|
||||||
"borderHover-light" => "black",
|
|
||||||
"borderFocus-light" => "black",
|
|
||||||
"borderHelp-light" => "black",
|
|
||||||
"borderQr-light" => "black",
|
|
||||||
// Dark theme
|
|
||||||
"text-dark" => "white",
|
|
||||||
"bg-dark" => "#000000", // Must be a long hexadecimal color
|
|
||||||
"bgField-dark" => "#000000",
|
|
||||||
"bgHelp-dark" => "#000000",
|
|
||||||
"bgTextarea-dark" => "#000000",
|
|
||||||
"textareaText-dark" => "white",
|
|
||||||
"textareaPlaceholder-dark" => "#bababa",
|
|
||||||
"border-dark" => "white",
|
|
||||||
"borderWidth-dark" => "2px",
|
|
||||||
"borderHover-dark" => "white",
|
|
||||||
"borderHoverWidth-dark" => "3px",
|
|
||||||
"borderFocus-dark" => "white",
|
|
||||||
"borderFocusWidth-dark" => "4px",
|
|
||||||
"borderHelp-dark" => "white",
|
|
||||||
"borderQr-dark" => "white",
|
|
||||||
);
|
|
19
vendor/autoload.php
vendored
@ -3,10 +3,23 @@
|
|||||||
// autoload.php @generated by Composer
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50600) {
|
if (PHP_VERSION_ID < 50600) {
|
||||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
if (!headers_sent()) {
|
||||||
exit(1);
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
}
|
||||||
|
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||||
|
if (!ini_get('display_errors')) {
|
||||||
|
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||||
|
fwrite(STDERR, $err);
|
||||||
|
} elseif (!headers_sent()) {
|
||||||
|
echo $err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trigger_error(
|
||||||
|
$err,
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInit6bb82695b2f28e8ee61f74ae2d5c5202::getLoader();
|
return ComposerAutoloaderInitd4957e04ba4dff37d0ecbf0a4b59e14a::getLoader();
|
||||||
|
6
vendor/bacon/bacon-qr-code/composer.json
vendored
@ -34,5 +34,11 @@
|
|||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"ocramius/package-versions": true
|
"ocramius/package-versions": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"archive": {
|
||||||
|
"exclude": [
|
||||||
|
"/test",
|
||||||
|
"/phpunit.xml.dist"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
vendor/bacon/bacon-qr-code/phpunit.xml.dist
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
|
||||||
|
<coverage processUncoveredFiles="true">
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">src</directory>
|
||||||
|
</include>
|
||||||
|
</coverage>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="BaconQrCode Tests">
|
||||||
|
<directory>./test</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
</phpunit>
|
@ -89,6 +89,9 @@ final class CharacterSetEci extends AbstractEnum
|
|||||||
*/
|
*/
|
||||||
private static $nameToEci;
|
private static $nameToEci;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int[] $values
|
||||||
|
*/
|
||||||
public function __construct(array $values, string ...$otherEncodingNames)
|
public function __construct(array $values, string ...$otherEncodingNames)
|
||||||
{
|
{
|
||||||
$this->values = $values;
|
$this->values = $values;
|
||||||
|
@ -62,7 +62,7 @@ class FormatInformation
|
|||||||
/**
|
/**
|
||||||
* Offset i holds the number of 1 bits in the binary representation of i.
|
* Offset i holds the number of 1 bits in the binary representation of i.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var int[]
|
||||||
*/
|
*/
|
||||||
private const BITS_SET_IN_HALF_BYTE = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
|
private const BITS_SET_IN_HALF_BYTE = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4];
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@ final class Mode extends AbstractEnum
|
|||||||
*/
|
*/
|
||||||
private $bits;
|
private $bits;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int[] $characterCountBitsForVersions
|
||||||
|
*/
|
||||||
protected function __construct(array $characterCountBitsForVersions, int $bits)
|
protected function __construct(array $characterCountBitsForVersions, int $bits)
|
||||||
{
|
{
|
||||||
$this->characterCountBitsForVersions = $characterCountBitsForVersions;
|
$this->characterCountBitsForVersions = $characterCountBitsForVersions;
|
||||||
|
@ -37,7 +37,7 @@ final class Encoder
|
|||||||
/**
|
/**
|
||||||
* Codec cache.
|
* Codec cache.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array<string,ReedSolomonCodec>
|
||||||
*/
|
*/
|
||||||
private static $codecs = [];
|
private static $codecs = [];
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ final class SvgImageBackEnd implements ImageBackEndInterface
|
|||||||
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($startColor));
|
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($startColor));
|
||||||
|
|
||||||
if ($startColor instanceof Alpha) {
|
if ($startColor instanceof Alpha) {
|
||||||
$this->xmlWriter->writeAttribute('stop-opacity', $startColor->getAlpha());
|
$this->xmlWriter->writeAttribute('stop-opacity', (string) $startColor->getAlpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->xmlWriter->endElement();
|
$this->xmlWriter->endElement();
|
||||||
@ -344,7 +344,7 @@ final class SvgImageBackEnd implements ImageBackEndInterface
|
|||||||
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($endColor));
|
$this->xmlWriter->writeAttribute('stop-color', $this->getColorString($endColor));
|
||||||
|
|
||||||
if ($endColor instanceof Alpha) {
|
if ($endColor instanceof Alpha) {
|
||||||
$this->xmlWriter->writeAttribute('stop-opacity', $endColor->getAlpha());
|
$this->xmlWriter->writeAttribute('stop-opacity', (string) $endColor->getAlpha());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->xmlWriter->endElement();
|
$this->xmlWriter->endElement();
|
||||||
|
@ -41,7 +41,7 @@ final class EdgeIterator implements IteratorAggregate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Edge[]
|
* @return Traversable<Edge>
|
||||||
*/
|
*/
|
||||||
public function getIterator() : Traversable
|
public function getIterator() : Traversable
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,7 @@ final class EllipticArc implements OperationInterface
|
|||||||
/**
|
/**
|
||||||
* @return Curve[]
|
* @return Curve[]
|
||||||
*/
|
*/
|
||||||
private function createCurves(float $fromX, $fromY) : array
|
private function createCurves(float $fromX, float $fromY) : array
|
||||||
{
|
{
|
||||||
$xAngle = deg2rad($this->xAxisAngle);
|
$xAngle = deg2rad($this->xAxisAngle);
|
||||||
list($centerX, $centerY, $radiusX, $radiusY, $startAngle, $deltaAngle) =
|
list($centerX, $centerY, $radiusX, $radiusY, $startAngle, $deltaAngle) =
|
||||||
|
@ -17,10 +17,16 @@ use BaconQrCode\Writer;
|
|||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Spatie\Snapshots\MatchesSnapshots;
|
use Spatie\Snapshots\MatchesSnapshots;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group integration
|
||||||
|
*/
|
||||||
final class ImagickRenderingTest extends TestCase
|
final class ImagickRenderingTest extends TestCase
|
||||||
{
|
{
|
||||||
use MatchesSnapshots;
|
use MatchesSnapshots;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @requires extension imagick
|
||||||
|
*/
|
||||||
public function testGenericQrCode() : void
|
public function testGenericQrCode() : void
|
||||||
{
|
{
|
||||||
$renderer = new ImageRenderer(
|
$renderer = new ImageRenderer(
|
||||||
@ -35,6 +41,9 @@ final class ImagickRenderingTest extends TestCase
|
|||||||
unlink($tempName);
|
unlink($tempName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @requires extension imagick
|
||||||
|
*/
|
||||||
public function testIssue79() : void
|
public function testIssue79() : void
|
||||||
{
|
{
|
||||||
$eye = SquareEye::instance();
|
$eye = SquareEye::instance();
|
||||||
|
10
vendor/bin/lessc
vendored
@ -108,10 +108,12 @@ if (PHP_VERSION_ID < 80000) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
|
if (
|
||||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/wikimedia/less.php/bin/lessc');
|
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||||
exit(0);
|
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||||
|
) {
|
||||||
|
return include("phpvfscomposer://" . __DIR__ . '/..'.'/wikimedia/less.php/bin/lessc');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include __DIR__ . '/..'.'/wikimedia/less.php/bin/lessc';
|
return include __DIR__ . '/..'.'/wikimedia/less.php/bin/lessc';
|
||||||
|
109
vendor/composer/ClassLoader.php
vendored
@ -42,35 +42,37 @@ namespace Composer\Autoload;
|
|||||||
*/
|
*/
|
||||||
class ClassLoader
|
class ClassLoader
|
||||||
{
|
{
|
||||||
/** @var ?string */
|
/** @var \Closure(string):void */
|
||||||
|
private static $includeFile;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
private $vendorDir;
|
private $vendorDir;
|
||||||
|
|
||||||
// PSR-4
|
// PSR-4
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var array<string, array<string, int>>
|
||||||
* @psalm-var array<string, array<string, int>>
|
|
||||||
*/
|
*/
|
||||||
private $prefixLengthsPsr4 = array();
|
private $prefixLengthsPsr4 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var array<string, list<string>>
|
||||||
* @psalm-var array<string, array<int, string>>
|
|
||||||
*/
|
*/
|
||||||
private $prefixDirsPsr4 = array();
|
private $prefixDirsPsr4 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var list<string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $fallbackDirsPsr4 = array();
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
// PSR-0
|
// PSR-0
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* List of PSR-0 prefixes
|
||||||
* @psalm-var array<string, array<string, string[]>>
|
*
|
||||||
|
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||||
|
*
|
||||||
|
* @var array<string, array<string, list<string>>>
|
||||||
*/
|
*/
|
||||||
private $prefixesPsr0 = array();
|
private $prefixesPsr0 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var list<string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $fallbackDirsPsr0 = array();
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
@ -78,8 +80,7 @@ class ClassLoader
|
|||||||
private $useIncludePath = false;
|
private $useIncludePath = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var array<string, string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $classMap = array();
|
private $classMap = array();
|
||||||
|
|
||||||
@ -87,29 +88,29 @@ class ClassLoader
|
|||||||
private $classMapAuthoritative = false;
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool[]
|
* @var array<string, bool>
|
||||||
* @psalm-var array<string, bool>
|
|
||||||
*/
|
*/
|
||||||
private $missingClasses = array();
|
private $missingClasses = array();
|
||||||
|
|
||||||
/** @var ?string */
|
/** @var string|null */
|
||||||
private $apcuPrefix;
|
private $apcuPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var self[]
|
* @var array<string, self>
|
||||||
*/
|
*/
|
||||||
private static $registeredLoaders = array();
|
private static $registeredLoaders = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ?string $vendorDir
|
* @param string|null $vendorDir
|
||||||
*/
|
*/
|
||||||
public function __construct($vendorDir = null)
|
public function __construct($vendorDir = null)
|
||||||
{
|
{
|
||||||
$this->vendorDir = $vendorDir;
|
$this->vendorDir = $vendorDir;
|
||||||
|
self::initializeIncludeClosure();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[]
|
* @return array<string, list<string>>
|
||||||
*/
|
*/
|
||||||
public function getPrefixes()
|
public function getPrefixes()
|
||||||
{
|
{
|
||||||
@ -121,8 +122,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return array<string, list<string>>
|
||||||
* @psalm-return array<string, array<int, string>>
|
|
||||||
*/
|
*/
|
||||||
public function getPrefixesPsr4()
|
public function getPrefixesPsr4()
|
||||||
{
|
{
|
||||||
@ -130,8 +130,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return list<string>
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getFallbackDirs()
|
public function getFallbackDirs()
|
||||||
{
|
{
|
||||||
@ -139,8 +138,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return list<string>
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getFallbackDirsPsr4()
|
public function getFallbackDirsPsr4()
|
||||||
{
|
{
|
||||||
@ -148,8 +146,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[] Array of classname => path
|
* @return array<string, string> Array of classname => path
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getClassMap()
|
public function getClassMap()
|
||||||
{
|
{
|
||||||
@ -157,8 +154,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string[] $classMap Class to filename map
|
* @param array<string, string> $classMap Class to filename map
|
||||||
* @psalm-param array<string, string> $classMap
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -176,23 +172,24 @@ class ClassLoader
|
|||||||
* appending or prepending to the ones previously set for this prefix.
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param string[]|string $paths The PSR-0 root directories
|
* @param list<string>|string $paths The PSR-0 root directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function add($prefix, $paths, $prepend = false)
|
public function add($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
|
$paths = (array) $paths;
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->fallbackDirsPsr0
|
$this->fallbackDirsPsr0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$this->fallbackDirsPsr0,
|
$this->fallbackDirsPsr0,
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,19 +198,19 @@ class ClassLoader
|
|||||||
|
|
||||||
$first = $prefix[0];
|
$first = $prefix[0];
|
||||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->prefixesPsr0[$first][$prefix]
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$this->prefixesPsr0[$first][$prefix],
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +220,7 @@ class ClassLoader
|
|||||||
* appending or prepending to the ones previously set for this namespace.
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param string[]|string $paths The PSR-4 base directories
|
* @param list<string>|string $paths The PSR-4 base directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
@ -232,17 +229,18 @@ class ClassLoader
|
|||||||
*/
|
*/
|
||||||
public function addPsr4($prefix, $paths, $prepend = false)
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
|
$paths = (array) $paths;
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
// Register directories for the root namespace.
|
// Register directories for the root namespace.
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->fallbackDirsPsr4
|
$this->fallbackDirsPsr4
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$this->fallbackDirsPsr4,
|
$this->fallbackDirsPsr4,
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
@ -252,18 +250,18 @@ class ClassLoader
|
|||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
}
|
}
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||||
} elseif ($prepend) {
|
} elseif ($prepend) {
|
||||||
// Prepend directories for an already registered namespace.
|
// Prepend directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->prefixDirsPsr4[$prefix]
|
$this->prefixDirsPsr4[$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Append directories for an already registered namespace.
|
// Append directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$this->prefixDirsPsr4[$prefix],
|
$this->prefixDirsPsr4[$prefix],
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,7 +271,7 @@ class ClassLoader
|
|||||||
* replacing any others previously set for this prefix.
|
* replacing any others previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param string[]|string $paths The PSR-0 base directories
|
* @param list<string>|string $paths The PSR-0 base directories
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -291,7 +289,7 @@ class ClassLoader
|
|||||||
* replacing any others previously set for this namespace.
|
* replacing any others previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param string[]|string $paths The PSR-4 base directories
|
* @param list<string>|string $paths The PSR-4 base directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
*
|
||||||
@ -425,7 +423,8 @@ class ClassLoader
|
|||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
{
|
{
|
||||||
if ($file = $this->findFile($class)) {
|
if ($file = $this->findFile($class)) {
|
||||||
includeFile($file);
|
$includeFile = self::$includeFile;
|
||||||
|
$includeFile($file);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -476,9 +475,9 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||||
*
|
*
|
||||||
* @return self[]
|
* @return array<string, self>
|
||||||
*/
|
*/
|
||||||
public static function getRegisteredLoaders()
|
public static function getRegisteredLoaders()
|
||||||
{
|
{
|
||||||
@ -555,18 +554,26 @@ class ClassLoader
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private static function initializeIncludeClosure()
|
||||||
|
{
|
||||||
|
if (self::$includeFile !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Scope isolated include.
|
* Scope isolated include.
|
||||||
*
|
*
|
||||||
* Prevents access to $this/self from included files.
|
* Prevents access to $this/self from included files.
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return void
|
* @return void
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
function includeFile($file)
|
self::$includeFile = \Closure::bind(static function($file) {
|
||||||
{
|
|
||||||
include $file;
|
include $file;
|
||||||
|
}, null, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
15
vendor/composer/InstalledVersions.php
vendored
@ -98,7 +98,7 @@ class InstalledVersions
|
|||||||
{
|
{
|
||||||
foreach (self::getInstalled() as $installed) {
|
foreach (self::getInstalled() as $installed) {
|
||||||
if (isset($installed['versions'][$packageName])) {
|
if (isset($installed['versions'][$packageName])) {
|
||||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class InstalledVersions
|
|||||||
*/
|
*/
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
{
|
{
|
||||||
$constraint = $parser->parseConstraints($constraint);
|
$constraint = $parser->parseConstraints((string) $constraint);
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
return $provided->matches($constraint);
|
||||||
@ -328,7 +328,9 @@ class InstalledVersions
|
|||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require $vendorDir.'/composer/installed.php';
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
self::$installed = $installed[count($installed) - 1];
|
self::$installed = $installed[count($installed) - 1];
|
||||||
}
|
}
|
||||||
@ -340,12 +342,17 @@ class InstalledVersions
|
|||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
self::$installed = require __DIR__ . '/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require __DIR__ . '/installed.php';
|
||||||
|
self::$installed = $required;
|
||||||
} else {
|
} else {
|
||||||
self::$installed = array();
|
self::$installed = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self::$installed !== array()) {
|
||||||
$installed[] = self::$installed;
|
$installed[] = self::$installed;
|
||||||
|
}
|
||||||
|
|
||||||
return $installed;
|
return $installed;
|
||||||
}
|
}
|
||||||
|
8
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInit6bb82695b2f28e8ee61f74ae2d5c5202
|
class ComposerAutoloaderInitd4957e04ba4dff37d0ecbf0a4b59e14a
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -24,12 +24,12 @@ class ComposerAutoloaderInit6bb82695b2f28e8ee61f74ae2d5c5202
|
|||||||
|
|
||||||
require __DIR__ . '/platform_check.php';
|
require __DIR__ . '/platform_check.php';
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit6bb82695b2f28e8ee61f74ae2d5c5202', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInitd4957e04ba4dff37d0ecbf0a4b59e14a', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInit6bb82695b2f28e8ee61f74ae2d5c5202', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInitd4957e04ba4dff37d0ecbf0a4b59e14a', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
require __DIR__ . '/autoload_static.php';
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a::getInitializer($loader));
|
||||||
|
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
|
10
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202
|
class ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a
|
||||||
{
|
{
|
||||||
public static $prefixLengthsPsr4 = array (
|
public static $prefixLengthsPsr4 = array (
|
||||||
'E' =>
|
'E' =>
|
||||||
@ -54,10 +54,10 @@ class ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a::$prefixDirsPsr4;
|
||||||
$loader->prefixesPsr0 = ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202::$prefixesPsr0;
|
$loader->prefixesPsr0 = ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a::$prefixesPsr0;
|
||||||
$loader->classMap = ComposerStaticInit6bb82695b2f28e8ee61f74ae2d5c5202::$classMap;
|
$loader->classMap = ComposerStaticInitd4957e04ba4dff37d0ecbf0a4b59e14a::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
84
vendor/composer/installed.json
vendored
@ -2,17 +2,17 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "bacon/bacon-qr-code",
|
"name": "bacon/bacon-qr-code",
|
||||||
"version": "2.0.7",
|
"version": "2.0.8",
|
||||||
"version_normalized": "2.0.7.0",
|
"version_normalized": "2.0.8.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Bacon/BaconQrCode.git",
|
"url": "https://github.com/Bacon/BaconQrCode.git",
|
||||||
"reference": "d70c840f68657ce49094b8d91f9ee0cc07fbf66c"
|
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/d70c840f68657ce49094b8d91f9ee0cc07fbf66c",
|
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
|
||||||
"reference": "d70c840f68657ce49094b8d91f9ee0cc07fbf66c",
|
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-imagick": "to generate QR code images"
|
"ext-imagick": "to generate QR code images"
|
||||||
},
|
},
|
||||||
"time": "2022-03-14T02:02:36+00:00",
|
"time": "2022-12-07T17:46:57+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -53,30 +53,33 @@
|
|||||||
"homepage": "https://github.com/Bacon/BaconQrCode",
|
"homepage": "https://github.com/Bacon/BaconQrCode",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/Bacon/BaconQrCode/issues",
|
"issues": "https://github.com/Bacon/BaconQrCode/issues",
|
||||||
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.7"
|
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8"
|
||||||
},
|
},
|
||||||
"install-path": "../bacon/bacon-qr-code"
|
"install-path": "../bacon/bacon-qr-code"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dasprid/enum",
|
"name": "dasprid/enum",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"version_normalized": "1.0.3.0",
|
"version_normalized": "1.0.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/DASPRiD/Enum.git",
|
"url": "https://github.com/DASPRiD/Enum.git",
|
||||||
"reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2"
|
"reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2",
|
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
|
||||||
"reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2",
|
"reference": "8e6b6ea76eabbf19ea2bf5b67b98e1860474012f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1 <9.0"
|
||||||
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7 | ^8 | ^9",
|
"phpunit/phpunit": "^7 | ^8 | ^9",
|
||||||
"squizlabs/php_codesniffer": "^3.4"
|
"squizlabs/php_codesniffer": "*"
|
||||||
},
|
},
|
||||||
"time": "2020-10-02T16:03:48+00:00",
|
"time": "2023-03-01T18:44:03+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -103,33 +106,36 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/DASPRiD/Enum/issues",
|
"issues": "https://github.com/DASPRiD/Enum/issues",
|
||||||
"source": "https://github.com/DASPRiD/Enum/tree/1.0.3"
|
"source": "https://github.com/DASPRiD/Enum/tree/1.0.4"
|
||||||
},
|
},
|
||||||
"install-path": "../dasprid/enum"
|
"install-path": "../dasprid/enum"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "endroid/qr-code",
|
"name": "endroid/qr-code",
|
||||||
"version": "4.4.9",
|
"version": "4.8.2",
|
||||||
"version_normalized": "4.4.9.0",
|
"version_normalized": "4.8.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/endroid/qr-code.git",
|
"url": "https://github.com/endroid/qr-code.git",
|
||||||
"reference": "bf087fa1e93a1b7310e2d94d187e26ae51db199d"
|
"reference": "2436c2333a3931c95e2b96eb82f16f53143d6bba"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/endroid/qr-code/zipball/bf087fa1e93a1b7310e2d94d187e26ae51db199d",
|
"url": "https://api.github.com/repos/endroid/qr-code/zipball/2436c2333a3931c95e2b96eb82f16f53143d6bba",
|
||||||
"reference": "bf087fa1e93a1b7310e2d94d187e26ae51db199d",
|
"reference": "2436c2333a3931c95e2b96eb82f16f53143d6bba",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"bacon/bacon-qr-code": "^2.0.5",
|
"bacon/bacon-qr-code": "^2.0.5",
|
||||||
"php": "^7.4||^8.0"
|
"php": "^8.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"khanamiryan/qrcode-detector-decoder": "^1.0.6"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"endroid/quality": "dev-master",
|
"endroid/quality": "dev-master",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"khanamiryan/qrcode-detector-decoder": "^1.0.4",
|
"khanamiryan/qrcode-detector-decoder": "^1.0.4||^2.0.2",
|
||||||
"setasign/fpdf": "^1.8.2"
|
"setasign/fpdf": "^1.8.2"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
@ -138,7 +144,7 @@
|
|||||||
"roave/security-advisories": "Makes sure package versions with known security issues are not installed",
|
"roave/security-advisories": "Makes sure package versions with known security issues are not installed",
|
||||||
"setasign/fpdf": "Enables you to use the PDF writer"
|
"setasign/fpdf": "Enables you to use the PDF writer"
|
||||||
},
|
},
|
||||||
"time": "2022-05-10T07:25:08+00:00",
|
"time": "2023-03-30T18:46:02+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
@ -172,7 +178,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/endroid/qr-code/issues",
|
"issues": "https://github.com/endroid/qr-code/issues",
|
||||||
"source": "https://github.com/endroid/qr-code/tree/4.4.9"
|
"source": "https://github.com/endroid/qr-code/tree/4.8.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -184,30 +190,31 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wikimedia/less.php",
|
"name": "wikimedia/less.php",
|
||||||
"version": "v3.1.0",
|
"version": "v3.2.1",
|
||||||
"version_normalized": "3.1.0.0",
|
"version_normalized": "3.2.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/wikimedia/less.php.git",
|
"url": "https://github.com/wikimedia/less.php.git",
|
||||||
"reference": "a486d78b9bd16b72f237fc6093aa56d69ce8bd13"
|
"reference": "0d5b30ba792bdbf8991a646fc9c30561b38a5559"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/wikimedia/less.php/zipball/a486d78b9bd16b72f237fc6093aa56d69ce8bd13",
|
"url": "https://api.github.com/repos/wikimedia/less.php/zipball/0d5b30ba792bdbf8991a646fc9c30561b38a5559",
|
||||||
"reference": "a486d78b9bd16b72f237fc6093aa56d69ce8bd13",
|
"reference": "0d5b30ba792bdbf8991a646fc9c30561b38a5559",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2.9"
|
"php": ">=7.2.9"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mediawiki/mediawiki-codesniffer": "34.0.0",
|
"mediawiki/mediawiki-codesniffer": "40.0.1",
|
||||||
"mediawiki/minus-x": "1.0.0",
|
"mediawiki/mediawiki-phan-config": "0.12.0",
|
||||||
"php-parallel-lint/php-console-highlighter": "0.5.0",
|
"mediawiki/minus-x": "1.1.1",
|
||||||
"php-parallel-lint/php-parallel-lint": "1.2.0",
|
"php-parallel-lint/php-console-highlighter": "1.0.0",
|
||||||
|
"php-parallel-lint/php-parallel-lint": "1.3.2",
|
||||||
"phpunit/phpunit": "^8.5"
|
"phpunit/phpunit": "^8.5"
|
||||||
},
|
},
|
||||||
"time": "2020-12-11T19:33:31+00:00",
|
"time": "2023-02-03T06:43:41+00:00",
|
||||||
"bin": [
|
"bin": [
|
||||||
"bin/lessc"
|
"bin/lessc"
|
||||||
],
|
],
|
||||||
@ -226,6 +233,10 @@
|
|||||||
"Apache-2.0"
|
"Apache-2.0"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Timo Tijhof",
|
||||||
|
"homepage": "https://timotijhof.net"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Josh Schmidt",
|
"name": "Josh Schmidt",
|
||||||
"homepage": "https://github.com/oyejorge"
|
"homepage": "https://github.com/oyejorge"
|
||||||
@ -239,7 +250,8 @@
|
|||||||
"homepage": "https://github.com/Mordred"
|
"homepage": "https://github.com/Mordred"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)",
|
"description": "PHP port of the LESS processor",
|
||||||
|
"homepage": "https://gerrit.wikimedia.org/g/mediawiki/libs/less.php",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"css",
|
"css",
|
||||||
"less",
|
"less",
|
||||||
@ -250,7 +262,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/wikimedia/less.php/issues",
|
"issues": "https://github.com/wikimedia/less.php/issues",
|
||||||
"source": "https://github.com/wikimedia/less.php/tree/v3.1.0"
|
"source": "https://github.com/wikimedia/less.php/tree/v3.2.1"
|
||||||
},
|
},
|
||||||
"install-path": "../wikimedia/less.php"
|
"install-path": "../wikimedia/less.php"
|
||||||
}
|
}
|
||||||
|
28
vendor/composer/installed.php
vendored
@ -3,7 +3,7 @@
|
|||||||
'name' => '__root__',
|
'name' => '__root__',
|
||||||
'pretty_version' => 'dev-main',
|
'pretty_version' => 'dev-main',
|
||||||
'version' => 'dev-main',
|
'version' => 'dev-main',
|
||||||
'reference' => '5e455c1499d4fba2d9bb825e4db8b58a3a6a595e',
|
'reference' => 'b4ef98673f4ec96aac0c1ff7bda444f72101c479',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -13,43 +13,43 @@
|
|||||||
'__root__' => array(
|
'__root__' => array(
|
||||||
'pretty_version' => 'dev-main',
|
'pretty_version' => 'dev-main',
|
||||||
'version' => 'dev-main',
|
'version' => 'dev-main',
|
||||||
'reference' => '5e455c1499d4fba2d9bb825e4db8b58a3a6a595e',
|
'reference' => 'b4ef98673f4ec96aac0c1ff7bda444f72101c479',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'bacon/bacon-qr-code' => array(
|
'bacon/bacon-qr-code' => array(
|
||||||
'pretty_version' => '2.0.7',
|
'pretty_version' => '2.0.8',
|
||||||
'version' => '2.0.7.0',
|
'version' => '2.0.8.0',
|
||||||
'reference' => 'd70c840f68657ce49094b8d91f9ee0cc07fbf66c',
|
'reference' => '8674e51bb65af933a5ffaf1c308a660387c35c22',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
|
'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'dasprid/enum' => array(
|
'dasprid/enum' => array(
|
||||||
'pretty_version' => '1.0.3',
|
'pretty_version' => '1.0.4',
|
||||||
'version' => '1.0.3.0',
|
'version' => '1.0.4.0',
|
||||||
'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2',
|
'reference' => '8e6b6ea76eabbf19ea2bf5b67b98e1860474012f',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../dasprid/enum',
|
'install_path' => __DIR__ . '/../dasprid/enum',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'endroid/qr-code' => array(
|
'endroid/qr-code' => array(
|
||||||
'pretty_version' => '4.4.9',
|
'pretty_version' => '4.8.2',
|
||||||
'version' => '4.4.9.0',
|
'version' => '4.8.2.0',
|
||||||
'reference' => 'bf087fa1e93a1b7310e2d94d187e26ae51db199d',
|
'reference' => '2436c2333a3931c95e2b96eb82f16f53143d6bba',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../endroid/qr-code',
|
'install_path' => __DIR__ . '/../endroid/qr-code',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'wikimedia/less.php' => array(
|
'wikimedia/less.php' => array(
|
||||||
'pretty_version' => 'v3.1.0',
|
'pretty_version' => 'v3.2.1',
|
||||||
'version' => '3.1.0.0',
|
'version' => '3.2.1.0',
|
||||||
'reference' => 'a486d78b9bd16b72f237fc6093aa56d69ce8bd13',
|
'reference' => '0d5b30ba792bdbf8991a646fc9c30561b38a5559',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../wikimedia/less.php',
|
'install_path' => __DIR__ . '/../wikimedia/less.php',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
4
vendor/composer/platform_check.php
vendored
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
$issues = array();
|
$issues = array();
|
||||||
|
|
||||||
if (!(PHP_VERSION_ID >= 70400)) {
|
if (!(PHP_VERSION_ID >= 80000)) {
|
||||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
|
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($issues) {
|
if ($issues) {
|
||||||
|
47
vendor/dasprid/enum/.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: Tests
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
php-tests:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
php: [8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1]
|
||||||
|
dependency-version: [prefer-stable]
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
name: ${{ matrix.os }} - PHP${{ matrix.php }} - ${{ matrix.dependency-version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set git to use LF
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.composer/cache/files
|
||||||
|
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
|
||||||
|
|
||||||
|
- name: Execute tests
|
||||||
|
run: vendor/bin/phpunit
|
||||||
|
|
||||||
|
- name: Code Sniffer
|
||||||
|
run: vendor/bin/phpcs
|
||||||
|
|
2
vendor/dasprid/enum/README.md
vendored
@ -1,6 +1,6 @@
|
|||||||
# PHP 7.1 enums
|
# PHP 7.1 enums
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/DASPRiD/Enum.svg?branch=master)](https://travis-ci.org/DASPRiD/Enum)
|
[![Build Status](https://github.com/DASPRiD/Enum/actions/workflows/tests.yml/badge.svg)](https://github.com/DASPRiD/Enum/actions?query=workflow%3Atests)
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/DASPRiD/Enum/badge.svg?branch=master)](https://coveralls.io/github/DASPRiD/Enum?branch=master)
|
[![Coverage Status](https://coveralls.io/repos/github/DASPRiD/Enum/badge.svg?branch=master)](https://coveralls.io/github/DASPRiD/Enum?branch=master)
|
||||||
[![Latest Stable Version](https://poser.pugx.org/dasprid/enum/v/stable)](https://packagist.org/packages/dasprid/enum)
|
[![Latest Stable Version](https://poser.pugx.org/dasprid/enum/v/stable)](https://packagist.org/packages/dasprid/enum)
|
||||||
[![Total Downloads](https://poser.pugx.org/dasprid/enum/downloads)](https://packagist.org/packages/dasprid/enum)
|
[![Total Downloads](https://poser.pugx.org/dasprid/enum/downloads)](https://packagist.org/packages/dasprid/enum)
|
||||||
|
5
vendor/dasprid/enum/composer.json
vendored
@ -14,9 +14,12 @@
|
|||||||
"enum",
|
"enum",
|
||||||
"map"
|
"map"
|
||||||
],
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1 <9.0"
|
||||||
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^7 | ^8 | ^9",
|
"phpunit/phpunit": "^7 | ^8 | ^9",
|
||||||
"squizlabs/php_codesniffer": "^3.4"
|
"squizlabs/php_codesniffer": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
42
vendor/dasprid/enum/src/EnumMap.php
vendored
@ -88,6 +88,31 @@ final class EnumMap implements Serializable, IteratorAggregate
|
|||||||
$this->values = array_fill(0, count($this->keyUniverse), null);
|
$this->values = array_fill(0, count($this->keyUniverse), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __serialize(): array
|
||||||
|
{
|
||||||
|
$values = [];
|
||||||
|
|
||||||
|
foreach ($this->values as $ordinal => $value) {
|
||||||
|
if (null === $value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$values[$ordinal] = $this->unmaskNull($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'keyType' => $this->keyType,
|
||||||
|
'valueType' => $this->valueType,
|
||||||
|
'allowNullValues' => $this->allowNullValues,
|
||||||
|
'values' => $values,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __unserialize(array $data): void
|
||||||
|
{
|
||||||
|
$this->unserialize(serialize($data));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the map types match the supplied ones.
|
* Checks whether the map types match the supplied ones.
|
||||||
*
|
*
|
||||||
@ -261,22 +286,7 @@ final class EnumMap implements Serializable, IteratorAggregate
|
|||||||
|
|
||||||
public function serialize() : string
|
public function serialize() : string
|
||||||
{
|
{
|
||||||
$values = [];
|
return serialize($this->__serialize());
|
||||||
|
|
||||||
foreach ($this->values as $ordinal => $value) {
|
|
||||||
if (null === $value) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$values[$ordinal] = $this->unmaskNull($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return serialize([
|
|
||||||
'keyType' => $this->keyType,
|
|
||||||
'valueType' => $this->valueType,
|
|
||||||
'allowNullValues' => $this->allowNullValues,
|
|
||||||
'values' => $values,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unserialize($serialized) : void
|
public function unserialize($serialized) : void
|
||||||
|
2
vendor/endroid/qr-code/LICENSE
vendored
@ -1,4 +1,4 @@
|
|||||||
Copyright 2020 (c) Jeroen van den Enden
|
Copyright 2022 (c) Jeroen van den Enden
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
50
vendor/endroid/qr-code/README.md
vendored
@ -14,13 +14,17 @@ for validating generated QR codes. Further extended with Twig extensions, genera
|
|||||||
Symfony bundle for easy installation and configuration. Different writers are provided to generate the QR code
|
Symfony bundle for easy installation and configuration. Different writers are provided to generate the QR code
|
||||||
as PNG, SVG, EPS or in binary format.
|
as PNG, SVG, EPS or in binary format.
|
||||||
|
|
||||||
|
## Sponsored by
|
||||||
|
|
||||||
|
[![Blackfire.io](assets/blackfire.png)](https://www.blackfire.io)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Use [Composer](https://getcomposer.org/) to install the library. Also make sure you have enabled and configured the
|
Use [Composer](https://getcomposer.org/) to install the library. Also make sure you have enabled and configured the
|
||||||
[GD extension](https://www.php.net/manual/en/book.image.php) if you want to generate images.
|
[GD extension](https://www.php.net/manual/en/book.image.php) if you want to generate images.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
$ composer require endroid/qr-code
|
composer require endroid/qr-code
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage: using the builder
|
## Usage: using the builder
|
||||||
@ -47,6 +51,7 @@ $result = Builder::create()
|
|||||||
->labelText('This is the label')
|
->labelText('This is the label')
|
||||||
->labelFont(new NotoSans(20))
|
->labelFont(new NotoSans(20))
|
||||||
->labelAlignment(new LabelAlignmentCenter())
|
->labelAlignment(new LabelAlignmentCenter())
|
||||||
|
->validateResult(false)
|
||||||
->build();
|
->build();
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -61,11 +66,12 @@ use Endroid\QrCode\Label\Label;
|
|||||||
use Endroid\QrCode\Logo\Logo;
|
use Endroid\QrCode\Logo\Logo;
|
||||||
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
|
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
|
||||||
use Endroid\QrCode\Writer\PngWriter;
|
use Endroid\QrCode\Writer\PngWriter;
|
||||||
|
use Endroid\QrCode\Writer\ValidationException;
|
||||||
|
|
||||||
$writer = new PngWriter();
|
$writer = new PngWriter();
|
||||||
|
|
||||||
// Create QR code
|
// Create QR code
|
||||||
$qrCode = QrCode::create('Data')
|
$qrCode = QrCode::create('Life is too short to be generating QR codes')
|
||||||
->setEncoding(new Encoding('UTF-8'))
|
->setEncoding(new Encoding('UTF-8'))
|
||||||
->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
|
->setErrorCorrectionLevel(new ErrorCorrectionLevelLow())
|
||||||
->setSize(300)
|
->setSize(300)
|
||||||
@ -83,6 +89,9 @@ $label = Label::create('Label')
|
|||||||
->setTextColor(new Color(255, 0, 0));
|
->setTextColor(new Color(255, 0, 0));
|
||||||
|
|
||||||
$result = $writer->write($qrCode, $logo, $label);
|
$result = $writer->write($qrCode, $logo, $label);
|
||||||
|
|
||||||
|
// Validate the result
|
||||||
|
$writer->validateResult($result, 'Life is too short to be generating QR codes');
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage: working with results
|
## Usage: working with results
|
||||||
@ -104,10 +113,32 @@ $dataUri = $result->getDataUri();
|
|||||||
|
|
||||||
### Writer options
|
### Writer options
|
||||||
|
|
||||||
|
Some writers provide writer options. Each available writer option is can be
|
||||||
|
found as a constant prefixed with WRITER_OPTION_ in the writer class.
|
||||||
|
|
||||||
|
* `PdfWriter`
|
||||||
|
* `unit`: unit of measurement (default: mm)
|
||||||
|
* `fpdf`: PDF to place the image in (default: new PDF)
|
||||||
|
* `x`: image offset (default: 0)
|
||||||
|
* `y`: image offset (default: 0)
|
||||||
|
* `PngWriter`
|
||||||
|
* `compression_level`: compression level (0-9, default: -1 = zlib default)
|
||||||
|
* `SvgWriter`
|
||||||
|
* `block_id`: id of the block element for external reference (default: block)
|
||||||
|
* `exclude_xml_declaration`: exclude XML declaration (default: false)
|
||||||
|
* `exclude_svg_width_and_height`: exclude width and height (default: false)
|
||||||
|
* `force_xlink_href`: forces xlink namespace in case of compatibility issues (default: false)
|
||||||
|
* `WebPWriter`
|
||||||
|
* `quality`: image quality (0-100, default: 80)
|
||||||
|
|
||||||
|
You can provide any writer options like this.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Endroid\QrCode\Writer\SvgWriter;
|
use Endroid\QrCode\Writer\SvgWriter;
|
||||||
|
|
||||||
$builder->setWriterOptions([SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true]);
|
$builder->setWriterOptions([
|
||||||
|
SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true
|
||||||
|
]);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Encoding
|
### Encoding
|
||||||
@ -145,13 +176,14 @@ size can result in additional padding to compensate for the rounding difference.
|
|||||||
And finally the encoding (default UTF-8 to support large character sets) can be
|
And finally the encoding (default UTF-8 to support large character sets) can be
|
||||||
set to `ISO-8859-1` if possible to improve readability.
|
set to `ISO-8859-1` if possible to improve readability.
|
||||||
|
|
||||||
## Built-in validation reader
|
## Validating the generated QR code
|
||||||
|
|
||||||
You can enable the built-in validation reader (disabled by default) by calling
|
If you need to be extra sure the QR code you generated is readable and contains
|
||||||
setValidateResult(true). This validation reader does not guarantee that the QR
|
the exact data you requested you can enable the validation reader, which is
|
||||||
code will be readable by all readers but it helps you provide a minimum level
|
disabled by default. You can do this either via the builder or directly on any
|
||||||
of quality. Take note that the validator can consume quite amount of additional
|
writer that supports validation. See the examples above.
|
||||||
resources and it should be installed separately only if you use it.
|
|
||||||
|
Please note that validation affects performance so only use it in case of problems.
|
||||||
|
|
||||||
## Symfony integration
|
## Symfony integration
|
||||||
|
|
||||||
|
BIN
vendor/endroid/qr-code/assets/blackfire.png
vendored
Normal file
After Width: | Height: | Size: 28 KiB |
10
vendor/endroid/qr-code/composer.json
vendored
@ -12,15 +12,18 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4||^8.0",
|
"php": "^8.0",
|
||||||
"bacon/bacon-qr-code": "^2.0.5"
|
"bacon/bacon-qr-code": "^2.0.5"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"endroid/quality": "dev-master",
|
"endroid/quality": "dev-master",
|
||||||
"khanamiryan/qrcode-detector-decoder": "^1.0.4",
|
"khanamiryan/qrcode-detector-decoder": "^1.0.4||^2.0.2",
|
||||||
"setasign/fpdf": "^1.8.2"
|
"setasign/fpdf": "^1.8.2"
|
||||||
},
|
},
|
||||||
|
"conflict": {
|
||||||
|
"khanamiryan/qrcode-detector-decoder": "^1.0.6"
|
||||||
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-gd": "Enables you to write PNG images",
|
"ext-gd": "Enables you to write PNG images",
|
||||||
"khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator",
|
"khanamiryan/qrcode-detector-decoder": "Enables you to use the image validator",
|
||||||
@ -41,6 +44,9 @@
|
|||||||
"sort-packages": true,
|
"sort-packages": true,
|
||||||
"preferred-install": {
|
"preferred-install": {
|
||||||
"endroid/*": "source"
|
"endroid/*": "source"
|
||||||
|
},
|
||||||
|
"allow-plugins": {
|
||||||
|
"endroid/installer": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
@ -7,6 +7,7 @@ namespace Endroid\QrCode\Builder;
|
|||||||
use Endroid\QrCode\Color\ColorInterface;
|
use Endroid\QrCode\Color\ColorInterface;
|
||||||
use Endroid\QrCode\Encoding\EncodingInterface;
|
use Endroid\QrCode\Encoding\EncodingInterface;
|
||||||
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelInterface;
|
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelInterface;
|
||||||
|
use Endroid\QrCode\Exception\ValidationException;
|
||||||
use Endroid\QrCode\Label\Alignment\LabelAlignmentInterface;
|
use Endroid\QrCode\Label\Alignment\LabelAlignmentInterface;
|
||||||
use Endroid\QrCode\Label\Font\FontInterface;
|
use Endroid\QrCode\Label\Font\FontInterface;
|
||||||
use Endroid\QrCode\Label\Label;
|
use Endroid\QrCode\Label\Label;
|
||||||
@ -24,7 +25,7 @@ use Endroid\QrCode\Writer\WriterInterface;
|
|||||||
class Builder implements BuilderInterface
|
class Builder implements BuilderInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var array<mixed>{
|
* @var array<string, mixed>{
|
||||||
* data: string,
|
* data: string,
|
||||||
* writer: WriterInterface,
|
* writer: WriterInterface,
|
||||||
* writerOptions: array,
|
* writerOptions: array,
|
||||||
@ -77,7 +78,7 @@ class Builder implements BuilderInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param array<mixed> $writerOptions */
|
/** @param array<string, mixed> $writerOptions */
|
||||||
public function writerOptions(array $writerOptions): BuilderInterface
|
public function writerOptions(array $writerOptions): BuilderInterface
|
||||||
{
|
{
|
||||||
$this->options['writerOptions'] = $writerOptions;
|
$this->options['writerOptions'] = $writerOptions;
|
||||||
@ -216,7 +217,7 @@ class Builder implements BuilderInterface
|
|||||||
$writer = $this->options['writer'];
|
$writer = $this->options['writer'];
|
||||||
|
|
||||||
if ($this->options['validateResult'] && !$writer instanceof ValidatingWriterInterface) {
|
if ($this->options['validateResult'] && !$writer instanceof ValidatingWriterInterface) {
|
||||||
throw new \Exception('Unable to validate result with '.get_class($writer));
|
throw ValidationException::createForUnsupportedWriter(strval(get_class($writer)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var QrCode $qrCode */
|
/** @var QrCode $qrCode */
|
||||||
@ -242,7 +243,7 @@ class Builder implements BuilderInterface
|
|||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private function buildObject(string $class, string $optionsPrefix = null)
|
private function buildObject(string $class, string|null $optionsPrefix = null)
|
||||||
{
|
{
|
||||||
/** @var \ReflectionClass<object> $reflectionClass */
|
/** @var \ReflectionClass<object> $reflectionClass */
|
||||||
$reflectionClass = new \ReflectionClass($class);
|
$reflectionClass = new \ReflectionClass($class);
|
||||||
|
@ -20,7 +20,7 @@ interface BuilderInterface
|
|||||||
|
|
||||||
public function writer(WriterInterface $writer): BuilderInterface;
|
public function writer(WriterInterface $writer): BuilderInterface;
|
||||||
|
|
||||||
/** @param array<mixed> $writerOptions */
|
/** @param array<string, mixed> $writerOptions */
|
||||||
public function writerOptions(array $writerOptions): BuilderInterface;
|
public function writerOptions(array $writerOptions): BuilderInterface;
|
||||||
|
|
||||||
public function data(string $data): BuilderInterface;
|
public function data(string $data): BuilderInterface;
|
||||||
|
22
vendor/endroid/qr-code/src/Color/Color.php
vendored
@ -6,17 +6,12 @@ namespace Endroid\QrCode\Color;
|
|||||||
|
|
||||||
final class Color implements ColorInterface
|
final class Color implements ColorInterface
|
||||||
{
|
{
|
||||||
private int $red;
|
public function __construct(
|
||||||
private int $green;
|
private int $red,
|
||||||
private int $blue;
|
private int $green,
|
||||||
private int $alpha;
|
private int $blue,
|
||||||
|
private int $alpha = 0
|
||||||
public function __construct(int $red, int $green, int $blue, int $alpha = 0)
|
) {
|
||||||
{
|
|
||||||
$this->red = $red;
|
|
||||||
$this->green = $green;
|
|
||||||
$this->blue = $blue;
|
|
||||||
$this->alpha = $alpha;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRed(): int
|
public function getRed(): int
|
||||||
@ -44,6 +39,11 @@ final class Color implements ColorInterface
|
|||||||
return 1 - $this->alpha / 127;
|
return 1 - $this->alpha / 127;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHex(): string
|
||||||
|
{
|
||||||
|
return sprintf('#%02x%02x%02x', $this->red, $this->green, $this->blue);
|
||||||
|
}
|
||||||
|
|
||||||
public function toArray(): array
|
public function toArray(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@ -16,6 +16,8 @@ interface ColorInterface
|
|||||||
|
|
||||||
public function getOpacity(): float;
|
public function getOpacity(): float;
|
||||||
|
|
||||||
|
public function getHex(): string;
|
||||||
|
|
||||||
/** @return array<string, int> */
|
/** @return array<string, int> */
|
||||||
public function toArray(): array;
|
public function toArray(): array;
|
||||||
}
|
}
|
||||||
|
@ -6,15 +6,12 @@ namespace Endroid\QrCode\Encoding;
|
|||||||
|
|
||||||
final class Encoding implements EncodingInterface
|
final class Encoding implements EncodingInterface
|
||||||
{
|
{
|
||||||
private string $value;
|
public function __construct(
|
||||||
|
private string $value
|
||||||
public function __construct(string $value)
|
) {
|
||||||
{
|
|
||||||
if (!in_array($value, mb_list_encodings())) {
|
if (!in_array($value, mb_list_encodings())) {
|
||||||
throw new \Exception(sprintf('Invalid encoding "%s"', $value));
|
throw new \Exception(sprintf('Invalid encoding "%s"', $value));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->value = $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
|
23
vendor/endroid/qr-code/src/Exception/ValidationException.php
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Exception;
|
||||||
|
|
||||||
|
final class ValidationException extends \Exception
|
||||||
|
{
|
||||||
|
public static function createForUnsupportedWriter(string $writerClass): self
|
||||||
|
{
|
||||||
|
return new self(sprintf('Unable to validate the result: "%s" does not support validation', $writerClass));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function createForMissingPackage(string $packageName): self
|
||||||
|
{
|
||||||
|
return new self(sprintf('Please install "%s" or disable image validation', $packageName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function createForInvalidData(string $expectedData, string $actualData): self
|
||||||
|
{
|
||||||
|
return new self('The validation reader read "'.$actualData.'" instead of "'.$expectedData.'". Adjust your parameters to increase readability or disable validation.');
|
||||||
|
}
|
||||||
|
}
|
@ -8,13 +8,10 @@ use Endroid\QrCode\Label\LabelInterface;
|
|||||||
|
|
||||||
class LabelImageData
|
class LabelImageData
|
||||||
{
|
{
|
||||||
private int $width;
|
private function __construct(
|
||||||
private int $height;
|
private int $width,
|
||||||
|
private int $height
|
||||||
private function __construct(int $width, int $height)
|
) {
|
||||||
{
|
|
||||||
$this->width = $width;
|
|
||||||
$this->height = $height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createForLabel(LabelInterface $label): self
|
public static function createForLabel(LabelInterface $label): self
|
||||||
|
@ -8,31 +8,14 @@ use Endroid\QrCode\Logo\LogoInterface;
|
|||||||
|
|
||||||
class LogoImageData
|
class LogoImageData
|
||||||
{
|
{
|
||||||
private string $data;
|
|
||||||
|
|
||||||
/** @var mixed */
|
|
||||||
private $image;
|
|
||||||
|
|
||||||
private string $mimeType;
|
|
||||||
private int $width;
|
|
||||||
private int $height;
|
|
||||||
private bool $punchoutBackground;
|
|
||||||
|
|
||||||
/** @param mixed $image */
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
string $data,
|
private string $data,
|
||||||
$image,
|
private \GdImage|null $image,
|
||||||
string $mimeType,
|
private string $mimeType,
|
||||||
int $width,
|
private int $width,
|
||||||
int $height,
|
private int $height,
|
||||||
bool $punchoutBackground
|
private bool $punchoutBackground
|
||||||
) {
|
) {
|
||||||
$this->data = $data;
|
|
||||||
$this->image = $image;
|
|
||||||
$this->mimeType = $mimeType;
|
|
||||||
$this->width = $width;
|
|
||||||
$this->height = $height;
|
|
||||||
$this->punchoutBackground = $punchoutBackground;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createForLogo(LogoInterface $logo): self
|
public static function createForLogo(LogoInterface $logo): self
|
||||||
@ -89,10 +72,9 @@ class LogoImageData
|
|||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return mixed */
|
public function getImage(): \GdImage
|
||||||
public function getImage()
|
|
||||||
{
|
{
|
||||||
if (null === $this->image) {
|
if (!$this->image instanceof \GdImage) {
|
||||||
throw new \Exception('SVG Images have no image resource');
|
throw new \Exception('SVG Images have no image resource');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,10 +108,7 @@ class LogoImageData
|
|||||||
|
|
||||||
private static function detectMimeTypeFromUrl(string $url): string
|
private static function detectMimeTypeFromUrl(string $url): string
|
||||||
{
|
{
|
||||||
/** @var mixed $format */
|
$headers = get_headers($url, true);
|
||||||
$format = PHP_VERSION_ID >= 80000 ? true : 1;
|
|
||||||
|
|
||||||
$headers = get_headers($url, $format);
|
|
||||||
|
|
||||||
if (!is_array($headers) || !isset($headers['Content-Type'])) {
|
if (!is_array($headers) || !isset($headers['Content-Type'])) {
|
||||||
throw new \Exception(sprintf('Content type could not be determined for logo URL "%s"', $url));
|
throw new \Exception(sprintf('Content type could not be determined for logo URL "%s"', $url));
|
||||||
|
16
vendor/endroid/qr-code/src/Label/Font/Font.php
vendored
@ -6,18 +6,14 @@ namespace Endroid\QrCode\Label\Font;
|
|||||||
|
|
||||||
final class Font implements FontInterface
|
final class Font implements FontInterface
|
||||||
{
|
{
|
||||||
private string $path;
|
public function __construct(
|
||||||
private int $size;
|
private string $path,
|
||||||
|
private int $size = 16
|
||||||
public function __construct(string $path, int $size = 16)
|
) {
|
||||||
{
|
$this->assertValidPath($path);
|
||||||
$this->validatePath($path);
|
|
||||||
|
|
||||||
$this->path = $path;
|
|
||||||
$this->size = $size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validatePath(string $path): void
|
private function assertValidPath(string $path): void
|
||||||
{
|
{
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
throw new \Exception(sprintf('Invalid font path "%s"', $path));
|
throw new \Exception(sprintf('Invalid font path "%s"', $path));
|
||||||
|
@ -6,11 +6,9 @@ namespace Endroid\QrCode\Label\Font;
|
|||||||
|
|
||||||
final class NotoSans implements FontInterface
|
final class NotoSans implements FontInterface
|
||||||
{
|
{
|
||||||
private int $size;
|
public function __construct(
|
||||||
|
private int $size = 16
|
||||||
public function __construct(int $size = 16)
|
) {
|
||||||
{
|
|
||||||
$this->size = $size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPath(): string
|
public function getPath(): string
|
||||||
|
@ -6,11 +6,9 @@ namespace Endroid\QrCode\Label\Font;
|
|||||||
|
|
||||||
final class OpenSans implements FontInterface
|
final class OpenSans implements FontInterface
|
||||||
{
|
{
|
||||||
private int $size;
|
public function __construct(
|
||||||
|
private int $size = 16
|
||||||
public function __construct(int $size = 16)
|
) {
|
||||||
{
|
|
||||||
$this->size = $size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPath(): string
|
public function getPath(): string
|
||||||
|
20
vendor/endroid/qr-code/src/Label/Label.php
vendored
@ -15,24 +15,22 @@ use Endroid\QrCode\Label\Margin\MarginInterface;
|
|||||||
|
|
||||||
final class Label implements LabelInterface
|
final class Label implements LabelInterface
|
||||||
{
|
{
|
||||||
private string $text;
|
|
||||||
private FontInterface $font;
|
private FontInterface $font;
|
||||||
private LabelAlignmentInterface $alignment;
|
private LabelAlignmentInterface $alignment;
|
||||||
private MarginInterface $margin;
|
private MarginInterface $margin;
|
||||||
private ColorInterface $textColor;
|
private ColorInterface $textColor;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $text,
|
private string $text,
|
||||||
FontInterface $font = null,
|
FontInterface|null $font = null,
|
||||||
LabelAlignmentInterface $alignment = null,
|
LabelAlignmentInterface|null $alignment = null,
|
||||||
MarginInterface $margin = null,
|
MarginInterface|null $margin = null,
|
||||||
ColorInterface $textColor = null
|
ColorInterface|null $textColor = null
|
||||||
) {
|
) {
|
||||||
$this->text = $text;
|
$this->font = $font ?? new Font(__DIR__.'/../../assets/noto_sans.otf', 16);
|
||||||
$this->font = isset($font) ? $font : new Font(__DIR__.'/../../assets/noto_sans.otf', 16);
|
$this->alignment = $alignment ?? new LabelAlignmentCenter();
|
||||||
$this->alignment = isset($alignment) ? $alignment : new LabelAlignmentCenter();
|
$this->margin = $margin ?? new Margin(0, 10, 10, 10);
|
||||||
$this->margin = isset($margin) ? $margin : new Margin(0, 10, 10, 10);
|
$this->textColor = $textColor ?? new Color(0, 0, 0);
|
||||||
$this->textColor = isset($textColor) ? $textColor : new Color(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create(string $text): self
|
public static function create(string $text): self
|
||||||
|
@ -6,17 +6,12 @@ namespace Endroid\QrCode\Label\Margin;
|
|||||||
|
|
||||||
final class Margin implements MarginInterface
|
final class Margin implements MarginInterface
|
||||||
{
|
{
|
||||||
private int $top;
|
public function __construct(
|
||||||
private int $right;
|
private int $top,
|
||||||
private int $bottom;
|
private int $right,
|
||||||
private int $left;
|
private int $bottom,
|
||||||
|
private int $left
|
||||||
public function __construct(int $top, int $right, int $bottom, int $left)
|
) {
|
||||||
{
|
|
||||||
$this->top = $top;
|
|
||||||
$this->right = $right;
|
|
||||||
$this->bottom = $bottom;
|
|
||||||
$this->left = $left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTop(): int
|
public function getTop(): int
|
||||||
|
25
vendor/endroid/qr-code/src/Logo/Logo.php
vendored
@ -6,17 +6,12 @@ namespace Endroid\QrCode\Logo;
|
|||||||
|
|
||||||
final class Logo implements LogoInterface
|
final class Logo implements LogoInterface
|
||||||
{
|
{
|
||||||
private string $path;
|
public function __construct(
|
||||||
private ?int $resizeToWidth;
|
private string $path,
|
||||||
private ?int $resizeToHeight;
|
private int|null $resizeToWidth = null,
|
||||||
private bool $punchoutBackground;
|
private int|null $resizeToHeight = null,
|
||||||
|
private bool $punchoutBackground = false
|
||||||
public function __construct(string $path, ?int $resizeToWidth = null, ?int $resizeToHeight = null, bool $punchoutBackground = false)
|
) {
|
||||||
{
|
|
||||||
$this->path = $path;
|
|
||||||
$this->resizeToWidth = $resizeToWidth;
|
|
||||||
$this->resizeToHeight = $resizeToHeight;
|
|
||||||
$this->punchoutBackground = $punchoutBackground;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create(string $path): self
|
public static function create(string $path): self
|
||||||
@ -36,24 +31,24 @@ final class Logo implements LogoInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResizeToWidth(): ?int
|
public function getResizeToWidth(): int|null
|
||||||
{
|
{
|
||||||
return $this->resizeToWidth;
|
return $this->resizeToWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setResizeToWidth(?int $resizeToWidth): self
|
public function setResizeToWidth(int|null $resizeToWidth): self
|
||||||
{
|
{
|
||||||
$this->resizeToWidth = $resizeToWidth;
|
$this->resizeToWidth = $resizeToWidth;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResizeToHeight(): ?int
|
public function getResizeToHeight(): int|null
|
||||||
{
|
{
|
||||||
return $this->resizeToHeight;
|
return $this->resizeToHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setResizeToHeight(?int $resizeToHeight): self
|
public function setResizeToHeight(int|null $resizeToHeight): self
|
||||||
{
|
{
|
||||||
$this->resizeToHeight = $resizeToHeight;
|
$this->resizeToHeight = $resizeToHeight;
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ interface LogoInterface
|
|||||||
{
|
{
|
||||||
public function getPath(): string;
|
public function getPath(): string;
|
||||||
|
|
||||||
public function getResizeToWidth(): ?int;
|
public function getResizeToWidth(): int|null;
|
||||||
|
|
||||||
public function getResizeToHeight(): ?int;
|
public function getResizeToHeight(): int|null;
|
||||||
|
|
||||||
public function getPunchoutBackground(): bool;
|
public function getPunchoutBackground(): bool;
|
||||||
}
|
}
|
||||||
|
13
vendor/endroid/qr-code/src/Matrix/Matrix.php
vendored
@ -11,9 +11,6 @@ use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeShrink;
|
|||||||
|
|
||||||
final class Matrix implements MatrixInterface
|
final class Matrix implements MatrixInterface
|
||||||
{
|
{
|
||||||
/** @var array<int, array<int, int>> */
|
|
||||||
private array $blockValues = [];
|
|
||||||
|
|
||||||
private float $blockSize;
|
private float $blockSize;
|
||||||
private int $innerSize;
|
private int $innerSize;
|
||||||
private int $outerSize;
|
private int $outerSize;
|
||||||
@ -21,10 +18,12 @@ final class Matrix implements MatrixInterface
|
|||||||
private int $marginRight;
|
private int $marginRight;
|
||||||
|
|
||||||
/** @param array<array<int>> $blockValues */
|
/** @param array<array<int>> $blockValues */
|
||||||
public function __construct(array $blockValues, int $size, int $margin, RoundBlockSizeModeInterface $roundBlockSizeMode)
|
public function __construct(
|
||||||
{
|
private array $blockValues,
|
||||||
$this->blockValues = $blockValues;
|
int $size,
|
||||||
|
int $margin,
|
||||||
|
RoundBlockSizeModeInterface $roundBlockSizeMode
|
||||||
|
) {
|
||||||
$this->blockSize = $size / $this->getBlockCount();
|
$this->blockSize = $size / $this->getBlockCount();
|
||||||
$this->innerSize = $size;
|
$this->innerSize = $size;
|
||||||
$this->outerSize = $size + 2 * $margin;
|
$this->outerSize = $size + 2 * $margin;
|
||||||
|
22
vendor/endroid/qr-code/src/QrCode.php
vendored
@ -15,30 +15,24 @@ use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin;
|
|||||||
|
|
||||||
final class QrCode implements QrCodeInterface
|
final class QrCode implements QrCodeInterface
|
||||||
{
|
{
|
||||||
private string $data;
|
|
||||||
private EncodingInterface $encoding;
|
private EncodingInterface $encoding;
|
||||||
private ErrorCorrectionLevelInterface $errorCorrectionLevel;
|
private ErrorCorrectionLevelInterface $errorCorrectionLevel;
|
||||||
private int $size;
|
|
||||||
private int $margin;
|
|
||||||
private RoundBlockSizeModeInterface $roundBlockSizeMode;
|
private RoundBlockSizeModeInterface $roundBlockSizeMode;
|
||||||
private ColorInterface $foregroundColor;
|
private ColorInterface $foregroundColor;
|
||||||
private ColorInterface $backgroundColor;
|
private ColorInterface $backgroundColor;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $data,
|
private string $data,
|
||||||
EncodingInterface $encoding = null,
|
EncodingInterface|null $encoding = null,
|
||||||
ErrorCorrectionLevelInterface $errorCorrectionLevel = null,
|
ErrorCorrectionLevelInterface|null $errorCorrectionLevel = null,
|
||||||
int $size = 300,
|
private int $size = 300,
|
||||||
int $margin = 10,
|
private int $margin = 10,
|
||||||
RoundBlockSizeModeInterface $roundBlockSizeMode = null,
|
RoundBlockSizeModeInterface|null $roundBlockSizeMode = null,
|
||||||
ColorInterface $foregroundColor = null,
|
ColorInterface|null $foregroundColor = null,
|
||||||
ColorInterface $backgroundColor = null
|
ColorInterface|null $backgroundColor = null
|
||||||
) {
|
) {
|
||||||
$this->data = $data;
|
|
||||||
$this->encoding = $encoding ?? new Encoding('UTF-8');
|
$this->encoding = $encoding ?? new Encoding('UTF-8');
|
||||||
$this->errorCorrectionLevel = $errorCorrectionLevel ?? new ErrorCorrectionLevelLow();
|
$this->errorCorrectionLevel = $errorCorrectionLevel ?? new ErrorCorrectionLevelLow();
|
||||||
$this->size = $size;
|
|
||||||
$this->margin = $margin;
|
|
||||||
$this->roundBlockSizeMode = $roundBlockSizeMode ?? new RoundBlockSizeModeMargin();
|
$this->roundBlockSizeMode = $roundBlockSizeMode ?? new RoundBlockSizeModeMargin();
|
||||||
$this->foregroundColor = $foregroundColor ?? new Color(0, 0, 0);
|
$this->foregroundColor = $foregroundColor ?? new Color(0, 0, 0);
|
||||||
$this->backgroundColor = $backgroundColor ?? new Color(255, 255, 255);
|
$this->backgroundColor = $backgroundColor ?? new Color(255, 255, 255);
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
interface WritableInterface
|
|
||||||
{
|
|
||||||
}
|
|
205
vendor/endroid/qr-code/src/Writer/AbstractGdWriter.php
vendored
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Bacon\MatrixFactory;
|
||||||
|
use Endroid\QrCode\Exception\ValidationException;
|
||||||
|
use Endroid\QrCode\ImageData\LabelImageData;
|
||||||
|
use Endroid\QrCode\ImageData\LogoImageData;
|
||||||
|
use Endroid\QrCode\Label\Alignment\LabelAlignmentLeft;
|
||||||
|
use Endroid\QrCode\Label\Alignment\LabelAlignmentRight;
|
||||||
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
|
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeNone;
|
||||||
|
use Endroid\QrCode\Writer\Result\GdResult;
|
||||||
|
use Endroid\QrCode\Writer\Result\ResultInterface;
|
||||||
|
use Zxing\QrReader;
|
||||||
|
|
||||||
|
abstract class AbstractGdWriter implements WriterInterface, ValidatingWriterInterface
|
||||||
|
{
|
||||||
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
|
{
|
||||||
|
if (!extension_loaded('gd')) {
|
||||||
|
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
||||||
|
}
|
||||||
|
|
||||||
|
$matrixFactory = new MatrixFactory();
|
||||||
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
|
|
||||||
|
$baseBlockSize = $qrCode->getRoundBlockSizeMode() instanceof RoundBlockSizeModeNone ? 10 : intval($matrix->getBlockSize());
|
||||||
|
$baseImage = imagecreatetruecolor($matrix->getBlockCount() * $baseBlockSize, $matrix->getBlockCount() * $baseBlockSize);
|
||||||
|
|
||||||
|
if (!$baseImage) {
|
||||||
|
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var int $foregroundColor */
|
||||||
|
$foregroundColor = imagecolorallocatealpha(
|
||||||
|
$baseImage,
|
||||||
|
$qrCode->getForegroundColor()->getRed(),
|
||||||
|
$qrCode->getForegroundColor()->getGreen(),
|
||||||
|
$qrCode->getForegroundColor()->getBlue(),
|
||||||
|
$qrCode->getForegroundColor()->getAlpha()
|
||||||
|
);
|
||||||
|
|
||||||
|
/** @var int $transparentColor */
|
||||||
|
$transparentColor = imagecolorallocatealpha($baseImage, 255, 255, 255, 127);
|
||||||
|
|
||||||
|
imagefill($baseImage, 0, 0, $transparentColor);
|
||||||
|
|
||||||
|
for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
|
||||||
|
for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
|
||||||
|
if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) {
|
||||||
|
imagefilledrectangle(
|
||||||
|
$baseImage,
|
||||||
|
$columnIndex * $baseBlockSize,
|
||||||
|
$rowIndex * $baseBlockSize,
|
||||||
|
($columnIndex + 1) * $baseBlockSize - 1,
|
||||||
|
($rowIndex + 1) * $baseBlockSize - 1,
|
||||||
|
$foregroundColor
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$targetWidth = $matrix->getOuterSize();
|
||||||
|
$targetHeight = $matrix->getOuterSize();
|
||||||
|
|
||||||
|
if ($label instanceof LabelInterface) {
|
||||||
|
$labelImageData = LabelImageData::createForLabel($label);
|
||||||
|
$targetHeight += $labelImageData->getHeight() + $label->getMargin()->getTop() + $label->getMargin()->getBottom();
|
||||||
|
}
|
||||||
|
|
||||||
|
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
|
||||||
|
|
||||||
|
if (!$targetImage) {
|
||||||
|
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var int $backgroundColor */
|
||||||
|
$backgroundColor = imagecolorallocatealpha(
|
||||||
|
$targetImage,
|
||||||
|
$qrCode->getBackgroundColor()->getRed(),
|
||||||
|
$qrCode->getBackgroundColor()->getGreen(),
|
||||||
|
$qrCode->getBackgroundColor()->getBlue(),
|
||||||
|
$qrCode->getBackgroundColor()->getAlpha()
|
||||||
|
);
|
||||||
|
|
||||||
|
imagefill($targetImage, 0, 0, $backgroundColor);
|
||||||
|
|
||||||
|
imagecopyresampled(
|
||||||
|
$targetImage,
|
||||||
|
$baseImage,
|
||||||
|
$matrix->getMarginLeft(),
|
||||||
|
$matrix->getMarginLeft(),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
$matrix->getInnerSize(),
|
||||||
|
$matrix->getInnerSize(),
|
||||||
|
imagesx($baseImage),
|
||||||
|
imagesy($baseImage)
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($qrCode->getBackgroundColor()->getAlpha() > 0) {
|
||||||
|
imagesavealpha($targetImage, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = new GdResult($matrix, $targetImage);
|
||||||
|
|
||||||
|
if ($logo instanceof LogoInterface) {
|
||||||
|
$result = $this->addLogo($logo, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($label instanceof LabelInterface) {
|
||||||
|
$result = $this->addLabel($label, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addLogo(LogoInterface $logo, GdResult $result): GdResult
|
||||||
|
{
|
||||||
|
$logoImageData = LogoImageData::createForLogo($logo);
|
||||||
|
|
||||||
|
if ('image/svg+xml' === $logoImageData->getMimeType()) {
|
||||||
|
throw new \Exception('PNG Writer does not support SVG logo');
|
||||||
|
}
|
||||||
|
|
||||||
|
$targetImage = $result->getImage();
|
||||||
|
$matrix = $result->getMatrix();
|
||||||
|
|
||||||
|
if ($logoImageData->getPunchoutBackground()) {
|
||||||
|
/** @var int $transparent */
|
||||||
|
$transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127);
|
||||||
|
imagealphablending($targetImage, false);
|
||||||
|
$xOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2);
|
||||||
|
$yOffsetStart = intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2);
|
||||||
|
for ($xOffset = $xOffsetStart; $xOffset < $xOffsetStart + $logoImageData->getWidth(); ++$xOffset) {
|
||||||
|
for ($yOffset = $yOffsetStart; $yOffset < $yOffsetStart + $logoImageData->getHeight(); ++$yOffset) {
|
||||||
|
imagesetpixel($targetImage, $xOffset, $yOffset, $transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imagecopyresampled(
|
||||||
|
$targetImage,
|
||||||
|
$logoImageData->getImage(),
|
||||||
|
intval($matrix->getOuterSize() / 2 - $logoImageData->getWidth() / 2),
|
||||||
|
intval($matrix->getOuterSize() / 2 - $logoImageData->getHeight() / 2),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
$logoImageData->getWidth(),
|
||||||
|
$logoImageData->getHeight(),
|
||||||
|
imagesx($logoImageData->getImage()),
|
||||||
|
imagesy($logoImageData->getImage())
|
||||||
|
);
|
||||||
|
|
||||||
|
return new GdResult($matrix, $targetImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addLabel(LabelInterface $label, GdResult $result): GdResult
|
||||||
|
{
|
||||||
|
$targetImage = $result->getImage();
|
||||||
|
|
||||||
|
$labelImageData = LabelImageData::createForLabel($label);
|
||||||
|
|
||||||
|
/** @var int $textColor */
|
||||||
|
$textColor = imagecolorallocatealpha(
|
||||||
|
$targetImage,
|
||||||
|
$label->getTextColor()->getRed(),
|
||||||
|
$label->getTextColor()->getGreen(),
|
||||||
|
$label->getTextColor()->getBlue(),
|
||||||
|
$label->getTextColor()->getAlpha()
|
||||||
|
);
|
||||||
|
|
||||||
|
$x = intval(imagesx($targetImage) / 2 - $labelImageData->getWidth() / 2);
|
||||||
|
$y = imagesy($targetImage) - $label->getMargin()->getBottom();
|
||||||
|
|
||||||
|
if ($label->getAlignment() instanceof LabelAlignmentLeft) {
|
||||||
|
$x = $label->getMargin()->getLeft();
|
||||||
|
} elseif ($label->getAlignment() instanceof LabelAlignmentRight) {
|
||||||
|
$x = imagesx($targetImage) - $labelImageData->getWidth() - $label->getMargin()->getRight();
|
||||||
|
}
|
||||||
|
|
||||||
|
imagettftext($targetImage, $label->getFont()->getSize(), 0, $x, $y, $textColor, $label->getFont()->getPath(), $label->getText());
|
||||||
|
|
||||||
|
return new GdResult($result->getMatrix(), $targetImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateResult(ResultInterface $result, string $expectedData): void
|
||||||
|
{
|
||||||
|
$string = $result->getString();
|
||||||
|
|
||||||
|
if (!class_exists(QrReader::class)) {
|
||||||
|
throw ValidationException::createForMissingPackage('khanamiryan/qrcode-detector-decoder');
|
||||||
|
}
|
||||||
|
|
||||||
|
$reader = new QrReader($string, QrReader::SOURCE_TYPE_BLOB);
|
||||||
|
if ($reader->text() !== $expectedData) {
|
||||||
|
throw ValidationException::createForInvalidData($expectedData, strval($reader->text()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,7 @@ use Endroid\QrCode\Writer\Result\ResultInterface;
|
|||||||
|
|
||||||
final class BinaryWriter implements WriterInterface
|
final class BinaryWriter implements WriterInterface
|
||||||
{
|
{
|
||||||
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
{
|
{
|
||||||
$matrixFactory = new MatrixFactory();
|
$matrixFactory = new MatrixFactory();
|
||||||
$matrix = $matrixFactory->create($qrCode);
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
|
23
vendor/endroid/qr-code/src/Writer/ConsoleWriter.php
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Bacon\MatrixFactory;
|
||||||
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
|
use Endroid\QrCode\Writer\Result\ConsoleResult;
|
||||||
|
use Endroid\QrCode\Writer\Result\ResultInterface;
|
||||||
|
|
||||||
|
final class ConsoleWriter implements WriterInterface
|
||||||
|
{
|
||||||
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, $options = []): ResultInterface
|
||||||
|
{
|
||||||
|
$matrixFactory = new MatrixFactory();
|
||||||
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
|
|
||||||
|
return new ConsoleResult($matrix, $qrCode->getForegroundColor(), $qrCode->getBackgroundColor());
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Endroid\QrCode\Writer;
|
namespace Endroid\QrCode\Writer;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Bacon\MatrixFactory;
|
||||||
use Endroid\QrCode\Label\LabelInterface;
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
use Endroid\QrCode\Logo\LogoInterface;
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
use Endroid\QrCode\QrCodeInterface;
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
@ -12,9 +13,12 @@ use Endroid\QrCode\Writer\Result\ResultInterface;
|
|||||||
|
|
||||||
final class DebugWriter implements WriterInterface, ValidatingWriterInterface
|
final class DebugWriter implements WriterInterface, ValidatingWriterInterface
|
||||||
{
|
{
|
||||||
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
{
|
{
|
||||||
return new DebugResult($qrCode, $logo, $label, $options);
|
$matrixFactory = new MatrixFactory();
|
||||||
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
|
|
||||||
|
return new DebugResult($matrix, $qrCode, $logo, $label, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateResult(ResultInterface $result, string $expectedData): void
|
public function validateResult(ResultInterface $result, string $expectedData): void
|
||||||
|
@ -15,7 +15,7 @@ final class EpsWriter implements WriterInterface
|
|||||||
{
|
{
|
||||||
public const DECIMAL_PRECISION = 10;
|
public const DECIMAL_PRECISION = 10;
|
||||||
|
|
||||||
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
{
|
{
|
||||||
$matrixFactory = new MatrixFactory();
|
$matrixFactory = new MatrixFactory();
|
||||||
$matrix = $matrixFactory->create($qrCode);
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
@ -39,6 +39,6 @@ final class EpsWriter implements WriterInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new EpsResult($lines);
|
return new EpsResult($matrix, $lines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
vendor/endroid/qr-code/src/Writer/GifWriter.php
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
|
use Endroid\QrCode\Writer\Result\GdResult;
|
||||||
|
use Endroid\QrCode\Writer\Result\GifResult;
|
||||||
|
use Endroid\QrCode\Writer\Result\ResultInterface;
|
||||||
|
|
||||||
|
final class GifWriter extends AbstractGdWriter
|
||||||
|
{
|
||||||
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
|
{
|
||||||
|
/** @var GdResult $gdResult */
|
||||||
|
$gdResult = parent::write($qrCode, $logo, $label, $options);
|
||||||
|
|
||||||
|
return new GifResult($gdResult->getMatrix(), $gdResult->getImage());
|
||||||
|
}
|
||||||
|
}
|
10
vendor/endroid/qr-code/src/Writer/PdfWriter.php
vendored
@ -17,8 +17,9 @@ final class PdfWriter implements WriterInterface
|
|||||||
public const WRITER_OPTION_PDF = 'fpdf';
|
public const WRITER_OPTION_PDF = 'fpdf';
|
||||||
public const WRITER_OPTION_X = 'x';
|
public const WRITER_OPTION_X = 'x';
|
||||||
public const WRITER_OPTION_Y = 'y';
|
public const WRITER_OPTION_Y = 'y';
|
||||||
|
public const WRITER_OPTION_LINK = 'link';
|
||||||
|
|
||||||
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
{
|
{
|
||||||
$matrixFactory = new MatrixFactory();
|
$matrixFactory = new MatrixFactory();
|
||||||
$matrix = $matrixFactory->create($qrCode);
|
$matrix = $matrixFactory->create($qrCode);
|
||||||
@ -99,7 +100,12 @@ final class PdfWriter implements WriterInterface
|
|||||||
$fpdf->Cell($matrix->getOuterSize(), 0, $label->getText(), 0, 0, 'C');
|
$fpdf->Cell($matrix->getOuterSize(), 0, $label->getText(), 0, 0, 'C');
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PdfResult($fpdf);
|
if (isset($options[self::WRITER_OPTION_LINK])) {
|
||||||
|
$link = $options[self::WRITER_OPTION_LINK];
|
||||||
|
$fpdf->Link($x, $y, $x + $matrix->getOuterSize(), $y + $matrix->getOuterSize(), $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PdfResult($matrix, $fpdf);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addLogo(LogoInterface $logo, \FPDF $fpdf, float $x, float $y, float $size): void
|
private function addLogo(LogoInterface $logo, \FPDF $fpdf, float $x, float $y, float $size): void
|
||||||
|
218
vendor/endroid/qr-code/src/Writer/PngWriter.php
vendored
@ -4,224 +4,26 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Endroid\QrCode\Writer;
|
namespace Endroid\QrCode\Writer;
|
||||||
|
|
||||||
use Endroid\QrCode\Bacon\MatrixFactory;
|
|
||||||
use Endroid\QrCode\ImageData\LabelImageData;
|
|
||||||
use Endroid\QrCode\ImageData\LogoImageData;
|
|
||||||
use Endroid\QrCode\Label\Alignment\LabelAlignmentLeft;
|
|
||||||
use Endroid\QrCode\Label\Alignment\LabelAlignmentRight;
|
|
||||||
use Endroid\QrCode\Label\LabelInterface;
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
use Endroid\QrCode\Logo\LogoInterface;
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
use Endroid\QrCode\QrCodeInterface;
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeNone;
|
use Endroid\QrCode\Writer\Result\GdResult;
|
||||||
use Endroid\QrCode\Writer\Result\PngResult;
|
use Endroid\QrCode\Writer\Result\PngResult;
|
||||||
use Endroid\QrCode\Writer\Result\ResultInterface;
|
use Endroid\QrCode\Writer\Result\ResultInterface;
|
||||||
use Zxing\QrReader;
|
|
||||||
|
|
||||||
final class PngWriter implements WriterInterface, ValidatingWriterInterface
|
final class PngWriter extends AbstractGdWriter
|
||||||
{
|
{
|
||||||
public function write(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = []): ResultInterface
|
public const WRITER_OPTION_COMPRESSION_LEVEL = 'compression_level';
|
||||||
|
|
||||||
|
public function write(QrCodeInterface $qrCode, LogoInterface|null $logo = null, LabelInterface|null $label = null, array $options = []): ResultInterface
|
||||||
{
|
{
|
||||||
if (!extension_loaded('gd')) {
|
if (!isset($options[self::WRITER_OPTION_COMPRESSION_LEVEL])) {
|
||||||
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
$options[self::WRITER_OPTION_COMPRESSION_LEVEL] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matrixFactory = new MatrixFactory();
|
/** @var GdResult $gdResult */
|
||||||
$matrix = $matrixFactory->create($qrCode);
|
$gdResult = parent::write($qrCode, $logo, $label, $options);
|
||||||
|
|
||||||
$baseBlockSize = $qrCode->getRoundBlockSizeMode() instanceof RoundBlockSizeModeNone ? 10 : intval($matrix->getBlockSize());
|
return new PngResult($gdResult->getMatrix(), $gdResult->getImage(), $options[self::WRITER_OPTION_COMPRESSION_LEVEL]);
|
||||||
$baseImage = imagecreatetruecolor($matrix->getBlockCount() * $baseBlockSize, $matrix->getBlockCount() * $baseBlockSize);
|
|
||||||
|
|
||||||
if (!$baseImage) {
|
|
||||||
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var int $foregroundColor */
|
|
||||||
$foregroundColor = imagecolorallocatealpha(
|
|
||||||
$baseImage,
|
|
||||||
$qrCode->getForegroundColor()->getRed(),
|
|
||||||
$qrCode->getForegroundColor()->getGreen(),
|
|
||||||
$qrCode->getForegroundColor()->getBlue(),
|
|
||||||
$qrCode->getForegroundColor()->getAlpha()
|
|
||||||
);
|
|
||||||
|
|
||||||
/** @var int $transparentColor */
|
|
||||||
$transparentColor = imagecolorallocatealpha($baseImage, 255, 255, 255, 127);
|
|
||||||
|
|
||||||
imagefill($baseImage, 0, 0, $transparentColor);
|
|
||||||
|
|
||||||
for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
|
|
||||||
for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
|
|
||||||
if (1 === $matrix->getBlockValue($rowIndex, $columnIndex)) {
|
|
||||||
imagefilledrectangle(
|
|
||||||
$baseImage,
|
|
||||||
$columnIndex * $baseBlockSize,
|
|
||||||
$rowIndex * $baseBlockSize,
|
|
||||||
($columnIndex + 1) * $baseBlockSize - 1,
|
|
||||||
($rowIndex + 1) * $baseBlockSize - 1,
|
|
||||||
$foregroundColor
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$targetWidth = $matrix->getOuterSize();
|
|
||||||
$targetHeight = $matrix->getOuterSize();
|
|
||||||
|
|
||||||
if ($label instanceof LabelInterface) {
|
|
||||||
$labelImageData = LabelImageData::createForLabel($label);
|
|
||||||
$targetHeight += $labelImageData->getHeight() + $label->getMargin()->getTop() + $label->getMargin()->getBottom();
|
|
||||||
}
|
|
||||||
|
|
||||||
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
|
|
||||||
|
|
||||||
if (!$targetImage) {
|
|
||||||
throw new \Exception('Unable to generate image: please check if the GD extension is enabled and configured correctly');
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var int $backgroundColor */
|
|
||||||
$backgroundColor = imagecolorallocatealpha(
|
|
||||||
$targetImage,
|
|
||||||
$qrCode->getBackgroundColor()->getRed(),
|
|
||||||
$qrCode->getBackgroundColor()->getGreen(),
|
|
||||||
$qrCode->getBackgroundColor()->getBlue(),
|
|
||||||
$qrCode->getBackgroundColor()->getAlpha()
|
|
||||||
);
|
|
||||||
|
|
||||||
imagefill($targetImage, 0, 0, $backgroundColor);
|
|
||||||
|
|
||||||
imagecopyresampled(
|
|
||||||
$targetImage,
|
|
||||||
$baseImage,
|
|
||||||
$matrix->getMarginLeft(),
|
|
||||||
$matrix->getMarginLeft(),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$matrix->getInnerSize(),
|
|
||||||
$matrix->getInnerSize(),
|
|
||||||
imagesx($baseImage),
|
|
||||||
imagesy($baseImage)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 80000) {
|
|
||||||
imagedestroy($baseImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($qrCode->getBackgroundColor()->getAlpha() > 0) {
|
|
||||||
imagesavealpha($targetImage, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = new PngResult($targetImage);
|
|
||||||
|
|
||||||
if ($logo instanceof LogoInterface) {
|
|
||||||
$result = $this->addLogo($logo, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($label instanceof LabelInterface) {
|
|
||||||
$result = $this->addLabel($label, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function addLogo(LogoInterface $logo, PngResult $result): PngResult
|
|
||||||
{
|
|
||||||
$logoImageData = LogoImageData::createForLogo($logo);
|
|
||||||
|
|
||||||
if ('image/svg+xml' === $logoImageData->getMimeType()) {
|
|
||||||
throw new \Exception('PNG Writer does not support SVG logo');
|
|
||||||
}
|
|
||||||
|
|
||||||
$targetImage = $result->getImage();
|
|
||||||
|
|
||||||
if ($logoImageData->getPunchoutBackground()) {
|
|
||||||
/** @var int $transparent */
|
|
||||||
$transparent = imagecolorallocatealpha($targetImage, 255, 255, 255, 127);
|
|
||||||
imagealphablending($targetImage, false);
|
|
||||||
for (
|
|
||||||
$x_offset = intval(imagesx($targetImage) / 2 - $logoImageData->getWidth() / 2);
|
|
||||||
$x_offset < intval(imagesx($targetImage) / 2 - $logoImageData->getWidth() / 2) + $logoImageData->getWidth();
|
|
||||||
++$x_offset
|
|
||||||
) {
|
|
||||||
for (
|
|
||||||
$y_offset = intval(imagesy($targetImage) / 2 - $logoImageData->getHeight() / 2);
|
|
||||||
$y_offset < intval(imagesy($targetImage) / 2 - $logoImageData->getHeight() / 2) + $logoImageData->getHeight();
|
|
||||||
++$y_offset
|
|
||||||
) {
|
|
||||||
imagesetpixel(
|
|
||||||
$targetImage,
|
|
||||||
$x_offset,
|
|
||||||
$y_offset,
|
|
||||||
$transparent
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
imagecopyresampled(
|
|
||||||
$targetImage,
|
|
||||||
$logoImageData->getImage(),
|
|
||||||
intval(imagesx($targetImage) / 2 - $logoImageData->getWidth() / 2),
|
|
||||||
intval(imagesx($targetImage) / 2 - $logoImageData->getHeight() / 2),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$logoImageData->getWidth(),
|
|
||||||
$logoImageData->getHeight(),
|
|
||||||
imagesx($logoImageData->getImage()),
|
|
||||||
imagesy($logoImageData->getImage())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 80000) {
|
|
||||||
imagedestroy($logoImageData->getImage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return new PngResult($targetImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function addLabel(LabelInterface $label, PngResult $result): PngResult
|
|
||||||
{
|
|
||||||
$targetImage = $result->getImage();
|
|
||||||
|
|
||||||
$labelImageData = LabelImageData::createForLabel($label);
|
|
||||||
|
|
||||||
/** @var int $textColor */
|
|
||||||
$textColor = imagecolorallocatealpha(
|
|
||||||
$targetImage,
|
|
||||||
$label->getTextColor()->getRed(),
|
|
||||||
$label->getTextColor()->getGreen(),
|
|
||||||
$label->getTextColor()->getBlue(),
|
|
||||||
$label->getTextColor()->getAlpha()
|
|
||||||
);
|
|
||||||
|
|
||||||
$x = intval(imagesx($targetImage) / 2 - $labelImageData->getWidth() / 2);
|
|
||||||
$y = imagesy($targetImage) - $label->getMargin()->getBottom();
|
|
||||||
|
|
||||||
if ($label->getAlignment() instanceof LabelAlignmentLeft) {
|
|
||||||
$x = $label->getMargin()->getLeft();
|
|
||||||
} elseif ($label->getAlignment() instanceof LabelAlignmentRight) {
|
|
||||||
$x = imagesx($targetImage) - $labelImageData->getWidth() - $label->getMargin()->getRight();
|
|
||||||
}
|
|
||||||
|
|
||||||
imagettftext($targetImage, $label->getFont()->getSize(), 0, $x, $y, $textColor, $label->getFont()->getPath(), $label->getText());
|
|
||||||
|
|
||||||
return new PngResult($targetImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validateResult(ResultInterface $result, string $expectedData): void
|
|
||||||
{
|
|
||||||
$string = $result->getString();
|
|
||||||
|
|
||||||
if (!class_exists(QrReader::class)) {
|
|
||||||
throw new \Exception('Please install khanamiryan/qrcode-detector-decoder or disable image validation');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PHP_VERSION_ID >= 80000) {
|
|
||||||
throw new \Exception('The validator is not compatible with PHP 8 yet, see https://github.com/khanamiryan/php-qrcode-detector-decoder/pull/103');
|
|
||||||
}
|
|
||||||
|
|
||||||
$reader = new QrReader($string, QrReader::SOURCE_TYPE_BLOB);
|
|
||||||
if ($reader->text() !== $expectedData) {
|
|
||||||
throw new \Exception('Built-in validation reader read "'.$reader->text().'" instead of "'.$expectedData.'".
|
|
||||||
Adjust your parameters to increase readability or disable built-in validation.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,20 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Endroid\QrCode\Writer\Result;
|
namespace Endroid\QrCode\Writer\Result;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Matrix\MatrixInterface;
|
||||||
|
|
||||||
abstract class AbstractResult implements ResultInterface
|
abstract class AbstractResult implements ResultInterface
|
||||||
{
|
{
|
||||||
|
public function __construct(
|
||||||
|
private MatrixInterface $matrix
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMatrix(): MatrixInterface
|
||||||
|
{
|
||||||
|
return $this->matrix;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDataUri(): string
|
public function getDataUri(): string
|
||||||
{
|
{
|
||||||
return 'data:'.$this->getMimeType().';base64,'.base64_encode($this->getString());
|
return 'data:'.$this->getMimeType().';base64,'.base64_encode($this->getString());
|
||||||
|
@ -8,19 +8,19 @@ use Endroid\QrCode\Matrix\MatrixInterface;
|
|||||||
|
|
||||||
final class BinaryResult extends AbstractResult
|
final class BinaryResult extends AbstractResult
|
||||||
{
|
{
|
||||||
private MatrixInterface $matrix;
|
|
||||||
|
|
||||||
public function __construct(MatrixInterface $matrix)
|
public function __construct(MatrixInterface $matrix)
|
||||||
{
|
{
|
||||||
$this->matrix = $matrix;
|
parent::__construct($matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getString(): string
|
public function getString(): string
|
||||||
{
|
{
|
||||||
|
$matrix = $this->getMatrix();
|
||||||
|
|
||||||
$binaryString = '';
|
$binaryString = '';
|
||||||
for ($rowIndex = 0; $rowIndex < $this->matrix->getBlockCount(); ++$rowIndex) {
|
for ($rowIndex = 0; $rowIndex < $matrix->getBlockCount(); ++$rowIndex) {
|
||||||
for ($columnIndex = 0; $columnIndex < $this->matrix->getBlockCount(); ++$columnIndex) {
|
for ($columnIndex = 0; $columnIndex < $matrix->getBlockCount(); ++$columnIndex) {
|
||||||
$binaryString .= $this->matrix->getBlockValue($rowIndex, $columnIndex);
|
$binaryString .= $matrix->getBlockValue($rowIndex, $columnIndex);
|
||||||
}
|
}
|
||||||
$binaryString .= "\n";
|
$binaryString .= "\n";
|
||||||
}
|
}
|
||||||
|
69
vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php
vendored
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer\Result;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Color\ColorInterface;
|
||||||
|
use Endroid\QrCode\Matrix\MatrixInterface;
|
||||||
|
|
||||||
|
class ConsoleResult extends AbstractResult
|
||||||
|
{
|
||||||
|
private const TWO_BLOCKS = [
|
||||||
|
0 => ' ',
|
||||||
|
1 => "\xe2\x96\x80",
|
||||||
|
2 => "\xe2\x96\x84",
|
||||||
|
3 => "\xe2\x96\x88",
|
||||||
|
];
|
||||||
|
|
||||||
|
private string $colorEscapeCode;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
MatrixInterface $matrix,
|
||||||
|
ColorInterface $foreground,
|
||||||
|
ColorInterface $background
|
||||||
|
) {
|
||||||
|
parent::__construct($matrix);
|
||||||
|
|
||||||
|
$this->colorEscapeCode = sprintf(
|
||||||
|
"\e[38;2;%d;%d;%dm\e[48;2;%d;%d;%dm",
|
||||||
|
$foreground->getRed(),
|
||||||
|
$foreground->getGreen(),
|
||||||
|
$foreground->getBlue(),
|
||||||
|
$background->getRed(),
|
||||||
|
$background->getGreen(),
|
||||||
|
$background->getBlue()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMimeType(): string
|
||||||
|
{
|
||||||
|
return 'text/plain';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getString(): string
|
||||||
|
{
|
||||||
|
$matrix = $this->getMatrix();
|
||||||
|
|
||||||
|
$side = $matrix->getBlockCount();
|
||||||
|
$marginLeft = $this->colorEscapeCode.self::TWO_BLOCKS[0].self::TWO_BLOCKS[0];
|
||||||
|
$marginRight = self::TWO_BLOCKS[0].self::TWO_BLOCKS[0]."\e[0m".PHP_EOL;
|
||||||
|
$marginVertical = $marginLeft.str_repeat(self::TWO_BLOCKS[0], $side).$marginRight;
|
||||||
|
|
||||||
|
$qrCodeString = $marginVertical;
|
||||||
|
for ($rowIndex = 0; $rowIndex < $side; $rowIndex += 2) {
|
||||||
|
$qrCodeString .= $marginLeft;
|
||||||
|
for ($columnIndex = 0; $columnIndex < $side; ++$columnIndex) {
|
||||||
|
$combined = $matrix->getBlockValue($rowIndex, $columnIndex);
|
||||||
|
if ($rowIndex + 1 < $side) {
|
||||||
|
$combined |= $matrix->getBlockValue($rowIndex + 1, $columnIndex) << 1;
|
||||||
|
}
|
||||||
|
$qrCodeString .= self::TWO_BLOCKS[$combined];
|
||||||
|
}
|
||||||
|
$qrCodeString .= $marginRight;
|
||||||
|
}
|
||||||
|
$qrCodeString .= $marginVertical;
|
||||||
|
|
||||||
|
return $qrCodeString;
|
||||||
|
}
|
||||||
|
}
|
@ -6,26 +6,22 @@ namespace Endroid\QrCode\Writer\Result;
|
|||||||
|
|
||||||
use Endroid\QrCode\Label\LabelInterface;
|
use Endroid\QrCode\Label\LabelInterface;
|
||||||
use Endroid\QrCode\Logo\LogoInterface;
|
use Endroid\QrCode\Logo\LogoInterface;
|
||||||
|
use Endroid\QrCode\Matrix\MatrixInterface;
|
||||||
use Endroid\QrCode\QrCodeInterface;
|
use Endroid\QrCode\QrCodeInterface;
|
||||||
|
|
||||||
final class DebugResult extends AbstractResult
|
final class DebugResult extends AbstractResult
|
||||||
{
|
{
|
||||||
private QrCodeInterface $qrCode;
|
|
||||||
private ?LogoInterface $logo;
|
|
||||||
private ?LabelInterface $label;
|
|
||||||
|
|
||||||
/** @var array<mixed> */
|
|
||||||
private array $options;
|
|
||||||
|
|
||||||
private bool $validateResult = false;
|
private bool $validateResult = false;
|
||||||
|
|
||||||
/** @param array<mixed> $options */
|
public function __construct(
|
||||||
public function __construct(QrCodeInterface $qrCode, LogoInterface $logo = null, LabelInterface $label = null, array $options = [])
|
MatrixInterface $matrix,
|
||||||
{
|
private QrCodeInterface $qrCode,
|
||||||
$this->qrCode = $qrCode;
|
private LogoInterface|null $logo = null,
|
||||||
$this->logo = $logo;
|
private LabelInterface|null $label = null,
|
||||||
$this->label = $label;
|
/** @var array<string, mixed> $options */
|
||||||
$this->options = $options;
|
private array $options = []
|
||||||
|
) {
|
||||||
|
parent::__construct($matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setValidateResult(bool $validateResult): void
|
public function setValidateResult(bool $validateResult): void
|
||||||
|
@ -4,15 +4,16 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Endroid\QrCode\Writer\Result;
|
namespace Endroid\QrCode\Writer\Result;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Matrix\MatrixInterface;
|
||||||
|
|
||||||
final class EpsResult extends AbstractResult
|
final class EpsResult extends AbstractResult
|
||||||
{
|
{
|
||||||
/** @var array<string> */
|
public function __construct(
|
||||||
private array $lines;
|
MatrixInterface $matrix,
|
||||||
|
/** @var array<string> $lines */
|
||||||
/** @param array<string> $lines */
|
private array $lines
|
||||||
public function __construct(array $lines)
|
) {
|
||||||
{
|
parent::__construct($matrix);
|
||||||
$this->lines = $lines;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getString(): string
|
public function getString(): string
|
||||||
|
32
vendor/endroid/qr-code/src/Writer/Result/GdResult.php
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer\Result;
|
||||||
|
|
||||||
|
use Endroid\QrCode\Matrix\MatrixInterface;
|
||||||
|
|
||||||
|
class GdResult extends AbstractResult
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
MatrixInterface $matrix,
|
||||||
|
protected \GdImage $image
|
||||||
|
) {
|
||||||
|
parent::__construct($matrix);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImage(): \GdImage
|
||||||
|
{
|
||||||
|
return $this->image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getString(): string
|
||||||
|
{
|
||||||
|
throw new \Exception('You can only use this method in a concrete implementation');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMimeType(): string
|
||||||
|
{
|
||||||
|
throw new \Exception('You can only use this method in a concrete implementation');
|
||||||
|
}
|
||||||
|
}
|
21
vendor/endroid/qr-code/src/Writer/Result/GifResult.php
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Endroid\QrCode\Writer\Result;
|
||||||
|
|
||||||
|
final class GifResult extends GdResult
|
||||||
|
{
|
||||||
|
public function getString(): string
|
||||||
|
{
|
||||||
|
ob_start();
|
||||||
|
imagegif($this->image);
|
||||||
|
|
||||||
|
return strval(ob_get_clean());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMimeType(): string
|
||||||
|
{
|
||||||
|
return 'image/gif';
|
||||||
|
}
|
||||||
|
}
|