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

Method buildCache

text-to-qr/lib/phpqrcode/qrtools.php:79–98  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

77
78 //----------------------------------------------------------------------
79 public static function buildCache()
80 {
81 QRtools::markTime('before_build_cache');
82
83 $mask = new QRmask();
84 for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) {
85 $frame = QRspec::newFrame($a);
86 if (QR_IMAGE) {
87 $fileName = QR_CACHE_DIR.'frame_'.$a.'.png';
88 QRimage::png(self::binarize($frame), $fileName, 1, 0);
89 }
90
91 $width = count($frame);
92 $bitMask = array_fill(0, $width, array_fill(0, $width, 0));
93 for ($maskNo=0; $maskNo<8; $maskNo++)
94 $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true);
95 }
96
97 QRtools::markTime('after_build_cache');
98 }
99
100 //----------------------------------------------------------------------
101 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