| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- $QR_BASEDIR = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
- $QR_TOOLSDIR = dirname(__FILE__) . DIRECTORY_SEPARATOR;
- $outputFile = $QR_BASEDIR . 'phpqrcode.php';
- $fileList = array($QR_BASEDIR . 'qrconst.php', $QR_TOOLSDIR . 'merged_config.php', $QR_BASEDIR . 'qrtools.php', $QR_BASEDIR . 'qrspec.php', $QR_BASEDIR . 'qrimage.php', $QR_BASEDIR . 'qrinput.php', $QR_BASEDIR . 'qrbitstream.php', $QR_BASEDIR . 'qrsplit.php', $QR_BASEDIR . 'qrrscode.php', $QR_BASEDIR . 'qrmask.php', $QR_BASEDIR . 'qrencode.php');
- $headerFile = $QR_TOOLSDIR . 'merged_header.php';
- $versionFile = $QR_BASEDIR . 'VERSION';
- $outputCode = '';
- foreach ($fileList as $fileName) {
- $outputCode .= '
- ' . '//---- ' . basename($fileName) . ' -----------------------------' . '
- ';
- $anotherCode = file_get_contents($fileName);
- $anotherCode = preg_replace('/^<\\?php/', '', $anotherCode);
- $anotherCode = preg_replace('/\\?>\\*$/', '', $anotherCode);
- $outputCode .= '
- ' . $anotherCode . '
- ';
- }
- $versionDataEx = explode('
- ', file_get_contents($versionFile));
- $outputContents = file_get_contents($headerFile);
- $outputContents .= '
- /*
- * Version: ' . trim($versionDataEx[0]) . '
- * Build: ' . trim($versionDataEx[1]) . '
- */
- ';
- $outputContents .= $outputCode;
- file_put_contents($outputFile, $outputContents);
- ?>
|