MCPcopy Create free account
hub / github.com/codemistic/Web-Development / buildCache

Method buildCache

text-to-qr/lib/phpqrcode/phpqrcode.php:212–231  ·  view source on GitHub ↗

----------------------------------------------------------------------

()

Source from the content-addressed store, hash-verified

210
211 //----------------------------------------------------------------------
212 public static function buildCache()
213 {
214 QRtools::markTime('before_build_cache');
215
216 $mask = new QRmask();
217 for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) {
218 $frame = QRspec::newFrame($a);
219 if (QR_IMAGE) {
220 $fileName = QR_CACHE_DIR.'frame_'.$a.'.png';
221 QRimage::png(self::binarize($frame), $fileName, 1, 0);
222 }
223
224 $width = count($frame);
225 $bitMask = array_fill(0, $width, array_fill(0, $width, 0));
226 for ($maskNo=0; $maskNo<8; $maskNo++)
227 $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true);
228 }
229
230 QRtools::markTime('after_build_cache');
231 }
232
233 //----------------------------------------------------------------------
234 public static function log($outfile, $err)

Callers

nothing calls this directly

Calls 6

binarizeMethod · 0.95
countFunction · 0.85
markTimeMethod · 0.45
newFrameMethod · 0.45
pngMethod · 0.45
makeMaskNoMethod · 0.45

Tested by

no test coverage detected