Skip to content

Commit

Permalink
Merge pull request #31 from johanvanhelden/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
johanvanhelden authored May 14, 2019
2 parents f603e59 + 5b73ea8 commit e205487
Show file tree
Hide file tree
Showing 4,178 changed files with 2,146,772 additions and 217,531 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 1 addition & 4 deletions .phpmyadmin/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.{js,php,twig,phtml,json,css}]
indent_style = space
indent_size = 4

[{*.sql,package.json,.travis.yml}]
indent_style = space
[{*.{sql,scss,css,twig},package.json,.travis.yml}]
indent_size = 2
21 changes: 21 additions & 0 deletions .phpmyadmin/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-recommended-scss"
],
"rules": {
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"block-closing-brace-newline-after": ["always", {
"ignoreAtRules": ["if", "else"]
}],
"at-rule-empty-line-before": ["always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"],
"ignoreAtRules": ["else"]
}]
}
}
278 changes: 146 additions & 132 deletions .phpmyadmin/ChangeLog

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .phpmyadmin/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================

Version 4.8.4
Version 5.0.0-dev

A web interface for MySQL and MariaDB.

Expand Down
55 changes: 55 additions & 0 deletions .phpmyadmin/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
phpMyAdmin
==========

A web interface for MySQL and MariaDB.

https://www.phpmyadmin.net/

Code status
-----------

.. image:: https://travis-ci.org/phpmyadmin/phpmyadmin.svg?branch=master
:alt: Build status
:target: https://travis-ci.org/phpmyadmin/phpmyadmin

.. image:: https://hosted.weblate.org/widgets/phpmyadmin/-/svg-badge.svg
:alt: Translation status
:target: https://hosted.weblate.org/engage/phpmyadmin/?utm_source=widget

.. image:: https://codecov.io/gh/phpmyadmin/phpmyadmin/branch/master/graph/badge.svg
:target: https://codecov.io/gh/phpmyadmin/phpmyadmin

.. image:: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/badges/quality-score.png?s=93dfde29ffa5771d9c254b7ffb11c4e673315035
:target: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/

.. image:: https://bestpractices.coreinfrastructure.org/projects/213/badge
:alt: CII Best Practices
:target: https://bestpractices.coreinfrastructure.org/projects/213

.. image:: https://www.browserstack.com/automate/badge.svg?badge_key=V1ppZHdzTThicjY4Ujk5akxYT2xYUT09LS1PVncrNCtkUW9BZXE1Q2xCQkdTMFZRPT0=--91913a0e155fda6f7c942e9dd2da64b3da571c30
:alt: BrowserStack
:target: https://www.browserstack.com/automate/public-build/V1ppZHdzTThicjY4Ujk5akxYT2xYUT09LS1PVncrNCtkUW9BZXE1Q2xCQkdTMFZRPT0=--91913a0e155fda6f7c942e9dd2da64b3da571c30


Download
--------

You can get the newest release at https://www.phpmyadmin.net/.

If you prefer to follow the git repository, the following branch and tag names may be of interest:

* ``STABLE`` is the current stable release.
* ``master`` is the development branch.
* Releases are tagged, for example version 4.0.1 was tagged as ``RELEASE_4_0_1``.

Note that phpMyAdmin uses Composer to manage library dependencies, when using git
development versions you must manually run Composer.
Please see `the documentation <https://docs.phpmyadmin.net/en/latest/setup.html#installing-from-git>`_ for details.

More Information
----------------

Please see the documentation in the doc folder or at https://docs.phpmyadmin.net/.

For support or to learn how to contribute code or by translating to your language,
visit https://www.phpmyadmin.net/
1 change: 0 additions & 1 deletion .phpmyadmin/RELEASE-DATE-4.8.4

This file was deleted.

59 changes: 45 additions & 14 deletions .phpmyadmin/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,74 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);

use PhpMyAdmin\Controllers\AjaxController;
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Di\Container;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
use PhpMyAdmin\Core;

if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

$_GET['ajax_request'] = 'true';

require_once 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/common.inc.php';

$container = Container::getDefaultContainer();
$container->set(Response::class, Response::getInstance());

/** @var Response $response */
$response = $container->get(Response::class);

/** @var DatabaseInterface $dbi */
$dbi = $container->get(DatabaseInterface::class);

$response->setAjax(true);

$response = Response::getInstance();
$response->setAJAX(true);
$controller = new AjaxController(
$response,
$dbi,
$GLOBALS['PMA_Config']
);

if (empty($_POST['type'])) {
Core::fatalError(__('Bad type!'));
}

switch ($_POST['type']) {
case 'list-databases':
$response->addJSON('databases', $GLOBALS['dblist']->databases);
$response->addJSON($controller->databases());
break;
case 'list-tables':
Util::checkParameters(array('db'), true);
$response->addJSON('tables', $GLOBALS['dbi']->getTables($_POST['db']));
Util::checkParameters(['db'], true);
$response->addJSON($controller->tables([
'db' => $_POST['db'],
]));
break;
case 'list-columns':
Util::checkParameters(array('db', 'table'), true);
$response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_POST['db'], $_POST['table']));
Util::checkParameters(['db', 'table'], true);
$response->addJSON($controller->columns([
'db' => $_POST['db'],
'table' => $_POST['table'],
]));
break;
case 'config-get':
Util::checkParameters(array('key'), true);
$response->addJSON('value', $GLOBALS['PMA_Config']->get($_POST['key']));
Util::checkParameters(['key'], true);
$response->addJSON($controller->getConfig([
'key' => $_POST['key'],
]));
break;
case 'config-set':
Util::checkParameters(array('key', 'value'), true);
$result = $GLOBALS['PMA_Config']->setUserValue(null, $_POST['key'], json_decode($_POST['value']));
Util::checkParameters(['key', 'value'], true);
$result = $controller->setConfig([
'key' => $_POST['key'],
'value' => $_POST['value'],
]);
if ($result !== true) {
$response = Response::getInstance();
$response->setRequestStatus(false);
$response->addJSON('message', $result);
}
Expand Down
91 changes: 39 additions & 52 deletions .phpmyadmin/browse_foreigners.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,57 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);

