compile: replace submodules by composer repositories
This commit is contained in:
parent
a72ce720c7
commit
b0c0dd4900
7 changed files with 132 additions and 22 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
@ -1,9 +1,3 @@
|
|||
[submodule "jush"]
|
||||
path = externals/jush
|
||||
url = https://github.com/vrana/jush
|
||||
[submodule "JsShrink"]
|
||||
path = externals/JsShrink
|
||||
url = https://github.com/vrana/JsShrink
|
||||
[submodule "designs/hydra"]
|
||||
path = designs/hydra
|
||||
url = https://github.com/Niyko/Hydra-Dark-Theme-for-Adminer
|
||||
|
|
|
@ -6,13 +6,13 @@ if ($_GET["file"] == "favicon.ico") {
|
|||
echo lzw_decompress(compile_file('../adminer/static/favicon.ico', 'lzw_compress'));
|
||||
} elseif ($_GET["file"] == "default.css") {
|
||||
header("Content-Type: text/css; charset=utf-8");
|
||||
echo lzw_decompress(compile_file('../adminer/static/default.css;../externals/jush/jush.css', 'minify_css'));
|
||||
echo lzw_decompress(compile_file('../adminer/static/default.css;../vendor/vrana/jush/jush.css', 'minify_css'));
|
||||
} elseif ($_GET["file"] == "functions.js") {
|
||||
header("Content-Type: text/javascript; charset=utf-8");
|
||||
echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js', 'minify_js'));
|
||||
} elseif ($_GET["file"] == "jush.js") {
|
||||
header("Content-Type: text/javascript; charset=utf-8");
|
||||
echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;../externals/jush/modules/jush-textarea.js;../externals/jush/modules/jush-txt.js;../externals/jush/modules/jush-js.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js'));
|
||||
echo lzw_decompress(compile_file('../vendor/vrana/jush/modules/jush.js;../vendor/vrana/jush/modules/jush-textarea.js;../vendor/vrana/jush/modules/jush-txt.js;../vendor/vrana/jush/modules/jush-js.js;../vendor/vrana/jush/modules/jush-sql.js;../vendor/vrana/jush/modules/jush-pgsql.js;../vendor/vrana/jush/modules/jush-sqlite.js;../vendor/vrana/jush/modules/jush-mssql.js;../vendor/vrana/jush/modules/jush-oracle.js;../vendor/vrana/jush/modules/jush-simpledb.js', 'minify_js'));
|
||||
} else {
|
||||
header("Content-Type: image/gif");
|
||||
switch ($_GET["file"]) {
|
||||
|
|
14
compile.php
14
compile.php
|
@ -7,7 +7,7 @@ function adminer_errors($errNo, $errStr, $errFile, $errLine) {
|
|||
error_reporting(6135); // errors and warnings
|
||||
set_error_handler('adminer_errors', E_WARNING);
|
||||
include dirname(__FILE__) . "/adminer/include/version.inc.php";
|
||||
include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
|
||||
include dirname(__FILE__) . "/vendor/vrana/jsshrink/jsShrink.php";
|
||||
|
||||
function add_apo_slashes($s) {
|
||||
return addcslashes($s, "\\'");
|
||||
|
@ -443,7 +443,7 @@ if ($driver) {
|
|||
if (count($drivers) == 1) {
|
||||
$file = str_replace('<?php echo html_select("auth[driver]", $drivers, DRIVER) . "\n"; ?>', "<input type='hidden' name='auth[driver]' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
|
||||
}
|
||||
$file = preg_replace('(;../externals/jush/modules/jush-(?!textarea\.|txt\.|js\.|' . preg_quote($driver == "mysql" ? "sql" : $driver) . '\.)[^.]+.js)', '', $file);
|
||||
$file = preg_replace('(;../vendor/vrana/jush/modules/jush-(?!textarea\.|txt\.|js\.|' . preg_quote($driver == "mysql" ? "sql" : $driver) . '\.)[^.]+.js)', '', $file);
|
||||
$file = preg_replace_callback('~doc_link\(array\((.*)\)\)~sU', function ($match) use ($driver) {
|
||||
list(, $links) = $match;
|
||||
$links = preg_replace("~'(?!(" . ($driver == "mysql" ? "sql|mariadb" : $driver) . ")')[^']*' => [^,]*,?~", '', $links);
|
||||
|
@ -452,8 +452,8 @@ if ($driver) {
|
|||
//! strip doc_link() definition
|
||||
}
|
||||
if ($project == "editor") {
|
||||
$file = preg_replace('~;.\.\/externals/jush/jush\.css~', '', $file);
|
||||
$file = preg_replace('~compile_file\(\'\.\./(externals/jush/modules/jush\.js|adminer/static/[^.]+\.gif)[^)]+\)~', "''", $file);
|
||||
$file = preg_replace('~;.\.\/vendor/vrana/jush/jush\.css~', '', $file);
|
||||
$file = preg_replace('~compile_file\(\'\.\./(vendor/vrana/jush/modules/jush\.js|adminer/static/[^.]+\.gif)[^)]+\)~', "''", $file);
|
||||
}
|
||||
$file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
|
||||
$file = preg_replace_callback('~\b(include|require) "([^"]*\$LANG.inc.php)";~', 'put_file_lang', $file);
|
||||
|
@ -465,14 +465,14 @@ if (isset($_SESSION["lang"]) && $_SESSION["lang"]) {
|
|||
$file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
|
||||
}
|
||||
$file = str_replace('<?php echo script_src("static/editing.js"); ?>' . "\n", "", $file);
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file);
|
||||
$file = str_replace('<link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">' . "\n", "", $file);
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./vendor/vrana/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file);
|
||||
$file = str_replace('<link rel="stylesheet" type="text/css" href="../vendor/vrana/jush/jush.css">' . "\n", "", $file);
|
||||
$file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files
|
||||
$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\1&version=' . $VERSION . '"';
|
||||
$file = preg_replace('~\.\./adminer/static/(default\.css|favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~"\.\./adminer/static/(functions\.js)"~', $replace, $file);
|
||||
$file = preg_replace('~\.\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);
|
||||
$file = preg_replace('~"\.\./externals/jush/modules/(jush\.js)"~', $replace, $file);
|
||||
$file = preg_replace('~"\.\./vendor/vrana/jush/modules/(jush\.js)"~', $replace, $file);
|
||||
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
||||
$file = php_shrink($file);
|
||||
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
"name": "vrana/adminer",
|
||||
"name": "adminerevo/adminerevo",
|
||||
"description": "Database management in a single PHP file.",
|
||||
"homepage": "https://www.adminer.org/",
|
||||
"homepage": "https://www.adminerevo.org/",
|
||||
"keywords": [
|
||||
"database"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://sourceforge.net/p/adminer/bugs-and-features/",
|
||||
"forum": "https://sourceforge.net/p/adminer/discussion/",
|
||||
"source": "https://github.com/vrana/adminer/"
|
||||
"issues": "https://github.com/adminerevo/adminerevo/issues/",
|
||||
"source": "https://github.com/adminerevo/adminerevo/"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
|
@ -27,5 +26,19 @@
|
|||
],
|
||||
"scripts": {
|
||||
"compile": "php compile.php"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/vrana/jush.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/vrana/jsshrink.git"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"vrana/jush": "dev-master#ae33623c66189375a3654954cddc1c73f65c36fa",
|
||||
"vrana/jsshrink": "dev-master#96a466fa4cef74ba8362f4bc4b1bb17b2c9ecbcc"
|
||||
}
|
||||
}
|
||||
|
|
105
composer.lock
generated
Normal file
105
composer.lock
generated
Normal file
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "07c328449153caaf58dca2fa394054e3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "vrana/jsshrink",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vrana/JsShrink.git",
|
||||
"reference": "96a466fa4cef74ba8362f4bc4b1bb17b2c9ecbcc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vrana/JsShrink/zipball/96a466fa4cef74ba8362f4bc4b1bb17b2c9ecbcc",
|
||||
"reference": "96a466fa4cef74ba8362f4bc4b1bb17b2c9ecbcc",
|
||||
"shasum": ""
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"component": {
|
||||
"scripts": [
|
||||
"jsShrink.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"jsShrink.js"
|
||||
]
|
||||
},
|
||||
"license": [
|
||||
"Apache-2.0",
|
||||
"GPL-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jakub Vrána",
|
||||
"homepage": "http://www.vrana.cz"
|
||||
}
|
||||
],
|
||||
"description": "Remove spaces and comments from JavaScript code (available in PHP and JavaScript).",
|
||||
"homepage": "https://github.com/vrana/JsShrink",
|
||||
"support": {
|
||||
"source": "https://github.com/vrana/JsShrink/tree/master",
|
||||
"issues": "https://github.com/vrana/JsShrink/issues"
|
||||
},
|
||||
"time": "2014-10-25T23:40:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vrana/jush",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vrana/jush.git",
|
||||
"reference": "ae33623c66189375a3654954cddc1c73f65c36fa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vrana/jush/zipball/ae33623c66189375a3654954cddc1c73f65c36fa",
|
||||
"reference": "ae33623c66189375a3654954cddc1c73f65c36fa",
|
||||
"shasum": ""
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"license": [
|
||||
"Apache-2.0",
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jakub Vrána",
|
||||
"homepage": "https://www.vrana.cz/"
|
||||
}
|
||||
],
|
||||
"description": "JUSH - JavaScript Syntax Highlighter",
|
||||
"homepage": "http://jush.sourceforge.net/",
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"syntax highlighter"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/vrana/jush/"
|
||||
},
|
||||
"time": "2021-02-06T15:06:41+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {
|
||||
"vrana/jush": 20,
|
||||
"vrana/jsshrink": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
1
externals/JsShrink
vendored
1
externals/JsShrink
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit 17cbfacae67dede6d94d94ce92214c8ca31d858e
|
1
externals/jush
vendored
1
externals/jush
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit ae33623c66189375a3654954cddc1c73f65c36fa
|
Loading…
Add table
Reference in a new issue