Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 304 lines (284 sloc) 12.071 kb
56ac3d18 »
2012-05-25 Mark scripts as executable
1 #!/usr/bin/env php
667bfec4 » jakubvrana
2007-07-02 Decomposition
2 <?php
1bc77f88 » jakubvrana
2009-08-28 Report user errors
3 error_reporting(6135); // errors and warnings
e1bc7af8 » jakubvrana
2009-06-13 Change directory structure
4 include dirname(__FILE__) . "/adminer/include/version.inc.php";
bf4f0a1f »
2012-03-08 Replace JSMin by JsShrink
5 include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
7f3b4f2b » jakubvrana
2009-05-29 Version checker
6
bf4f0a1f »
2012-03-08 Replace JSMin by JsShrink
7 if (!function_exists('jsShrink')) {
8 function jsShrink($code) {
9 return $code;
c1f83825 »
2010-05-06 Internal JSMin if external is not found
10 }
11 }
12
89436789 » jakubvrana
2007-07-09 sprintf() in lang()
13 function add_apo_slashes($s) {
14 return addcslashes($s, "\\'");
15 }
16
0970a583 » jakubvrana
2007-07-05 Prepare for single language version
17 function remove_lang($match) {
bba76d8d » jakubvrana
2007-08-04 Flatten $translations
18 global $translations;
438ca058 » jakubvrana
2007-07-26 Separate languages
19 $idf = strtr($match[2], array("\\'" => "'", "\\\\" => "\\"));
bba76d8d » jakubvrana
2007-08-04 Flatten $translations
20 $s = ($translations[$idf] ? $translations[$idf] : $idf);
64ba9242 » jakubvrana
2009-06-21 Comments
21 if ($match[3] == ",") { // lang() has parameters
89436789 » jakubvrana
2007-07-09 sprintf() in lang()
22 return "$match[1]" . (is_array($s) ? "lang(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
23 }
24 return ($match[1] && $match[4] ? $s : "$match[1]'" . add_apo_slashes($s) . "'$match[4]");
0970a583 » jakubvrana
2007-07-05 Prepare for single language version
25 }
26
4738060a » jakubvrana
2008-05-23 Use numeric language IDs to save bytes
27 function lang_ids($match) {
28 global $lang_ids;
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
29 $lang_id = &$lang_ids[stripslashes($match[1])];
6591d485 »
2012-05-13 Replace isset($var) by $var !== null
30 if ($lang_id === null) {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
31 $lang_id = count($lang_ids) - 1;
32 }
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
33 return ($_SESSION["lang"] ? $match[0] : "lang($lang_id$match[2]");
4738060a » jakubvrana
2008-05-23 Use numeric language IDs to save bytes
34 }
35
667bfec4 » jakubvrana
2007-07-02 Decomposition
36 function put_file($match) {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
37 global $project;
b95f24ea » jakubvrana
2009-07-03 Editor: User friendly data editor
38 if (basename($match[2]) == '$LANG.inc.php') {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
39 return $match[0]; // processed later
438ca058 » jakubvrana
2007-07-26 Separate languages
40 }
b95f24ea » jakubvrana
2009-07-03 Editor: User friendly data editor
41 $return = file_get_contents(dirname(__FILE__) . "/$project/$match[2]");
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
42 if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
64ba9242 » jakubvrana
2009-06-21 Comments
43 $tokens = token_get_all($return); // to find out the last token
6bb1401d » jakubvrana
2009-06-01 Remove ?><?php
44 return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
9a4cabe8 »
2011-07-11 Simplify single language version
45 } elseif (preg_match('~\\s*(\\$pos = (.+\n).+;)~sU', $return, $match2)) {
64ba9242 » jakubvrana
2009-06-21 Comments
46 // single language lang() is used for plural
e37c427e »
2010-12-30 Function get_lang useful for customization
47 return "function get_lang() {
48 return '$_SESSION[lang]';
49 }
50
51 function lang(\$translation, \$number) {
9a4cabe8 »
2011-07-11 Simplify single language version
52 \$pos = $match2[2]\t\t: " . (preg_match("~\\\$LANG == '$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . '
53 );
7f1fcc22 »
2012-06-04 Format numbers in translations
54 $translation = str_replace("%d", "%s", $translation[$pos]);
55 $number = number_format($number, 0, ".", lang(\',\'));
56 return sprintf($translation, $number);
e37c427e »
2010-12-30 Function get_lang useful for customization
57 }
58 ';
6bb1401d » jakubvrana
2009-06-01 Remove ?><?php
59 } else {
60 echo "lang() not found\n";
667bfec4 » jakubvrana
2007-07-02 Decomposition
61 }
62 }
63
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
64 function put_file_lang($match) {
b4b59779 »
2010-11-15 Include only active translations
65 global $lang_ids, $project, $langs;
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
66 if ($_SESSION["lang"]) {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
67 return "";
68 }
69 $return = "";
b4b59779 »
2010-11-15 Include only active translations
70 foreach ($langs as $lang => $val) {
71 include dirname(__FILE__) . "/adminer/lang/$lang.inc.php"; // assign $translations
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
72 $translation_ids = array_flip($lang_ids); // default translation
73 foreach ($translations as $key => $val) {
6591d485 »
2012-05-13 Replace isset($var) by $var !== null
74 if ($val !== null) {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
75 $translation_ids[$lang_ids[$key]] = $val;
76 }
77 }
b4b59779 »
2010-11-15 Include only active translations
78 $return .= "\tcase \"$lang\": \$translations = array(";
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
79 foreach ($translation_ids as $val) {
80 $return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
81 }
82 $return = substr($return, 0, -2) . "); break;\n";
83 }
84 return "switch (\$LANG) {\n$return}\n";
85 }
86
16f42102 » jakubvrana
2009-04-15 Function minification
87 function short_identifier($number, $chars) {
88 $return = '';
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
89 while ($number >= 0) {
b0666e53 »
2012-05-16 Remove unnecessary { } in compile
90 $return .= $chars[$number % strlen($chars)];
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
91 $number = floor($number / strlen($chars)) - 1;
92 }
93 return $return;
94 }
95
004d7a96 » jakubvrana
2009-07-24 Link
96 // based on http://latrine.dgx.cz/jak-zredukovat-php-skripty
794192d9 » jakubvrana
2007-09-04 php_shrink()
97 function php_shrink($input) {
cbdf09d8 »
2011-05-12 Show version in comment (thanks to David Grudl)
98 global $VERSION;
815eb26e » jakubvrana
2009-05-08 Use one token for all
99 $special_variables = array_flip(array('$this', '$GLOBALS', '$_GET', '$_POST', '$_FILES', '$_COOKIE', '$_SESSION', '$_SERVER'));
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
100 $short_variables = array();
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
101 $shortening = true;
16f42102 » jakubvrana
2009-04-15 Function minification
102 $tokens = token_get_all($input);
103
b0666e53 »
2012-05-16 Remove unnecessary { } in compile
104 // remove unnecessary { }
105 //! change also `while () { if () {;} }` to `while () if () ;` but be careful about `if () { if () { } } else { }
106 $shorten = 0;
107 $opening = -1;
108 foreach ($tokens as $i => $token) {
109 if (in_array($token[0], array(T_IF, T_ELSE, T_ELSEIF, T_WHILE, T_DO, T_FOR, T_FOREACH), true)) {
110 $shorten = ($token[0] == T_FOR ? 4 : 2);
111 $opening = -1;
112 } elseif (in_array($token[0], array(T_SWITCH, T_FUNCTION, T_CLASS, T_CLOSE_TAG), true)) {
113 $shorten = 0;
114 } elseif ($token === ';') {
115 $shorten--;
116 } elseif ($token === '{') {
117 if ($opening < 0) {
118 $opening = $i;
119 } elseif ($shorten > 1) {
120 $shorten = 0;
121 }
122 } elseif ($token === '}' && $opening >= 0 && $shorten == 1) {
123 unset($tokens[$opening]);
124 unset($tokens[$i]);
125 $shorten = 0;
126 $opening = -1;
127 }
128 }
129 $tokens = array_values($tokens);
130
16f42102 » jakubvrana
2009-04-15 Function minification
131 foreach ($tokens as $i => $token) {
132 if ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
133 $short_variables[$token[1]]++;
134 }
135 }
c27a8774 » jakubvrana
2009-04-16 Minify defined functions only
136
16f42102 » jakubvrana
2009-04-15 Function minification
137 arsort($short_variables);
0ced6d33 »
2011-08-09 Preserve short variable names between versions if possible
138 $chars = implode(range('a', 'z')) . '_' . implode(range('A', 'Z'));
139 // preserve variable names between versions if possible
140 $short_variables2 = array_splice($short_variables, strlen($chars));
141 ksort($short_variables);
142 ksort($short_variables2);
143 $short_variables += $short_variables2;
16f42102 » jakubvrana
2009-04-15 Function minification
144 foreach (array_keys($short_variables) as $number => $key) {
0ced6d33 »
2011-08-09 Preserve short variable names between versions if possible
145 $short_variables[$key] = short_identifier($number, $chars); // could use also numbers and \x7f-\xff
16f42102 » jakubvrana
2009-04-15 Function minification
146 }
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
147
794192d9 » jakubvrana
2007-09-04 php_shrink()
148 $set = array_flip(preg_split('//', '!"#$&\'()*+,-./:;<=>?@[\]^`{|}'));
149 $space = '';
150 $output = '';
ff85f125 » jakubvrana
2009-06-01 Join echos
151 $in_echo = false;
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
152 $doc_comment = false; // include only first /**
ff85f125 » jakubvrana
2009-06-01 Join echos
153 for (reset($tokens); list($i, $token) = each($tokens); ) {
794192d9 » jakubvrana
2007-09-04 php_shrink()
154 if (!is_array($token)) {
155 $token = array(0, $token);
156 }
dbf95669 » jakubvrana
2009-08-26 Better consecutive echo handling
157 if ($tokens[$i+2][0] === T_CLOSE_TAG && $tokens[$i+3][0] === T_INLINE_HTML && $tokens[$i+4][0] === T_OPEN_TAG
fc3b652a » jakubvrana
2009-12-03 Whitespace
158 && strlen(addcslashes($tokens[$i+3][1], "'\\")) < strlen($tokens[$i+3][1]) + 3
dbf95669 » jakubvrana
2009-08-26 Better consecutive echo handling
159 ) {
160 $tokens[$i+2] = array(T_ECHO, 'echo');
161 $tokens[$i+3] = array(T_CONSTANT_ENCAPSED_STRING, "'" . addcslashes($tokens[$i+3][1], "'\\") . "'");
162 $tokens[$i+4] = array(0, ';');
163 }
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
164 if ($token[0] == T_COMMENT || $token[0] == T_WHITESPACE || ($token[0] == T_DOC_COMMENT && $doc_comment)) {
794192d9 » jakubvrana
2007-09-04 php_shrink()
165 $space = "\n";
166 } else {
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
167 if ($token[0] == T_DOC_COMMENT) {
168 $doc_comment = true;
cbdf09d8 »
2011-05-12 Show version in comment (thanks to David Grudl)
169 $token[1] = substr_replace($token[1], "* @version $VERSION\n", -2, 0);
c16c57b1 » jakubvrana
2009-07-11 E-mail sending
170 }
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
171 if ($token[0] == T_VAR) {
172 $shortening = false;
173 } elseif (!$shortening) {
174 if ($token[1] == ';') {
175 $shortening = true;
176 }
ff85f125 » jakubvrana
2009-06-01 Join echos
177 } elseif ($token[0] == T_ECHO) {
178 $in_echo = true;
179 } elseif ($token[1] == ';' && $in_echo) {
e2bc1daa » jakubvrana
2009-08-26 No comments without whitespace
180 if ($tokens[$i+1][0] === T_WHITESPACE && $tokens[$i+2][0] === T_ECHO) {
ff85f125 » jakubvrana
2009-06-01 Join echos
181 next($tokens);
c030c163 » jakubvrana
2009-07-30 Compile inline HTML to echo
182 $i++;
183 }
184 if ($tokens[$i+1][0] === T_ECHO) {
185 // join two consecutive echos
ff85f125 » jakubvrana
2009-06-01 Join echos
186 next($tokens);
02046d69 » jakubvrana
2009-09-23 Windows support in e-mail attachments
187 $token[1] = ','; // '.' would conflict with "a".1+2 and would use more memory //! remove ',' and "," but not $var","
dbf95669 » jakubvrana
2009-08-26 Better consecutive echo handling
188 } else {
189 $in_echo = false;
ff85f125 » jakubvrana
2009-06-01 Join echos
190 }
16f42102 » jakubvrana
2009-04-15 Function minification
191 } elseif ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
192 $token[1] = '$' . $short_variables[$token[1]];
a06f4c15 » jakubvrana
2009-04-15 Size reduction by minification of variables
193 }
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
194 if (isset($set[substr($output, -1)]) || isset($set[$token[1][0]])) {
794192d9 » jakubvrana
2007-09-04 php_shrink()
195 $space = '';
196 }
197 $output .= $space . $token[1];
198 $space = '';
199 }
200 }
201 return $output;
202 }
203
9ee9cf08 » jakubvrana
2009-06-26 Remove code generation
204 function minify_css($file) {
1be289e8 »
2011-02-09 Optimize compiling files
205 return preg_replace('~\\s*([:;{},])\\s*~', '\\1', preg_replace('~/\\*.*\\*/~sU', '', $file));
9ee9cf08 » jakubvrana
2009-06-26 Remove code generation
206 }
207
208 function compile_file($match) {
df03f4f0 » jakubvrana
2009-07-13 Join editing.js in compilation
209 global $project;
210 return call_user_func($match[2], file_get_contents(dirname(__FILE__) . "/$project/$match[1]"));
9ee9cf08 » jakubvrana
2009-06-26 Remove code generation
211 }
212
e6726941 »
2010-05-07 Rename $driver to $jush
213 $driver = "";
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
214 if (file_exists(dirname(__FILE__) . "/adminer/drivers/" . $_SERVER["argv"][1] . ".inc.php")) {
e6726941 »
2010-05-07 Rename $driver to $jush
215 $driver = $_SERVER["argv"][1];
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
216 array_shift($_SERVER["argv"]);
217 }
218
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
219 unset($_COOKIE["adminer_lang"]);
220 $_SESSION["lang"] = $_SERVER["argv"][1]; // Adminer functions read language from session
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
221 include dirname(__FILE__) . "/adminer/include/lang.inc.php";
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
222 if (isset($_SESSION["lang"])) {
223 if (isset($_SERVER["argv"][2]) || !isset($langs[$_SESSION["lang"]])) {
7e97fcd0 » Jakub Vrana
2012-02-17 Compile usage
224 echo "Usage: php compile.php [driver] [lang]\nPurpose: Compile adminer[-driver][-lang].php and editor[-driver][-lang].php.\n";
7418af0c » jakubvrana
2007-07-05 Czech translation
225 exit(1);
226 }
0116b9d1 » jakubvrana
2009-09-10 Don't set cookie in compile scripts
227 include dirname(__FILE__) . "/adminer/lang/$_SESSION[lang].inc.php";
7418af0c » jakubvrana
2007-07-05 Czech translation
228 }
bba76d8d » jakubvrana
2007-08-04 Flatten $translations
229
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
230 // check function definition in drivers
231 $filename = dirname(__FILE__) . "/adminer/drivers/mysql.inc.php";
232 preg_match_all('~\\bfunction ([^(]+)~', file_get_contents($filename), $matches); //! respect context (extension, class)
233 $functions = array_combine($matches[1], $matches[0]);
234 unset($functions["__destruct"], $functions["Min_DB"], $functions["Min_Result"]);
e6726941 »
2010-05-07 Rename $driver to $jush
235 foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*") . ".inc.php") as $filename) {
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
236 if ($filename != "mysql.inc.php") {
237 $file = file_get_contents($filename);
238 foreach ($functions as $val) {
239 if (!strpos($file, "$val(")) {
240 echo "Missing $val in $filename\n";
241 }
242 }
243 }
244 }
245
e6726941 »
2010-05-07 Rename $driver to $jush
246 include dirname(__FILE__) . "/adminer/include/pdo.inc.php";
955e6b44 »
2011-06-04 PostgreSQL supports only functions
247 $features = array("call" => "routine", "dump", "event", "privileges", "procedure" => "routine", "processlist", "routine", "scheme", "sequence", "status", "trigger", "type", "user" => "privileges", "variables", "view");
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
248 foreach (array("adminer", "editor") as $project) {
249 $lang_ids = array(); // global variable simplifies usage in a callback function
250 $file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
e6726941 »
2010-05-07 Rename $driver to $jush
251 if ($driver) {
6420c584 » jakubvrana
2010-05-05 Schema support for PostgreSQL
252 $connection = (object) array("server_info" => 5.1); // MySQL support is version specific
e6726941 »
2010-05-07 Rename $driver to $jush
253 $_GET[$driver] = true; // to load the driver
254 include_once dirname(__FILE__) . "/adminer/drivers/$driver.inc.php";
955e6b44 »
2011-06-04 PostgreSQL supports only functions
255 foreach ($features as $key => $feature) {
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
256 if (!support($feature)) {
955e6b44 »
2011-06-04 PostgreSQL supports only functions
257 if (!is_int($key)) {
258 $feature = $key;
259 }
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
260 $file = str_replace("} elseif (isset(\$_GET[\"$feature\"])) {\n\tinclude \"./$feature.inc.php\";\n", "", $file);
261 }
262 }
263 if (!support("routine")) {
264 $file = str_replace("if (isset(\$_GET[\"callf\"])) {\n\t\$_GET[\"call\"] = \$_GET[\"callf\"];\n}\nif (isset(\$_GET[\"function\"])) {\n\t\$_GET[\"procedure\"] = \$_GET[\"function\"];\n}\n", "", $file);
265 }
266 }
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
267 $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
268 $file = str_replace('include "../adminer/include/coverage.inc.php";', '', $file);
e6726941 »
2010-05-07 Rename $driver to $jush
269 if ($driver) {
270 $file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . ').*\\s*)', '', $file);
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
271 }
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
272 $file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
e678e467 »
2010-05-21 Remove unsupported features in single driver version
273 if ($driver) {
274 foreach ($features as $feature) {
275 if (!support($feature)) {
276 $file = preg_replace("((\t*)" . preg_quote('if (support("' . $feature . '")') . ".*\n\\1\\})sU", '', $file);
277 }
278 }
4b9d451d »
2010-05-28 SQLite version supports two systems
279 if (count($drivers) == 1) {
30cfa613 »
2010-06-08 Fix MySQL only version
280 $file = str_replace('<?php echo html_select("driver", $drivers, DRIVER); ?>', "<input type='hidden' name='driver' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
4b9d451d »
2010-05-28 SQLite version supports two systems
281 }
e678e467 »
2010-05-21 Remove unsupported features in single driver version
282 }
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
283 $file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
284 $file = preg_replace_callback('~\\b(include|require) "([^"]*\\$LANG.inc.php)";~', 'put_file_lang', $file);
53804a2c »
2010-10-16 Immunity against CRLF
285 $file = str_replace("\r", "", $file);
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
286 if ($_SESSION["lang"]) {
287 // single language version
288 $file = preg_replace_callback("~(<\\?php\\s*echo )?lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])(;\\s*\\?>)?~s", 'remove_lang', $file);
289 $file = str_replace("<?php switch_lang(); ?>\n", "", $file);
290 $file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
291 }
292 $file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
293 $file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
1be289e8 »
2011-02-09 Optimize compiling files
294 $replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION;
4815c7d0 »
2012-04-15 Don't use AJAX links and forms
295 $file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
296 $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
e4deeb61 »
2011-02-15 Utilize location.protocol
297 $file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
298 $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
299 $file = php_shrink($file);
c02bd441 » jakubvrana
2009-07-20 Use $filename
300
e6726941 »
2010-05-07 Rename $driver to $jush
301 $filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($driver ? "-$driver" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php";
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
302 fwrite(fopen($filename, "w"), $file); // file_put_contents() since PHP 5
3f5b6834 » jakubvrana
2010-04-21 Reintegrate sqlite branch
303 echo "$filename created (" . strlen($file) . " B).\n";
12d2c6db » jakubvrana
2009-10-06 Build Adminer and Editor together
304 }
Something went wrong with that request. Please try again.