4 * PHP QR Code encoder
\r
6 * Tool for merging all library files into one, simpler to incorporate.
\r
8 * MAKE SURE THAT RESULTING PHPQRCode.php (and its dir) ARE WRITABLE!
\r
10 * PHP QR Code is distributed under LGPL 3
\r
11 * Copyright (C) 2010 Dominik Dzienia <deltalab at poczta dot fm>
\r
13 * This library is free software; you can redistribute it and/or
\r
14 * modify it under the terms of the GNU Lesser General Public
\r
15 * License as published by the Free Software Foundation; either
\r
16 * version 3 of the License, or any later version.
\r
18 * This library is distributed in the hope that it will be useful,
\r
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
21 * Lesser General Public License for more details.
\r
23 * You should have received a copy of the GNU Lesser General Public
\r
24 * License along with this library; if not, write to the Free Software
\r
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
28 $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
\r
29 $QR_TOOLSDIR = dirname(__FILE__).DIRECTORY_SEPARATOR;
\r
31 $outputFile = $QR_BASEDIR.'phpqrcode.php';
\r
36 $QR_BASEDIR.'qrconst.php',
\r
37 $QR_TOOLSDIR.'merged_config.php',
\r
38 $QR_BASEDIR.'qrtools.php',
\r
39 $QR_BASEDIR.'qrspec.php',
\r
40 $QR_BASEDIR.'qrimage.php',
\r
41 $QR_BASEDIR.'qrinput.php',
\r
42 $QR_BASEDIR.'qrbitstream.php',
\r
43 $QR_BASEDIR.'qrsplit.php',
\r
44 $QR_BASEDIR.'qrrscode.php',
\r
45 $QR_BASEDIR.'qrmask.php',
\r
46 $QR_BASEDIR.'qrencode.php'
\r
49 $headerFile = $QR_TOOLSDIR.'merged_header.php';
\r
50 $versionFile = $QR_BASEDIR.'VERSION';
\r
54 foreach($fileList as $fileName) {
\r
55 $outputCode .= "\n\n".'//---- '.basename($fileName).' -----------------------------'."\n\n";
\r
56 $anotherCode = file_get_contents($fileName);
\r
57 $anotherCode = preg_replace ('/^<\?php/', '', $anotherCode);
\r
58 $anotherCode = preg_replace ('/\?>\*$/', '', $anotherCode);
\r
59 $outputCode .= "\n\n".$anotherCode."\n\n";
\r
62 $versionDataEx = explode("\n", file_get_contents($versionFile));
\r
64 $outputContents = file_get_contents($headerFile);
\r
65 $outputContents .= "\n\n/*\n * Version: ".trim($versionDataEx[0])."\n * Build: ".trim($versionDataEx[1])."\n */\n\n";
\r
66 $outputContents .= $outputCode;
\r
68 file_put_contents($outputFile, $outputContents);
\r