Skip to content

Commit

Permalink
Merge pull request #7 from Lawrence72/master
Browse files Browse the repository at this point in the history
add optional database mangement url
  • Loading branch information
n0nag0n authored Jun 30, 2022
2 parents ff4ef6e + fe437ff commit 3980d0b
Show file tree
Hide file tree
Showing 12 changed files with 545 additions and 473 deletions.
815 changes: 410 additions & 405 deletions public/adminer/adminer.php

Large diffs are not rendered by default.

155 changes: 109 additions & 46 deletions public/adminer/plugins/plugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/** Adminer customization allowing usage of plugins
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerPlugin extends Adminer {
/** @access protected */
Expand All @@ -20,7 +20,7 @@ function _findRootClass($class) { // is_subclass_of(string, string) is available
/** Register plugins
* @param array object instances or null to register all classes starting by 'Adminer'
*/
function AdminerPlugin($plugins) {
function __construct($plugins) {
if ($plugins === null) {
$plugins = array();
foreach (get_declared_classes() as $class) {
Expand Down Expand Up @@ -62,7 +62,10 @@ function _appendPlugin($function, $args) {
$return = $this->_callParent($function, $args);
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
$return += call_user_func_array(array($plugin, $function), $args);
$value = call_user_func_array(array($plugin, $function), $args);
if ($value) {
$return += $value;
}
}
}
return $return;
Expand All @@ -80,7 +83,12 @@ function dumpOutput() {
return $this->_appendPlugin(__FUNCTION__, $args);
}

function editFunctions() {
function editRowPrint($table, $fields, $row, $update) {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}

function editFunctions($field) {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
Expand All @@ -97,7 +105,22 @@ function credentials() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function permanentLogin() {
function connectSsl() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function permanentLogin($create = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function bruteForceKey() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function serverName($server) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
Expand All @@ -112,7 +135,7 @@ function schemas() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function databases() {
function databases($flush = true) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
Expand All @@ -127,107 +150,137 @@ function headers() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function csp() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function head() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function css() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function loginForm() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function login() {
function loginFormField($name, $heading, $value) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function tableName() {
function login($login, $password) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function fieldName() {
function tableName($tableStatus) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLinks() {
function fieldName($field, $order = 0) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function foreignKeys() {
function selectLinks($tableStatus, $set = "") {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function backwardKeys() {
function foreignKeys($table) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function backwardKeysPrint() {
function backwardKeys($table, $tableName) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectQuery() {
function backwardKeysPrint($backwardKeys, $row) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function rowDescription() {
function selectQuery($query, $start, $failed = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function rowDescriptions() {
function sqlCommandQuery($query) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLink() {
function rowDescription($table) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectVal() {
function rowDescriptions($rows, $foreignKeys) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function editVal() {
function selectLink($val, $field) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectColumnsPrint() {
function selectVal($val, $link, $field, $original) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectSearchPrint() {
function editVal($val, $field) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectOrderPrint() {
function tableStructurePrint($fields) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLimitPrint() {
function tableIndexesPrint($indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLengthPrint() {
function selectColumnsPrint($select, $columns) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectActionPrint() {
function selectSearchPrint($where, $columns, $indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectOrderPrint($order, $columns, $indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLimitPrint($limit) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectLengthPrint($text_length) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectActionPrint($indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
Expand All @@ -242,22 +295,22 @@ function selectImportPrint() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectEmailPrint() {
function selectEmailPrint($emailFields, $columns) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectColumnsProcess() {
function selectColumnsProcess($columns, $indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectSearchProcess() {
function selectSearchProcess($fields, $indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectOrderProcess() {
function selectOrderProcess($fields, $indexes) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
Expand All @@ -272,52 +325,62 @@ function selectLengthProcess() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectEmailProcess() {
function selectEmailProcess($where, $foreignKeys) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function messageQuery($query, $time, $failed = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function selectQueryBuild() {
function editInput($table, $field, $attrs, $value) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function messageQuery() {
function editHint($table, $field, $value) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function editInput() {
function processInput($field, $value, $function = "") {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function processInput() {
function dumpDatabase($db) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function dumpDatabase() {
function dumpTable($table, $style, $is_view = 0) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function dumpTable() {
function dumpData($table, $style, $query) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function dumpData() {
function dumpFilename($identifier) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function dumpFilename() {
function dumpHeaders($identifier, $multi_table = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function dumpHeaders() {
function importServerPath() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
Expand All @@ -327,19 +390,19 @@ function homepage() {
return $this->_applyPlugin(__FUNCTION__, $args);
}

function navigation() {
function navigation($missing) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function databasesPrint() {
function databasesPrint($missing) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

function tablesPrint() {
function tablesPrint($tables) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}

}
}
4 changes: 2 additions & 2 deletions ui/init_environment/basic_config.htm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ <h2>Variable Configuration</h2>
<option value="0" {{ @config.highlight === '0' ? 'selected' : '' }}>No - Do Not Use Syntax Highlighting</option>
</select>
</div>
<a href="/init-environment/directory-setup" type="submit" class="btn btn-primary mb-5">Back</a>
<button type="submit" class="btn btn-primary mb-5">Next</button>
<a href="/init-environment/directory-setup" class="btn btn-primary mb-5">&laquo; Back</a>
<button type="submit" class="btn btn-primary mb-5">Next &raquo;</button>
</form>
10 changes: 5 additions & 5 deletions ui/init_environment/choose_database.htm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h1>Choose Database</h1>
<p>If your project will need a database of some kind, you can specify that here, or just skip to go to the next step.</p>
<a href="/init-environment/jig" type="submit" class="btn btn-primary mb-5">Jig</a>
<a href="/init-environment/sqlite" type="submit" class="btn btn-primary mb-5">SQLite</a>
<a href="/init-environment/mysql" type="submit" class="btn btn-primary mb-5">MySQL/MariaDB</a>
<a href="/init-environment/jig" class="btn btn-primary mb-5">Jig</a>
<a href="/init-environment/sqlite" class="btn btn-primary mb-5">SQLite</a>
<a href="/init-environment/mysql" class="btn btn-primary mb-5">MySQL/MariaDB</a>
<br>
<a href="/init-environment/basic-config" type="submit" class="btn btn-primary mb-5">Back</a>
<a href="/init-environment/security" type="submit" class="btn btn-primary mb-5">Skip Databases</a>
<a href="/init-environment/basic-config" class="btn btn-primary mb-5">Back</a>
<a href="/init-environment/security" class="btn btn-primary mb-5">Skip Databases</a>
Loading

0 comments on commit 3980d0b

Please sign in to comment.