use PhpMyAdmin\BrowseForeigners;
use PhpMyAdmin\Controllers\BrowseForeignersController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Di\Container;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;

require_once 'libraries/common.inc.php';

/**
* Sets globals from $_POST
*/
$request_params = array(
'data',
'field'
);

foreach ($request_params as $one_request_param) {
if (isset($_POST[$one_request_param])) {
$GLOBALS[$one_request_param] = $_POST[$one_request_param];
}
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

Util::checkParameters(array('db', 'table', 'field'));
require_once ROOT_PATH . 'libraries/common.inc.php';

$response = Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenuAndConsole();
$header->setBodyId('body_browse_foreigners');
Util::checkParameters(['db', 'table', 'field'], true);

$relation = new Relation();
$container = Container::getDefaultContainer();
$container->set(Response::class, Response::getInstance());

/**
* Displays the frame
*/
$foreigners = $relation->getForeigners($db, $table);
$browseForeigners = new BrowseForeigners(
$GLOBALS['cfg']['LimitChars'],
$GLOBALS['cfg']['MaxRows'],
$GLOBALS['cfg']['RepeatCells'],
$GLOBALS['cfg']['ShowAll'],
$GLOBALS['pmaThemeImage']
);
$foreign_limit = $browseForeigners->getForeignLimit(
isset($_POST['foreign_showAll']) ? $_POST['foreign_showAll'] : null
);
/** @var Response $response */
$response = $container->get(Response::class);

$foreignData = $relation->getForeignData(
$foreigners, $_POST['field'], true,
isset($_POST['foreign_filter'])
? $_POST['foreign_filter']
: '',
isset($foreign_limit) ? $foreign_limit : null,
true // for getting value in $foreignData['the_total']
);
/** @var DatabaseInterface $dbi */
$dbi = $container->get(DatabaseInterface::class);

// HTML output
$html = $browseForeigners->getHtmlForRelationalFieldSelection(
$db,
$table,
$_POST['field'],
$foreignData,
isset($fieldkey) ? $fieldkey : null,
isset($data) ? $data : null
$controller = new BrowseForeignersController(
$response,
$dbi,
new BrowseForeigners(
$GLOBALS['cfg']['LimitChars'],
$GLOBALS['cfg']['MaxRows'],
$GLOBALS['cfg']['RepeatCells'],
$GLOBALS['cfg']['ShowAll'],
$GLOBALS['pmaThemeImage']
),
new Relation($dbi)
);

$response->addHtml($html);
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->disableMenuAndConsole();
$header->setBodyId('body_browse_foreigners');

$response->addHTML($controller->index([
'db' => $_POST['db'] ?? null,
'table' => $_POST['table'] ?? null,
'field' => $_POST['field'] ?? null,
'fieldkey' => $_POST['fieldkey'] ?? null,
'data' => $_POST['data'] ?? null,
'foreign_showAll' => $_POST['foreign_showAll'] ?? null,
'foreign_filter' => $_POST['foreign_filter'] ?? null,
]));
42 changes: 18 additions & 24 deletions .phpmyadmin/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
*
* @package PhpMyAdmin
*/
declare(strict_types=1);

use PhpMyAdmin\Template;
use PhpMyAdmin\Response;

if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}

/**
* Gets core libraries and defines some variables
*/
require 'libraries/common.inc.php';
require ROOT_PATH . 'libraries/common.inc.php';

$template = new Template();

$response = Response::getInstance();
$response->disable();
Expand All @@ -23,7 +32,6 @@
*/
// Check if the file is available, some distributions remove these.
if (@is_readable($filename)) {

// Test if the if is in a compressed format
if (substr($filename, -3) == '.gz') {
ob_start();
Expand Down Expand Up @@ -53,7 +61,7 @@
$github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
$faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';

$replaces = array(
$replaces = [
'@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
=> '<a href="url.php?url=\\1">\\1</a>',

Expand All @@ -79,11 +87,11 @@

// Highlight releases (with links)
'/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
=> '<a name="\\1_\\2_\\3"></a>'
=> '<a id="\\1_\\2_\\3"></a>'
. '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3">'
. '\\1.\\2.\\3.0 \\4</a>',
'/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
=> '<a name="\\1_\\2_\\3_\\4"></a>'
=> '<a id="\\1_\\2_\\3_\\4"></a>'
. '<a href="url.php?url=' . $github_url . 'commits/RELEASE_\\1_\\2_\\3_\\4">'
. '\\1.\\2.\\3.\\4 \\5</a>',

Expand All @@ -94,24 +102,10 @@
// Links target and rel
'/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="'

);
];

header('Content-type: text/html; charset=utf-8');
?>
<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>phpMyAdmin - ChangeLog</title>
<meta charset="utf-8" />
</head>
<body>
<h1>phpMyAdmin - ChangeLog</h1>
<?php
echo '<pre>';
echo preg_replace(array_keys($replaces), $replaces, $changelog);
echo '</pre>';
?>
</body>
</html>

echo $template->render('changelog', [
'changelog' => preg_replace(array_keys($replaces), $replaces, $changelog),
]);
Loading

0 comments on commit e205487

Please sign in to comment.