mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-10 01:36:25 +00:00
Deploying to readthedocs from @ chillerlan/php-qrcode@7448525638 🚀
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="../Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="../Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
@@ -538,14 +538,15 @@ It returns a 2-element array that contains the values in a format that can be us
|
||||
<section id="collectmodules">
|
||||
<h3><code class="docutils literal notranslate"><span class="pre">collectModules()</span></code><a class="headerlink" href="#collectmodules" title="Link to this heading"></a></h3>
|
||||
<p>The module collector is particularly useful for plain text based file formats, for example the various markup languages like SVG and HTML or other structured file formats such as EPS.
|
||||
This method takes a <code class="docutils literal notranslate"><span class="pre">Closure</span></code> as a parameter, which is called with 4 parameters: the module coordinates <code class="docutils literal notranslate"><span class="pre">$x</span></code> and <code class="docutils literal notranslate"><span class="pre">$y</span></code>, the <code class="docutils literal notranslate"><span class="pre">$M_TYPE</span></code> and <code class="docutils literal notranslate"><span class="pre">$M_TYPE_LAYER</span></code>.
|
||||
This method calls a method <code class="docutils literal notranslate"><span class="pre">moduleTransform()</span></code> internally with 4 parameters: the module coordinates <code class="docutils literal notranslate"><span class="pre">$x</span></code> and <code class="docutils literal notranslate"><span class="pre">$y</span></code>, the <code class="docutils literal notranslate"><span class="pre">$M_TYPE</span></code> and <code class="docutils literal notranslate"><span class="pre">$M_TYPE_LAYER</span></code>.
|
||||
The transform method should return a value that is valid for a single module of the QR matrix, or <code class="docutils literal notranslate"><span class="pre">null</span></code> if no transform was performed for the current module.
|
||||
The <code class="docutils literal notranslate"><span class="pre">$M_TYPE_LAYER</span></code> is a copy of the <code class="docutils literal notranslate"><span class="pre">$M_TYPE</span></code> that represents the array key of the returned array and that may have been reassigned in the collector to another path layer, e.g. through <code class="docutils literal notranslate"><span class="pre">QROptions::$connectPaths</span></code>.</p>
|
||||
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">MyOutput</span> <span class="k">extends</span> <span class="nx">QROutputAbstract</span><span class="p">{</span>
|
||||
|
||||
<span class="k">public</span> <span class="k">function</span> <span class="nf">dump</span><span class="p">(</span><span class="nx">string</span> <span class="nv">$file</span> <span class="o">=</span> <span class="k">null</span><span class="p">)</span><span class="o">:</span><span class="nx">string</span><span class="p">{</span>
|
||||
|
||||
<span class="c1">// collect the modules for the path elements</span>
|
||||
<span class="nv">$paths</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">collectModules</span><span class="p">(</span><span class="nx">fn</span><span class="p">(</span><span class="nx">int</span> <span class="nv">$x</span><span class="p">,</span> <span class="nx">int</span> <span class="nv">$y</span><span class="p">,</span> <span class="nx">int</span> <span class="nv">$M_TYPE</span><span class="p">)</span><span class="o">:</span><span class="nx">string</span> <span class="o">=></span> <span class="nb">sprintf</span><span class="p">(</span><span class="s1">'%d %d %012b'</span><span class="p">,</span> <span class="nv">$x</span><span class="p">,</span> <span class="nv">$y</span><span class="p">,</span> <span class="nv">$M_TYPE</span><span class="p">));</span>
|
||||
<span class="nv">$paths</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">collectModules</span><span class="p">();</span>
|
||||
|
||||
<span class="c1">// loop over the paths</span>
|
||||
<span class="k">foreach</span><span class="p">(</span><span class="nv">$paths</span> <span class="k">as</span> <span class="nv">$M_TYPE_LAYER</span> <span class="o">=></span> <span class="o">&</span><span class="nv">$path</span><span class="p">){</span>
|
||||
@@ -560,6 +561,10 @@ The <code class="docutils literal notranslate"><span class="pre">$M_TYPE_LAYER</
|
||||
<span class="k">return</span> <span class="nb">implode</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="na">options</span><span class="o">-></span><span class="na">eol</span><span class="p">,</span> <span class="nv">$paths</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">protected</span> <span class="k">function</span> <span class="nf">moduleTransform</span><span class="p">(</span><span class="nx">int</span> <span class="nv">$x</span><span class="p">,</span> <span class="nx">int</span> <span class="nv">$y</span><span class="p">,</span> <span class="nx">int</span> <span class="nv">$M_TYPE</span><span class="p">,</span> <span class="nx">int</span> <span class="nv">$M_TYPE_LAYER</span><span class="p">)</span><span class="o">:</span><span class="nx">string</span><span class="p">{</span>
|
||||
<span class="k">return</span> <span class="nb">sprintf</span><span class="p">(</span><span class="s1">'%d %d %012b'</span><span class="p">,</span> <span class="nv">$x</span><span class="p">,</span> <span class="nv">$y</span><span class="p">,</span> <span class="nv">$M_TYPE</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="p">}</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
@@ -395,6 +395,10 @@ A list with all available <code class="docutils literal notranslate"><span class
|
||||
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="nv">$options</span><span class="o">-></span><span class="na">fromIterable</span><span class="p">(</span><span class="nv">$myOptions</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>In addition to that, you can also supply the <code class="docutils literal notranslate"><span class="pre">iterable</span></code> of option values directly to the <code class="docutils literal notranslate"><span class="pre">QRCode</span></code> constructor (v6+):</p>
|
||||
<div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="nv">$qrCode</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">QRCode</span><span class="p">(</span><span class="nv">$myOptions</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="load-and-save-options-from-to-json">
|
||||
<h3>Load and save options from/to JSON<a class="headerlink" href="#load-and-save-options-from-to-json" title="Link to this heading"></a></h3>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
+17
-9
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
@@ -372,7 +372,7 @@
|
||||
<p>Installation via <a class="reference external" href="https://getcomposer.org/doc/04-schema.md"><code class="docutils literal notranslate"><span class="pre">composer.json</span></code></a>:</p>
|
||||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||||
<span class="w"> </span><span class="nt">"require"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
||||
<span class="w"> </span><span class="nt">"php"</span><span class="p">:</span><span class="w"> </span><span class="s2">"^7.4"</span><span class="p">,</span>
|
||||
<span class="w"> </span><span class="nt">"php"</span><span class="p">:</span><span class="w"> </span><span class="s2">"^8.2"</span><span class="p">,</span>
|
||||
<span class="w"> </span><span class="nt">"chillerlan/php-qrcode"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-main"</span>
|
||||
<span class="w"> </span><span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
@@ -414,7 +414,7 @@ composer<span class="w"> </span>require<span class="w"> </span>chillerlan/php-qr
|
||||
After that, run <code class="docutils literal notranslate"><span class="pre">composer</span> <span class="pre">install</span></code> in the package root directory to install the required dependencies and generate <code class="docutils literal notranslate"><span class="pre">./vendor/autoload.php</span></code>.</p>
|
||||
<p>Profit!</p>
|
||||
<section id="can-i-use-this-library-without-using-composer">
|
||||
<h3>Can i use this library without using composer?<a class="headerlink" href="#can-i-use-this-library-without-using-composer" title="Link to this heading"></a></h3>
|
||||
<h3>Can I use this library without using composer?<a class="headerlink" href="#can-i-use-this-library-without-using-composer" title="Link to this heading"></a></h3>
|
||||
<p>You can, but it’s absolutely not recommended, nor supported.</p>
|
||||
<p>With that said, I’ll leave you with this info:</p>
|
||||
<ul class="simple">
|
||||
@@ -440,23 +440,31 @@ After that, run <code class="docutils literal notranslate"><span class="pre">com
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="row-even"><td><p><strong>v5</strong></p></td>
|
||||
<tr class="row-even"><td><p><strong>v6</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/main"><code class="docutils literal notranslate"><span class="pre">dev-main</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">^8.2</span></code></p></td>
|
||||
<td><p>yes</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code> or <code class="docutils literal notranslate"><span class="pre">imagick</span></code> required for reading QR Codes, <code class="docutils literal notranslate"><span class="pre">fileinfo</span></code> is used in <code class="docutils literal notranslate"><span class="pre">QRImagick</span></code></p></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><strong>v5</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v5.0.x"><code class="docutils literal notranslate"><span class="pre">5.0.5</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">^7.4 || ^8.0</span></code></p></td>
|
||||
<td><p>yes</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code> or <code class="docutils literal notranslate"><span class="pre">imagick</span></code> required for reading QR Codes, <code class="docutils literal notranslate"><span class="pre">fileinfo</span></code> is used in <code class="docutils literal notranslate"><span class="pre">QRImagick</span></code></p></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><strong>v4</strong></p></td>
|
||||
<tr class="row-even"><td><p><strong>v4</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v4.3.x"><code class="docutils literal notranslate"><span class="pre">4.3.4</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">^7.4 || ^8.0</span></code></p></td>
|
||||
<td><p>yes</p></td>
|
||||
<td><p>no</p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">gd</span></code>, <code class="docutils literal notranslate"><span class="pre">mbstring</span></code></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">imagick</span></code></p></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><strong>v3</strong></p></td>
|
||||
<tr class="row-odd"><td><p><strong>v3</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v3.2.x"><code class="docutils literal notranslate"><span class="pre">3.4.1</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">^7.2</span></code></p></td>
|
||||
<td><p>no</p></td>
|
||||
@@ -464,7 +472,7 @@ After that, run <code class="docutils literal notranslate"><span class="pre">com
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">imagick</span></code></p></td>
|
||||
<td><p>v3.4.1 also supports PHP8</p></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><p><strong>v2</strong></p></td>
|
||||
<tr class="row-even"><td><p><strong>v2</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v2.0.x"><code class="docutils literal notranslate"><span class="pre">2.0.8</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">>=7.0.3</span></code></p></td>
|
||||
<td><p>no</p></td>
|
||||
@@ -472,7 +480,7 @@ After that, run <code class="docutils literal notranslate"><span class="pre">com
|
||||
<td><p></p></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><p><strong>v1</strong></p></td>
|
||||
<tr class="row-odd"><td><p><strong>v1</strong></p></td>
|
||||
<td><p><a class="reference external" href="https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5"><code class="docutils literal notranslate"><span class="pre">1.0.9</span></code></a></p></td>
|
||||
<td><p><code class="docutils literal notranslate"><span class="pre">>=5.6</span></code></p></td>
|
||||
<td><p>no</p></td>
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
@@ -197,7 +197,8 @@ class MyOutput extends QROutputAbstract{
|
||||
### `collectModules()`
|
||||
|
||||
The module collector is particularly useful for plain text based file formats, for example the various markup languages like SVG and HTML or other structured file formats such as EPS.
|
||||
This method takes a `Closure` as a parameter, which is called with 4 parameters: the module coordinates `$x` and `$y`, the `$M_TYPE` and `$M_TYPE_LAYER`.
|
||||
This method calls a method `moduleTransform()` internally with 4 parameters: the module coordinates `$x` and `$y`, the `$M_TYPE` and `$M_TYPE_LAYER`.
|
||||
The transform method should return a value that is valid for a single module of the QR matrix, or `null` if no transform was performed for the current module.
|
||||
The `$M_TYPE_LAYER` is a copy of the `$M_TYPE` that represents the array key of the returned array and that may have been reassigned in the collector to another path layer, e.g. through `QROptions::$connectPaths`.
|
||||
|
||||
```php
|
||||
@@ -206,7 +207,7 @@ class MyOutput extends QROutputAbstract{
|
||||
public function dump(string $file = null):string{
|
||||
|
||||
// collect the modules for the path elements
|
||||
$paths = $this->collectModules(fn(int $x, int $y, int $M_TYPE):string => sprintf('%d %d %012b', $x, $y, $M_TYPE));
|
||||
$paths = $this->collectModules();
|
||||
|
||||
// loop over the paths
|
||||
foreach($paths as $M_TYPE_LAYER => &$path){
|
||||
@@ -221,6 +222,10 @@ class MyOutput extends QROutputAbstract{
|
||||
return implode($this->options->eol, $paths);
|
||||
}
|
||||
|
||||
protected function moduleTransform(int $x, int $y, int $M_TYPE, int $M_TYPE_LAYER):string{
|
||||
return sprintf('%d %d %012b', $x, $y, $M_TYPE);
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@ You can also set an `iterable` of options on an existing QROptions instance:
|
||||
$options->fromIterable($myOptions);
|
||||
```
|
||||
|
||||
In addition to that, you can also supply the `iterable` of option values directly to the `QRCode` constructor (v6+):
|
||||
|
||||
```php
|
||||
$qrCode = new QRCode($myOptions);
|
||||
```
|
||||
|
||||
|
||||
### Load and save options from/to JSON
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Installation via [`composer.json`](https://getcomposer.org/doc/04-schema.md):
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"php": "^7.4",
|
||||
"php": "^8.2",
|
||||
"chillerlan/php-qrcode": "dev-main"
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ After that, run `composer install` in the package root directory to install the
|
||||
Profit!
|
||||
|
||||
|
||||
### Can i use this library without using composer?
|
||||
### Can I use this library without using composer?
|
||||
|
||||
You can, but it's absolutely not recommended, nor supported.
|
||||
|
||||
@@ -82,8 +82,9 @@ The PHP built-in extensions [GdImage](https://www.php.net/manual/book.image.php)
|
||||
|
||||
| version | branch/tag | PHP | supported | required extensions | optional extensions | info |
|
||||
|---------|----------------------------------------------------------------------|------------------|-----------|---------------------|------------------------------------------------------------------------------------|---------------------------|
|
||||
| **v5** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v4** | [`4.3.4`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | yes | `gd`, `mbstring` | `imagick` | |
|
||||
| **v6** | [`dev-main`](https://github.com/chillerlan/php-qrcode/tree/main) | `^8.2` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v5** | [`5.0.5`](https://github.com/chillerlan/php-qrcode/tree/v5.0.x) | `^7.4 \|\| ^8.0` | yes | `mbstring` | `gd` or `imagick` required for reading QR Codes, `fileinfo` is used in `QRImagick` | |
|
||||
| **v4** | [`4.3.4`](https://github.com/chillerlan/php-qrcode/tree/v4.3.x) | `^7.4 \|\| ^8.0` | no | `gd`, `mbstring` | `imagick` | |
|
||||
| **v3** | [`3.4.1`](https://github.com/chillerlan/php-qrcode/tree/v3.2.x) | `^7.2` | no | `gd`, `mbstring` | `imagick` | v3.4.1 also supports PHP8 |
|
||||
| **v2** | [`2.0.8`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x) | `>=7.0.3` | no | `gd`, `mbstring` | | |
|
||||
| **v1** | [`1.0.9`](https://github.com/chillerlan/php-qrcode/tree/v2.0.x-php5) | `>=5.6` | no | `gd`, `mbstring` | | please let PHP 5 die! |
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
@@ -383,7 +383,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#manual-installation">Manual installation</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can i use this library without using composer?</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="Usage/Installation.html#can-i-use-this-library-without-using-composer">Can I use this library without using composer?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="Usage/Installation.html#supported-php-versions-extension-requirements">Supported PHP versions & extension requirements</a></li>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user