Compare commits

..

No commits in common. "master" and "QA_5_0" have entirely different histories.

4691 changed files with 2230118 additions and 2338716 deletions

View File

@ -1,11 +0,0 @@
# https://github.com/browserslist/browserslist#readme
>= 0.5%
last 2 major versions
not dead
Chrome >= 60
Firefox >= 60
Firefox ESR
iOS >= 12
Safari >= 12
not Explorer <= 11

View File

@ -10,15 +10,5 @@ charset = utf-8
indent_style = space
indent_size = 4
[{*.{sql,scss,css,twig,yml},package.json}]
[{*.{sql,scss,css,twig},package.json,.travis.yml}]
indent_size = 2
[*.svg]
insert_final_newline = false
[tests/test_data/*]
insert_final_newline = false
[tests/unit/**/Fixtures/*.html]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@ -1,4 +1,3 @@
public/js/
js/vendor/
tmp/
vendor/
webpack.config.cjs

View File

@ -1,28 +1,29 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:no-jquery/deprecated",
"plugin:compat/recommended"
"plugin:no-jquery/deprecated"
],
"parser": "@typescript-eslint/parser",
"plugins": [ "@typescript-eslint", "no-jquery" ],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["no-jquery"],
"env": {
"browser": true,
"es6": true
"jquery": true
},
"globals": {
"AJAX": "readonly",
"CodeMirror": "readonly",
"CommonActions": "readonly",
"CommonParams": "readonly",
"Cookies": "readonly",
"Functions": "readonly",
"Messages": "readonly",
"Navigation": "readonly",
"OpenLayers": "readonly",
"Sql": "readonly"
},
"rules": {
"array-bracket-spacing": "error",
"array-bracket-newline": ["error", { "multiline": true }],
"array-element-newline": ["error", "consistent"],
"brace-style": "error",
"camelcase": "error",
"comma-dangle": ["error", "only-multiline"],
"comma-style": ["error", "last"],
"curly": "error",
"dot-notation": "error",
@ -30,10 +31,12 @@
"eqeqeq": "error",
"indent": ["error", 4],
"keyword-spacing": "error",
"lines-between-class-members": "error",
"new-cap": "error",
"no-array-constructor": "error",
"no-eval": "error",
"no-jquery/no-event-shorthand": "off",
"no-jquery/no-is-array": "off",
"no-jquery/no-sizzle": "off",
"no-loop-func": "error",
"no-multiple-empty-lines": "error",
"no-new-func": "error",
@ -44,19 +47,9 @@
"no-trailing-spaces": "error",
"no-underscore-dangle": "error",
"no-unneeded-ternary": "error",
"no-var": "off",
"object-curly-spacing": ["error", "always"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "block-like", "next": "*" },
{ "blankLine": "always", "prev": "multiline-expression", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": "return" }
],
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"quotes": ["error", "single"],
"semi": "error",
"space-before-blocks": "error",
@ -64,11 +57,6 @@
"space-in-parens": "error",
"space-infix-ops": "error",
"spaced-comment": ["error", "always"],
"wrap-iife": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-this-alias": "off"
"wrap-iife": "error"
}
}

29
.gitattributes vendored
View File

@ -1,9 +1,7 @@
*.php text diff=php
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
.phpstorm.meta.php export-ignore
.travis.yml export-ignore
.scrutinizer.yml export-ignore
.jshintrc export-ignore
.stylelintrc.json export-ignore
@ -11,24 +9,17 @@
.eslintignore export-ignore
.weblate export-ignore
codecov.yml export-ignore
infection.json5.dist export-ignore
build.xml export-ignore
phpcs.xml.dist export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
psalm.xml export-ignore
psalm-baseline.xml export-ignore
DCO export-ignore
.editorconfig export-ignore
# Exclude only the following files and not all files in tests/
# Exclude only the following files and not all files in test/
# This is because some packaging teams need our test files but not the CI related files
tests/doctum-config.php export-ignore
tests/bootstrap-static.php export-ignore
tests/config.e2e.inc.php export-ignore
tests/phpstan-constants.php export-ignore
tests/*-local-server export-ignore
tests/*.conf export-ignore
tests/*.ini export-ignore
tests/ci-phplint export-ignore
.browserslistrc export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
test/doctum-config.php export-ignore
test/bootstrap-phpstan.php export-ignore
test/install-browserstack export-ignore
test/start-local-server export-ignore
test/*.conf export-ignore
test/*.ini export-ignore
test/ci-* export-ignore

View File

@ -1,25 +0,0 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_create_environment:
- python -m pip install sphinx-rtd-theme
# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub
- htmlzip

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
---
### Describe the bug
A clear and concise description of what the bug is.
### To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
### Expected behavior
A clear and concise description of what you expected to happen.
### Screenshots
If applicable, add screenshots to help explain your problem.
### Server configuration
- Operating system:
- Web server:
- Database version:
- PHP version:
- phpMyAdmin version:
### Client configuration
- Browser:
- Operating system:
### Additional context
Add any other context about the problem here.

View File

@ -1,89 +0,0 @@
name: Bug report
description: Create a report to help us improve phpMyAdmin
title: "[Bug]: "
labels: ["Bug"]
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: When ...
validations:
required: true
- type: textarea
id: how-to-reproduce
attributes:
label: How to Reproduce
description: Give us the steps to reproduce the bug on our side.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- type: textarea
id: expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: I expected ...
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain the bug.
- type: dropdown
id: operating-systems
attributes:
label: Operating System
description: In which operating system this bug appears?
multiple: true
options:
- Linux
- macOS
- Windows
- type: input
id: web-server
attributes:
label: Web Server
placeholder: Apache/2.4.63
- type: dropdown
id: database-server
attributes:
label: Database Server
description: In which database server this bug appears?
multiple: true
options:
- MySQL
- MariaDB
- PerconaDB
- AuroraDB (by AWS)
- Other
- type: input
id: database-version
attributes:
label: Database version
placeholder: SELECT @@version;
- type: input
id: php-version
attributes:
label: PHP version
placeholder: 8.3.1
- type: input
id: phpmyadmin-version
attributes:
label: phpMyAdmin version
placeholder: 5.2.1
validations:
required: true
- type: input
id: browser
attributes:
label: browser
placeholder: Firefox v136.0.2
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the bug here.

View File

@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for phpMyAdmin
---
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
### Describe the solution you'd like
A clear and concise description of what you want to happen.
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
### Additional context
- phpMyAdmin version:
Add any other context or screenshots about the feature request here.

View File

@ -1,45 +0,0 @@
name: Feature request
description: Suggest an idea for phpMyAdmin
title: "[Feat]: "
labels: ["Enhancement"]
body:
- type: input
id: phpmyadmin-version
attributes:
label: phpMyAdmin version
placeholder: 5.2.1
validations:
required: true
- type: textarea
id: feat-description
attributes:
label: Describe the feature
description: Is your feature request related to a problem? Please describe.
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: solution-description
attributes:
label: Describe the solution
description: Describe the solution you'd like
placeholder: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives-description
attributes:
label: Describe the alternatives
description: Describe alternatives you've considered
placeholder: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add additional context here
placeholder: Add any other context or screenshots about the feature request here.
validations:
required: false

View File

@ -0,0 +1,11 @@
---
name: Security report
about: Disclose a security vulnerability responsibly by first reporting it to us privately
---
Security problems should not be reported here.
See our security page: https://www.phpmyadmin.net/security/
Thanks for your help!

View File

@ -1,18 +0,0 @@
name: Security report
description: Disclose a security vulnerability responsibly by first reporting it to us privately
title: "[Security]: "
labels: ["Bug"]
body:
- type: textarea
id: description
attributes:
label: DON'T REPORT IN HERE
placeholder: |
Security problems should not be reported here.
See our security page: https://www.phpmyadmin.net/security/
Thanks for your help!
validations:
required: true

23
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,23 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
# Label to use when marking as stale
staleLabel: wontfix
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: pulls

View File

@ -1,85 +0,0 @@
name: Daily snapshots
on:
pull_request:
paths:
- '.github/workflows/daily-snapshots.yml'
- 'bin/**'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
generate-snapshots:
name: Generate ${{ matrix.version }} snapshots
runs-on: ubuntu-latest
if: (github.event_name == 'schedule' && github.repository == 'phpmyadmin/phpmyadmin') || (github.event_name != 'schedule')
strategy:
fail-fast: false
matrix:
include:
- { version: '5.2', branch: 'QA_5_2', php-version: '7.2', node-version: '12', python-version: '3.11' }
- { version: '6.0', branch: 'master', php-version: '8.2', node-version: '20', python-version: '3.11' }
steps:
- name: Check out code
uses: actions/checkout@v6
with:
ref: ${{ matrix.branch }}
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd
coverage: none
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Install Yarn modules
run: yarn install --non-interactive
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'
- name: Build the release
if: matrix.branch == 'master'
run: ./bin/internal/create-release.sh --daily ${{ matrix.version }}+snapshot ${{ matrix.branch }}
- name: Build the release
if: matrix.branch != 'master'
run: ./scripts/create-release.sh --daily ${{ matrix.version }}+snapshot ${{ matrix.branch }}
- name: Check release excludes
if: matrix.branch == 'master'
run: ./bin/internal/check-release-excludes.sh release/phpMyAdmin-${{ matrix.version }}+snapshot-all-languages.tar.gz
continue-on-error: true
- name: Check release excludes
if: matrix.branch != 'master'
run: ./scripts/check-release-excludes.sh release/phpMyAdmin-${{ matrix.version }}+snapshot-all-languages.tar.gz
continue-on-error: true
- name: Upload snapshots
uses: actions/upload-artifact@v6
with:
name: phpMyAdmin-${{ matrix.version }}-snapshots
path: release/*
retention-days: 1

View File

@ -1,76 +0,0 @@
name: Frontend analysis and tests
on:
push:
pull_request:
paths:
- 'resources/js/**'
- '**.s?css'
- 'tests/javascript/**'
- '.browserslistrc'
- '.eslint*'
- '*.cjs'
- 'package.json'
- 'tsconfig.json'
- 'yarn.lock'
permissions:
contents: read
jobs:
javascript-test:
name: Test JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Run tests
run: yarn test
javascript-lint:
name: Lint JavaScript files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint JavaScript files
run: yarn run js-lint --quiet
css-lint:
name: Lint CSS files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive
- name: Lint CSS files
run: yarn run css-lint

View File

@ -1,87 +0,0 @@
name: Lint and analyse php files
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
lint-php-files:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install Composer dependencies
# Allow the previous check to fail but not abort
if: always()
uses: ramsey/composer-install@v3
with:
# Ignore zip for php-webdriver/webdriver
composer-options: "--ignore-platform-req=ext-zip"
- name: Cache coding-standard
# Allow the previous check to fail but not abort
if: always()
uses: actions/cache@v5
with:
path: .phpcs-cache
key: phpcs-cache
- name: Lint PHP files
# Allow the previous check to fail but not abort
if: always()
run: ./tests/ci-phplint
- name: Check coding-standard
# Allow the previous check to fail but not abort
if: always()
run: composer phpcs
- name: Check Twig templates
# Allow the previous check to fail but not abort
if: always()
run: composer run twig-lint
analyse-php:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Analyse files with PHPStan
run: composer phpstan -- --memory-limit 2G
- name: Analyse files with Psalm
# Allow the previous check to fail but not abort
if: always()
run: composer psalm -- --shepherd

View File

@ -1,26 +0,0 @@
name: Lint php documentation
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
lint-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Lint phpdoc blocks
uses: sudo-bot/action-doctum@v5
with:
config-file: tests/doctum-config.php
method: "parse"
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"

View File

@ -1,20 +0,0 @@
name: 'Lock threads'
on:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
lock:
permissions:
issues: write # for dessant/lock-threads to lock issues
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues'
issue-inactive-days: 365

View File

@ -1,76 +0,0 @@
# https://docs.github.com/en/actions
name: Mutation tests
on:
push:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
pull_request:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
infection:
name: Infection
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version:
- "8.2"
operating-system:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Checkout base ref code
if: github.event_name == 'pull_request'
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2, infection:0.27.11
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run Infection for changed files only
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_REF_NAME^"; else \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_BASE_REF"; fi
infection --threads=max --git-diff-lines --git-diff-base="$INFECTION_GIT_DIFF_BASE" \
--logger-github --ignore-msi-with-no-mutations --only-covered --no-interaction --no-progress
- name: Run Infection for all files
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
run: infection --threads=max --no-interaction --log-verbosity=none --logger-github=false

View File

@ -1,66 +0,0 @@
name: Check other tools and scripts
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Sphinx for the documentation build
run: |
sudo apt-get update
sudo apt-get install -y sphinx-doc python3-sphinx
- name: Build the documentation
run: make -C docs html SPHINXOPTS='-n -W -a'
build-release:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, iconv, mysqli, zip, gd
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'yarn'
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'
- name: Build the release
run: ./bin/internal/create-release.sh --ci

View File

@ -1,27 +0,0 @@
name: ShellCheck
on:
push:
paths:
- 'bin/**'
pull_request:
paths:
- 'bin/**'
permissions:
contents: read
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Run ShellCheck
uses: reviewdog/action-shellcheck@v1
with:
path: bin
check_all_files_with_shebangs: true
fail_on_error: true

View File

@ -1,24 +0,0 @@
name: "Manage stale PRs/issues"
permissions:
issues: write
on:
schedule:
- cron: "30 1 * * *"
jobs:
run-stale-check:
name: Check for stale PRs/issues
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v9
with:
days-before-stale: 15
days-before-close: -1
only-issue-labels: "Awaiting Author Updates"
close-issue-message: >
The phpMyAdmin team is awaiting an update on this issue.
Please check that all the questions have been answered.

View File

@ -1,152 +0,0 @@
name: "End-to-End tests"
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
env:
php-version: "8.2"
node-version: "20"
jobs:
generate-matrix:
name: Generate the matrix of Selenium tests
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.tests-list.outputs.tests }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- id: tests-list
name: Send test names to outputs
run: |
set -euo pipefail
TEST_NAMES="[$(find $PWD/tests/end-to-end/ -type f -name '*Test.php' -print |sed -E "s,$PWD/tests/end-to-end/(.*)Test.php,{\"test-name\": \"\1\"}," | paste -sd ",")]"
echo "tests=$(printf "$TEST_NAMES")" >> $GITHUB_OUTPUT
selenium:
name: "Selenium"
if: "!contains(github.event.head_commit.message, '[ci selenium skip]')"
needs: generate-matrix
runs-on: "ubuntu-latest"
services:
database-server:
image: "mysql:5.7"
env:
MYSQL_ROOT_PASSWORD: testbench
ports:
- "3306:3306"
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
selenium-server:
image: selenium/standalone-chrome:4
volumes:
- /dev/shm:/dev/shm
options: >-
--health-cmd "/opt/bin/check-grid.sh"
env:
SCREEN_WIDTH: 1920
SCREEN_HEIGHT: 1080
ports:
- "4444:4444"
docker-host-bridge:
# Allow accessing localhost ports from docker containers.
# See https://github.com/qoomon/docker-host
image: qoomon/docker-host
options: >-
--name docker-host-bridge
--hostname docker-host-bridge
--add-host docker-host-bridge:127.0.0.1
--cap-add=NET_ADMIN
--cap-add=NET_RAW
--restart on-failure
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.tests) }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install gettext
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ env.php-version }}
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: ${{ env.php-version }}
extensions: :opcache, mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '${{ env.node-version }}'
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive --production
- name: Copy the config
run: cp tests/config.e2e.inc.php config.inc.php
- name: Start server
env:
CI_MODE: selenium
FPM_PATH: php-fpm${{ env.php-version }}
SKIP_STANDALONE: 1
run: |
sudo chown -R runner:docker /var/lib/nginx/
sudo chown -R runner:docker /var/log/nginx/
./tests/start-local-server
echo "SELENIUM_TEMPDIR=$(cat /tmp/last_temp_dir_phpMyAdminTests)" >> $GITHUB_OUTPUT
id: start-local-server
- name: Run Selenium tests
env:
CI_MODE: selenium
TESTSUITE_SELENIUM_BROWSER: chrome
TESTSUITE_USER: root
TESTSUITE_PASSWORD: testbench
# Port defined in tests/nginx.conf
TESTSUITE_URL: http://docker-host-bridge:8000
TESTSUITE_DATABASE_PREFIX: "selenium"
TESTSUITE_SELENIUM_HOST: "127.0.0.1"
TESTSUITE_SELENIUM_PORT: "4444"
run: ./vendor/bin/phpunit --testsuite end-to-end --no-logging --no-coverage --stop-on-skipped --testdox tests/end-to-end/${{ matrix.test-name }}Test.php
- name: Output logs and stop server
env:
CI_MODE: selenium
SELENIUM_TEMPDIR: ${{ steps.start-local-server.outputs.SELENIUM_TEMPDIR }}
if: ${{ success() || failure() }}
run: |
if [ -f "${SELENIUM_TEMPDIR}/php.log" ] ; then cat "${SELENIUM_TEMPDIR}/php.log" ; fi
if [ -f "${SELENIUM_TEMPDIR}/nginx-error.log" ] ; then cat "${SELENIUM_TEMPDIR}/nginx-error.log" ; fi
./tests/stop-local-server
- name: Upload screenshots
uses: actions/upload-artifact@v6
if: ${{ failure() }}
with:
name: selenium-screenshots-${{ strategy.job-index }}
path: ${{ github.workspace }}/build/selenium/**/*
retention-days: 3

View File

@ -1,188 +0,0 @@
name: Run tests
on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- QA_**
permissions:
contents: read
jobs:
multi-arch-tests-php:
name: Test on PHP ${{ matrix.php-version }} (${{ matrix.arch }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- { php-version: '82', experimental: false, arch: 'amd64', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 'arm64/v8', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 'arm/v7', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
- { php-version: '82', experimental: false, arch: 'i386', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
- { php-version: '82', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: '--exclude-group extension-iconv' }
- { php-version: '82', experimental: false, arch: 's390x', exclude-phpunit-groups: '--exclude-group extension-iconv --exclude-group 32bit-incompatible' }
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Write script
# tcpdf allowed memory exhausted needs the memory_limit workaround
# musl-locales and musl-locales-lang are needed to run some locale specific tests
# gettext is needed to run generate-mo
# git is needed to work around a version detection issue with composer, see: https://github.com/Roave/SecurityAdvisories/issues/76
# ctype for psalm
run: |
printf "set -exu && \
export V='%s' && \
apk add --update --no-cache \
php\$V-cli php\$V-mysqli php\$V-session php\$V-mbstring php\$V-ctype php\$V-sodium \
php\$V-iconv php\$V-xml php\$V-tokenizer php\$V-xmlwriter php\$V-simplexml \
php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip php\$V-bcmath \
musl-locales musl-locales-lang \
gettext composer git && \
composer config version "$(php -r "define('VERSION_SUFFIX', ''); require_once('src/Version.php'); echo \PhpMyAdmin\Version::VERSION;")" && \
composer install && \
./bin/generate-mo && \
php\$V -d memory_limit=512M ./vendor/bin/phpunit --no-logging --no-coverage --testsuite unit %s" \
"${{ matrix.php-version }}" "${{ matrix.exclude-phpunit-groups }}" > ./do-tests.sh
- name: Set up multi arch support
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Print arch
run: docker run --rm --platform linux/${{ matrix.arch }} alpine:3.19 uname -a
- name: Run tests on php ${{ matrix.php-version }}
run: docker run -v $PWD:/app --workdir /app --rm --platform linux/${{ matrix.arch }} alpine:3.19 sh /app/do-tests.sh
test-php:
name: Test on PHP ${{ matrix.php-version }}, ${{ matrix.composer-dependency }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.php-version == '8.5' }}
strategy:
matrix:
php-version: ['8.2', '8.3', '8.4']
os: [ubuntu-latest]
composer-dependency: [locked, highest]
php-extensions: ['mbstring, iconv, mysqli, zip, gd, bz2']
include:
- php-version: '8.5'
os: ubuntu-latest
composer-dependency: locked
composer-options: '--ignore-platform-req=php+'
php-extensions: 'mbstring, iconv, mysqli, zip, bz2'
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.composer-dependency }}
composer-options: ${{ matrix.composer-options }}
- name: Run PHP tests
run: composer run phpunit -- --testsuite unit --display-deprecations --display-notices --display-warnings --display-errors
- name: Send coverage
uses: codecov/codecov-action@v3
with:
flags: unit-${{ matrix.php-version }}-${{ matrix.os }}
name: phpunit-${{ matrix.php-version }}-${{ matrix.os }}
- name: Send coverage to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
continue-on-error: true
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
- name: Send coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
# Upload can fail on forks or if the secret is missing
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml
test-php-optional-extensions:
name: Test on PHP (+ ext-${{ matrix.extension }}) ${{ matrix.php-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
php-version: ["8.2"]
os: [ubuntu-latest]
extension: ["dbase"]
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.extension }}, mbstring, iconv, mysqli, zip, gd
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run PHP tests
run: composer run phpunit -- --testsuite unit
- name: Send coverage
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.extension }}-extension
name: php-${{ matrix.php-version }}-${{ matrix.extension }}-enabled
- name: Send coverage to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
continue-on-error: true
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
- name: Send coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
# Do not run this step on forked versions of the main repository (example: contributor forks)
if: github.repository == 'phpmyadmin/phpmyadmin'
# Upload can fail on forks or if the secret is missing
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: build/logs/clover.xml

View File

@ -1,50 +0,0 @@
name: Update translation files
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
update-po:
permissions:
contents: write # for Git to git push
name: Update po files
runs-on: ubuntu-latest
# Source: https://github.community/t/do-not-run-cron-workflows-in-forks/17636/2?u=williamdes
if: (github.event_name == 'schedule' && github.repository == 'phpmyadmin/phpmyadmin') || (github.event_name != 'schedule')
strategy:
matrix:
php-version: ["8.2"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Gettext
run: |
sudo apt-get install -y gettext
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Set up git config
run: |
git config user.name "phpMyAdmin bot"
git config user.email bot@phpmyadmin.net
- name: Update PO files
run: |
./bin/update-po
- name: Push changes
run: |
git push

63
.gitignore vendored
View File

@ -1,22 +1,17 @@
# Directory for creating releases
/release/
# Configuration files
/config.inc.php
/config.header.inc.php
/config.footer.inc.php
# Upload/save dirs
/upload/
/save/
/tmp/
# For setup script
/config/
# ctags
tags
# Editor files
phpmyadmin.wpj
.projectOptions
@ -29,86 +24,40 @@ phpmyadmin.wpj
.netbeans
.vscode
*.sw[op]
# Web server files
web.config
.htaccess
# Locales
/locale/
/resources/locale/
# Temporary files to generate locales for Twig
/twig-templates/
# Backups
*~
# API documentation
/apidoc/
/docs/_build
/docs/doctrees
/docs/html
/docs/linkcheck/
/docs/locale
/docs/**/*.pyc
/doc/linkcheck/
# Demo server
revision-info.php
# PHP_CodeSniffer
phpcs.xml
.phpcs-cache
# PHPUnit
.phpunit.result.cache
phpunit.xml
/tests/bootstrap.php
/tests/gis/*-actual.json
/tests/gis/*-actual.pdf
/tests/gis/*-actual.png
/tests/gis/*-actual.svg
/test/bootstrap.php
.phpunit.result.cache
# Jenkins
/build/
# Netbeans ide stuff
/nbproject/
# Eclipse ide stuff
/.pydevproject
# Ant cache
cache.properties
# Composer
composer.lock
/vendor/
# NPM
/node_modules/
phpstan.neon
# Infection
infection.json5
/js/
/setup/
/themes/
# App
/app/cache/*
!/app/cache/.gitkeep
/app/language_stats_inc.php
# public
/public/js/*
!/public/js/.gitkeep
/public/setup/*.css
/public/setup/*.css.map
/public/themes/*
!/public/themes/dot.gif
!/public/themes/bootstrap/
!/public/themes/metro/
!/public/themes/original/
!/public/themes/pmahomme/
/public/themes/*/css/*.css
/public/themes/*/css/*.css.map
libraries/cache/
js/dist/

View File

@ -1,6 +1,4 @@
{
"esversion" : 6,
// Show more errors
"maxerr" : 1000,

View File

@ -1,5 +0,0 @@
<?php
namespace PHPSTORM_META {
override(\Psr\Container\ContainerInterface::get(0), map(['@']));
}

View File

@ -5,30 +5,24 @@ imports:
filter:
excluded_paths:
- build/
- js/vendor/
- node_modules/
- public/js/
- tmp/
- vendor/
- tests/doctum-config.php
- test/doctum-config.php
checks:
javascript: true
php: true
tools:
external_code_coverage:
runs: 4 # php 7.x versions
timeout: 900 # 15 min
build:
image: default-jammy # New NodeJS versions require newer versions of glibc (noble was not available on 12/09/2025)
nodes:
analysis:
environment:
php: 8.2
node: 20 # Scrutinizer uses nvm
php: 7.1
node: 10
dependencies:
before:
- composer config --unset repositories.0
- composer install
- composer require tecnickcom/tcpdf pragmarx/google2fa-qrcode bacon/bacon-qr-code code-lts/u2f-php-server
- composer require tecnickcom/tcpdf pragmarx/google2fa-qrcode samyoul/u2f-php-server
tests:
override:
- php-scrutinizer-run

View File

@ -4,20 +4,11 @@
"stylelint-config-recommended-scss"
],
"rules": {
"selector-class-pattern": null,
"import-notation": null,
"selector-attribute-quotes": null,
"shorthand-property-no-redundant-values": null,
"function-url-quotes": null,
"selector-id-pattern": null,
"alpha-value-notation": null,
"color-function-notation": null,
"scss/no-global-function-names": null,
"scss/function-quote-no-quoted-strings-inside": null,
"property-no-vendor-prefix": null,
"declaration-block-no-redundant-longhand-properties": null,
"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",
@ -25,14 +16,6 @@
],
"ignore": ["after-comment"],
"ignoreAtRules": ["else"]
}],
"value-keyword-case": [
"lower",
{
"ignoreProperties": [
"$font-family-monospace"
]
}
]
}]
}
}

206
.travis.yml Normal file
View File

@ -0,0 +1,206 @@
dist: xenial
language: php
stages:
- name: "Lint and analyse code"
- name: "PHP Unit tests"
- name: "Documentation"
- name: "Other tests"
install:
- nvm install 10
- composer install --no-interaction
- yarn install --non-interactive
before_script:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
- mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
- mysql -uroot < sql/create_tables.sql
- mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
- ./test/start-local-server
script:
- ./scripts/generate-mo --quiet
- ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
after_script:
- if [ -f php.log ] ; then cat php.log ; fi
- if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
- if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
- if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -Ls https://coverage.codacy.com/get.sh)
services:
- mysql
cache:
pip: true
yarn: true
directories:
- $HOME/.composer/cache/
- $HOME/browserstack
- node_modules
jobs:
allow_failures:
- php: nightly
- os: osx
include:
- stage: "Lint and analyse code"
name: "Lint files"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
script:
- ./test/ci-phplint
- composer phpcs
- yarn run js-lint --quiet
- yarn run css-lint
- stage: "Lint and analyse code"
name: "Run phpstan"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
script: composer phpstan -- --memory-limit 2G
- stage: "PHP Unit tests"
php: 7.1
name: "PHP 7.1"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.2
name: "PHP 7.2"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.3
name: "PHP 7.3"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.4
name: "PHP 7.4"
env: CI_MODE=test
before_install: phpenv config-rm xdebug.ini
- stage: "PHP Unit tests"
php: nightly
name: "PHP nightly"
env: CI_MODE=test
install:
- composer install --no-interaction --ignore-platform-reqs
- nvm install 10
- yarn install --non-interactive
- stage: "PHP Unit tests"
name: "OSX"
os: osx
env: CI_MODE=test
language: node_js
node_js: 10
before_install:
- export PATH="/usr/local/opt/gettext/bin:$PATH"
- echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
- echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
- mysql.server start
- sleep 5
# Enable password access
- mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
addons:
homebrew:
packages:
- php
- composer
- mariadb
update: true
- stage: "PHP Unit tests"
name: "Windows"
os: windows
language: node_js
node_js: 10
env:
- CI_MODE=test
- YARN_GPG=no
install:
- composer install --no-interaction --ignore-platform-reqs
- yarn install --non-interactive
before_install:
- choco install php composer
- choco install mariadb --version=10.4.8
- export PATH=/c/tools/php80:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
- PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
- for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php80/php.ini ; done
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php80/php.ini
- stage: "PHP Unit tests"
php: 7.1
name: "PHP 7.1 with dbase extension"
env: CI_MODE=test
install:
- pecl channel-update pecl.php.net
- pecl install dbase
- php -m |grep -F 'dbase'
- composer install --no-interaction
- nvm install 10
- yarn install --non-interactive
- stage: "Documentation"
name: "Build docs"
before_script: skip
after_script: skip
after_success: skip
install:
- source ~/virtualenv/python3.6/bin/activate
- pip install 'Sphinx'
script: ./test/ci-docs
- stage: "Documentation"
name: "Build API docs"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
install: composer global require "code-lts/doctum:^5.2"
script: $(composer global config bin-dir --absolute --quiet)/doctum.php --no-interaction update ./test/doctum-config.php -vvv --ignore-parse-errors --no-progress --no-ansi
- stage: "Other tests"
name: "Build release"
before_script: skip
after_script: skip
after_success: skip
install:
- nvm install 10
- source ~/virtualenv/python3.6/bin/activate
- pip install 'Sphinx'
script: ./scripts/create-release.sh --ci
- stage: "Other tests"
name: "Run selenium tests on Google Chrome"
env:
- CI_MODE=selenium
- TESTSUITE_SELENIUM_BROWSER=chrome
- TESTSUITE_USER=root
- TESTSUITE_URL=http://127.0.0.1:8000
before_install: phpenv config-rm xdebug.ini
install:
- nvm install 10
- ./test/install-browserstack
- composer install --no-interaction
- yarn install --non-interactive
- echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
addons:
apt:
packages:
- nginx

View File

@ -1,102 +0,0 @@
# Changes in phpMyAdmin 6.0
All notable changes of the phpMyAdmin 6.0 release series are documented in this file following the [Keep a Changelog](https://keepachangelog.com/) format.
## [6.0.0] - YYYY-MM-DD
### Added
* [#17029](https://github.com/phpmyadmin/phpmyadmin/pull/17029): Enable Twig's `strict_variables` option in development environment
* [#17361](https://github.com/phpmyadmin/phpmyadmin/pull/17361): Add webpack bundler
* [#16500](https://github.com/phpmyadmin/phpmyadmin/pull/16500): Add paging to Routines page
* [#17753](https://github.com/phpmyadmin/phpmyadmin/pull/17753): Adding `inputmode` numeric to integer fields
* [#17765](https://github.com/phpmyadmin/phpmyadmin/pull/17765): Make search input field types match columns types (integer and float)
* [#17809](https://github.com/phpmyadmin/phpmyadmin/pull/17809): Adds support for SHA2 function
* [#18098](https://github.com/phpmyadmin/phpmyadmin/pull/18098): Added reCaptcha example for Cloudflare Turnstile
* [#18223](https://github.com/phpmyadmin/phpmyadmin/pull/18223): Add a configuration option to (dis)allow shared bookmarks: `$cfg['AllowSharedBookmarks'] = true;`
* [#18225](https://github.com/phpmyadmin/phpmyadmin/pull/18225): Make database and web server info separately configurable on `$cfg['ShowServerInfo']`
* [#18257](https://github.com/phpmyadmin/phpmyadmin/pull/18257): Add support for theme color modes
* [#17009](https://github.com/phpmyadmin/phpmyadmin/issues/17009): Implement the security header `Permissions-Policy`
* [#18349](https://github.com/phpmyadmin/phpmyadmin/pull/18349): Allow rollbacking SET queries
* [#18589](https://github.com/phpmyadmin/phpmyadmin/pull/18589): Add support for PSR-15 middleware
* [#18649](https://github.com/phpmyadmin/phpmyadmin/pull/18649): Add color mode toggle at the top navigation bar
* [#18668](https://github.com/phpmyadmin/phpmyadmin/pull/18668): Add number formatting to Total on Browse
* [#18747](https://github.com/phpmyadmin/phpmyadmin/pull/18747): Add `composer.lock` to version control
* [#18799](https://github.com/phpmyadmin/phpmyadmin/pull/18799): Add an user account menu button at top right
* [#18812](https://github.com/phpmyadmin/phpmyadmin/pull/18812): Add role based auth for MySQL 8.x and compatibles
* [#18916](https://github.com/phpmyadmin/phpmyadmin/pull/18916): Add format button to routine, event and trigger
* [#18537](https://github.com/phpmyadmin/phpmyadmin/pull/18537): Add copy to clipboard for export as text
* [#19287](https://github.com/phpmyadmin/phpmyadmin/pull/19287): Add optional support for binary data in database search
* [#19308](https://github.com/phpmyadmin/phpmyadmin/pull/19308): Added an option in the SQL box to "Format as a single line"
* [#19352](https://github.com/phpmyadmin/phpmyadmin/pull/19352): Added support for `BETWEEN` and `NOT BETWEEN` on the query generator
* [#19525](https://github.com/phpmyadmin/phpmyadmin/pull/19525): Add support for `INSERT IGNORE` into for non table imports
* [#19555](https://github.com/phpmyadmin/phpmyadmin/pull/19555): Add button for Copy Query in Query Generator
* [#19691](https://github.com/phpmyadmin/phpmyadmin/pull/19691): Show hostname on main page
* [#19751](https://github.com/phpmyadmin/phpmyadmin/pull/19751): Add Go button at the top of the insert row table
* [#19812](https://github.com/phpmyadmin/phpmyadmin/pull/19812): Add show create table shortcuts when viewing tables
### Changed
* [#17116](https://github.com/phpmyadmin/phpmyadmin/pull/17116): Replace Change Password dialog to modal
* [#17125](https://github.com/phpmyadmin/phpmyadmin/pull/17125): Replace Add Index dialog with modal
* [#17127](https://github.com/phpmyadmin/phpmyadmin/pull/17127): Replace Page settings dialog with modal
* [#17278](https://github.com/phpmyadmin/phpmyadmin/pull/17278): Improve NULL div design
* [#17280](https://github.com/phpmyadmin/phpmyadmin/pull/17280): Improve theme card heights
* [#17399](https://github.com/phpmyadmin/phpmyadmin/pull/17399): Handle connection errors with Exception instead of warnings
* [#17515](https://github.com/phpmyadmin/phpmyadmin/pull/17515): Bump js-cookie version from 2.2.1 to 3.0.1
* [#17561](https://github.com/phpmyadmin/phpmyadmin/pull/17561): Improve Change Password modal UI
* [#17676](https://github.com/phpmyadmin/phpmyadmin/pull/17676): Extract `url.php` entry point into a route
* [#17677](https://github.com/phpmyadmin/phpmyadmin/pull/17677): Extract `js/messages.php` entry point into `/messages` route
* [#17801](https://github.com/phpmyadmin/phpmyadmin/pull/17801): Export page of Settings is not responsive
* [#17842](https://github.com/phpmyadmin/phpmyadmin/issues/17842): Change js.cookie.js to js.cookie.min.js
* [#17632](https://github.com/phpmyadmin/phpmyadmin/issues/17632): Improve tab keypress to text fields on the login form
* [#18124](https://github.com/phpmyadmin/phpmyadmin/pull/18124): Invert svg gis viewer mouse wheel zoom direction
* [#18136](https://github.com/phpmyadmin/phpmyadmin/pull/18136): Force a full page reload for top menu links
* [#18145](https://github.com/phpmyadmin/phpmyadmin/pull/18145): Move public files to the public directory
* [#18300](https://github.com/phpmyadmin/phpmyadmin/pull/18300): Convert JavaScript files to TypeScript
* [#18310](https://github.com/phpmyadmin/phpmyadmin/pull/18310): Minimize form label column width in Routine, Event and Trigger modals
* [#18311](https://github.com/phpmyadmin/phpmyadmin/pull/18311): Only allow resizing textarea vertically
* [#18365](https://github.com/phpmyadmin/phpmyadmin/pull/18365): Change 'reCaptcha' text to 'Captcha'
* [#18439](https://github.com/phpmyadmin/phpmyadmin/pull/18439): Redesign the SQL message card
* [#18576](https://github.com/phpmyadmin/phpmyadmin/pull/18576): Wrap the Application::run() code with an HTTP handler
* [#18652](https://github.com/phpmyadmin/phpmyadmin/pull/18652): Disable AJAX for navigation sidebar links
* [#18658](https://github.com/phpmyadmin/phpmyadmin/pull/18658): Update OpenLayers
* [#18703](https://github.com/phpmyadmin/phpmyadmin/pull/18703): Limit label width in create-view table
* [#18512](https://github.com/phpmyadmin/phpmyadmin/issues/18512): New directory structure
* [#18994](https://github.com/phpmyadmin/phpmyadmin/pull/18994): Refactor name generation of file imports
* [#19110](https://github.com/phpmyadmin/phpmyadmin/pull/19110): Refactor recent/favorite tables buttons
* [#19182](https://github.com/phpmyadmin/phpmyadmin/pull/19182): Refactor GIS editor modal
* [#19214](https://github.com/phpmyadmin/phpmyadmin/pull/19214): Replace jqPlot library with Chart.js library
* [#19294](https://github.com/phpmyadmin/phpmyadmin/pull/19294): Simplify IN, NOT IN criteria text in Query Generator
* [#19327](https://github.com/phpmyadmin/phpmyadmin/pull/19327): Prevent IN / NOT IN duplicates in Query Generator
* [835fc27](https://github.com/phpmyadmin/phpmyadmin/commit/835fc2715d6f7330fa5ed680e8315b98eaa96cec): Redesign the User Groups form page
* [624126e](https://github.com/phpmyadmin/phpmyadmin/commit/624126edc8ea629ebbb222496bb4dad6cac9c6dd): Redesign the database and table privileges pages
* [#19398](https://github.com/phpmyadmin/phpmyadmin/issues/19398): Use `application/json` instead of `text/plain` for JSON export
* [#19496](https://github.com/phpmyadmin/phpmyadmin/pull/19496): Update CODE_OF_CONDUCT.md
* [#19513](https://github.com/phpmyadmin/phpmyadmin/pull/19513): Hide unwanted input depending on chosen Op type in Query Generator
* [#19536](https://github.com/phpmyadmin/phpmyadmin/pull/19536): Disable Search input on unary operators
* [#19542](https://github.com/phpmyadmin/phpmyadmin/pull/19542): Made Search operators `= ''`/`!= ''` more obvious
* [#19651](https://github.com/phpmyadmin/phpmyadmin/pull/19651): Stay the on same page when deleting a foreign key
* [#19712](https://github.com/phpmyadmin/phpmyadmin/pull/19712): Import OpenLayers and Bootstrap directly using Webpack
* [#19794](https://github.com/phpmyadmin/phpmyadmin/pull/19794): Use `jquery-ui-timepicker-addon.min.js` instead of `jquery-ui-timepicker-addon.js`
* [#19795](https://github.com/phpmyadmin/phpmyadmin/pull/19795): Use `additional-methods.min.js` instead of `additional-methods.js`
* [#19564](https://github.com/phpmyadmin/phpmyadmin/pull/19564): Update the table comment field to a textarea
* [#19947](https://github.com/phpmyadmin/phpmyadmin/pull/19947): Export ODS column headers by default
### Removed
* [#17351](https://github.com/phpmyadmin/phpmyadmin/pull/17351): Drop `stripslashes`
* [#17516](https://github.com/phpmyadmin/phpmyadmin/pull/17516): Remove `jquery-debounce-throttle` JavaScript dependency
* [#17752](https://github.com/phpmyadmin/phpmyadmin/pull/17752): Remove Sodium polyfill and require the PHP sodium extension
* [#18430](https://github.com/phpmyadmin/phpmyadmin/pull/18430): Remove Query-By-Example feature
* [#18547](https://github.com/phpmyadmin/phpmyadmin/pull/18547): Remove support for the Recode extension
* [#18587](https://github.com/phpmyadmin/phpmyadmin/pull/18587): Remove the `public/show_config_errors.php` file
* [#19128](https://github.com/phpmyadmin/phpmyadmin/pull/19128): Remove the `phpmyadmin/twig-i18n-extension` package
* [#19243](https://github.com/phpmyadmin/phpmyadmin/pull/19243): Bump minimum PHP version to 8.2.0
* [#19408](https://github.com/phpmyadmin/phpmyadmin/pull/19408): Removed the popup that warned about having an auto-saved query
* [#19409](https://github.com/phpmyadmin/phpmyadmin/pull/19409): Drop Protocol version
* [#19550](https://github.com/phpmyadmin/phpmyadmin/pull/19550): Replace jQuery UI's tooltip with Bootstrap's Tooltip
* [#19852](https://github.com/phpmyadmin/phpmyadmin/pull/19852): Bump Node version to 20
* [#19854](https://github.com/phpmyadmin/phpmyadmin/pull/19854): Drop support for BaconQrCode v2
[6.0.0]: https://github.com/phpmyadmin/phpmyadmin/compare/QA_5_2...master

View File

@ -2,131 +2,45 @@
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
Examples of behavior that contributes to creating a positive environment include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior include:
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
## Our Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
info@phpmyadmin.net.
All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@phpmyadmin.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -8,7 +8,7 @@ We appreciate your effort to improve phpMyAdmin by submitting a bug report. Befo
1. Check whether the bug you face **hasn't been already reported**. Duplicate reports take us time, that we could be used to fix other bugs or make improvements.
2. Please specify the phpMyAdmin, server, PHP, MySQL, and browser information that may be helpful in resolving the issue, especially the exact **version numbers**.
2. Specify the phpMyAdmin, server, PHP, MySQL and browser information that may be helpful to fix the problem, especially exact **version numbers**.
3. If you got some error, please **describe what happened** and add an error message. Reports like "I get an error when I clicked on some link" are useless.

466
ChangeLog Normal file
View File

@ -0,0 +1,466 @@
phpMyAdmin - ChangeLog
======================
5.0.5 (not yet released)
- issue #14494 Fix uncaught TypeError when editing partitioning
- issue #16525 Fix PHP 8.0 failing tests when comparing 0 to ''
- issue #16429 Fixed PHP 8.0 errors on preg_replace and operand types
- issue #16490 Fixed PHP 8.0 function libxml_disable_entity_loader() is deprecated
- issue #16429 Fixed failing unit tests on PHP 8.0
- issue #16609 Fixed Sql.rearrangeStickyColumns is not a function
5.0.4 (2020-10-15)
- issue #16245 Fix failed Zoom search clears existing values
- issue Fixed a PHP error when reporting a particular JS error
- issue #16326 Fixed latitude and longitude swap for geometries in edit mode
- issue #16032 Fix CREATE TABLE not being tracked when auto tracking is enabled
- issue #16397 Fix compatibility problems with older PHP versions (also issue #16399)
- issue #16396 Fix broken two-factor authentication
5.0.3 (2020-10-09)
- issue #15983 Require twig ^2.9
- issue Fix option to import files locally appearing as not available
- issue #16048 Fix to allow NULL as a default bit value
- issue #16062 Fix "htmlspecialchars() expects parameter 1 to be string, null given" on Export xml
- issue #16078 Fix no charts in monitor when using a decimal separator ","
- issue #16041 Fix IN(...) clause doesn't permit multiple values on "Search" page
- issue #14411 Support double tap to edit on mobile
- issue #16043 Fix php error "Use of undefined constant MYSQLI_TYPE_JSON" when using the mysqlnd extension
- issue #14611 Fix fatal JS error on index creation after using Enter key to submit the form
- issue #16012 Set "axis-order" to swap lon and lat on MySQL >= 8.1
- issue #16104 Fixed overwriting a bookmarked query causes a PHP fatal error
- issue Fix typo in a condition in the Sql class
- issue #15996 Fix local setup doc links pointing to a wrong location
- issue #16093 Fix error importing utf-8 with bom sql file
- issue #16089 2FA UX enhancement: autofocus 2FA input
- issue #16127 Fix table column description PHP error when ['DisableIS'] = true;
- issue #16130 Fix local documentation links display when a PHP extension is missing
- issue Fix some twig code deprecations for php 8
- issue Fix ENUM and SET display when editing procedures and functions
- issue Keep full query state on "auto refresh" process list
- issue Keep columns order on "auto refresh" process list
- issue Fixed editing a failed query from the error message
- issue #16166 Fix the alter user privileges query to make it MySQL 8.0.11+ compatible
- issue Fix copy table to another database when the nbr of DBs is > $cfg['MaxDbList']
- issue #16157 Fix relations of tables having spaces or special chars not showing in the Designer
- issue #16052 Fix a very rare JS error occuring on mousemove event
- issue #16162 Make a foreign key link clickable in a new tab after the value was saved and replaced
- issue #16163 Fixed a PHP notice "Undefined index: column_info" on views
- issue #14478 Fix the data stream when exporting data in file mode
- issue #16184 Fix templates/ directory not found error
- issue #16184 Remove chdir logic to fix PHP fatal error "Uncaught TypeError: chdir()"
- issue Support for Twig 3
- issue Allow phpmyadmin/twig-i18n-extension ^3.0
- issue #16201 Trim spaces for integer values in table search
- issue #16076 Fixed cannot edit or export TIMESTAMP column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13
- issue #16226 Fix error 500 after copying a table
- issue #16222 Fixed can't use the search page when the table name has special characters
- issue #16248 Fix zoom search is not performing input validation on INT columns
- issue #16248 Fix javascript error when typing in INT fields on zoom search page
- issue Fix type errors when using saved searches
- issue #16261 Fix missing headings on modals of "User Accounts -> Export"
- issue #16146 Fixed sorting did not keep the selector of number of rows
- issue #16194 Fixed SQL query does not appear in case of editing view where definer is not you on MySQL 8
- issue #16255 Fix tinyint(1) shown as INT on Search page
- issue #16256 Fix "Warning: error_reporting() has been disabled for security reasons" on php 7.x
- issue #15367 Fix "Change or reconfigure primary server" link
- issue #15367 Fix first replica links, start, stop, ignore links
- issue #16058 Add "PMA_single_signon_HMAC_secret" for signon auths to make special links work and udate examples
- issue #16269 Support ReCaptcha v2 checkbox width "$cfg['CaptchaMethod'] = 'checkbox';"
- issue #14644 Use Doctum instead of Sami
- issue #16086 Fix "Browse" headings shift when scrolling
- issue #15328 Fix no message after import of zipped shapefile without php-zip
- issue #14326 Fix PHP error when exporting without php-zip
- issue #16318 Fix Profiling doesn't sum the number of calls
- issue #16319 Fixed a Russian translation mistake on search results total text
- issue #15634 Only use session_set_cookie_params once on PHP >= 7.3.0 versions for single signon auth
- issue #14698 Fixed database named as 'New' (language variable) causes PHP fatal error
- issue #16355 Make textareas both sides resizable
- issue #16366 Fix column definition form not showing default value
- issue #16342 Fixed multi-table query (db_multi_table_query.php) alias show the same alias for all columns
- issue #15109 Fixed using ST_GeomFromText + GUI on insert throws an error
- issue #16325 Fixed editing Geometry data throws error on using the GUI
- issue [security] Fix XSS vulnerability with the transformation feature (PMASA-2020-5)
- issue [security] Fix SQL injection vulnerability with search feature (PMASA-2020-6)
5.0.2 (2020-03-20)
- issue Fixed deprecation warning "implode(): Passing glue string after array is deprecated." function on export page
- issue #15767 Fixed can not copy user account since 5.0 - "error #1133"
- issue #15772 Fixed error code 500 during pagination of the tables in a database
- issue #16009 Fix php error "Trying to access array offset on value of type null" on column distinct values feature
- issue #15741 Fix fatal javascript error on clicking "Pick from Central Columns"
- issue #15773 Fixed a view named "views" adds an expand button
- issue #15432 Fixed names of the pages in the designer should be unique
- issue #14310 Fixed column selector "See more" removes "Preview SQL" and "Save" area
- issue Fixed wrong jQuery function call in table search page
- issue #15761 Fix uncaught TypeError when using "$cfg['ServerDefault'] = 0;"
- issue #15780 Fixed unexpected UI of action links (text only mode)
- issue #15674 Replace twig/extensions with phpmyadmin/twig-i18n-extension
- issue #15799 Change location of profiling state documentation to fix column ordering
- issue #15720 Fix designer adding all available tables to a designer page after adding a new relationship
- issue #15791 Replace facebook/webdriver by php-webdriver/webdriver
- issue #15802 Removed SET AUTOCOMMIT=0 from SQL export
- issue #15818 Fix table borders missing on theme original since 5.0.0
- issue #13864 Fix ENUM's radiobuttons reset on "Continue insertion with" changes
- issue #15811 Fixed browse foreign values doesn't show a modal with grid edit
- issue #15817 Fix "new table" layout issue on original theme
- issue #15798 Fixed not needed prompt before abandoning changes on SQL tab after only changing a checkbox
- issue #15833 Fix php TypeError when submitting unchanged data
- issue Fix php notice "Trying to access array offset on value of type bool" on Designer
- issue #13326 Added integer validations on search page
- issue #15200 Fixed server-side HTTPS detection misses support for Forwarded HTTP Extension (RFC 7239)
- issue #15831 Fixed DB names starting with "b" being cut off in <option>, User account page
- issue #15850 Fixed display content from "information_schema.PROCESSLIST"
- issue #15836 Fixed "has no type" error on export and import pages for "Chinese traditional" users
- issue #15863 Fixed designer move menu icon not changing directions and tables menu list resize button
- issue #15854 Fixed black borders for full screen mode on Designer
- issue #15899 Fix "Uncaught TypeError: mb_strtoupper()" on the relational view of a view
- issue Fixed some php uncaught errors and notices on user missing extension
- issue #15926 Fixed PhpMyAdmin\Core::getRealSize('8000M') returns a float instead of an int
- issue #15410 Fixed auto increment reset issue where the last value of AI was saved an could destroy the "good" value
- issue #15187 Fixed editing a row and using 'insert as new row' uses primary key 0 instead of NULL
- issue #15877 Fixed php error "preg_match() expects parameter 2 to be string, null given" on some specific tables
- issue #15795 Fix broken link on "MySQL said" error message
- issue #15781 Fix illegal string offset error on structure page of 'information_schema' database
- issue #15745 Fix version 5.0.1 suggests 4.9.4 as latest stable version
- issue #15958 Fix uncaught TypeError when sorting database tables by size or by rows
- issue #15830 Fix strftime issue on windows for Japanese users on "Structure" tab
- issue Windows testsuite fixes
- issue #15879 Added missing CSS class on "simulate query" button
- issue #15401 Fixed php notice "Undefined index HMAC_secret" for users upgrading phpMyAdmin without a log-out
- issue #15810 Fixed unexpected heading on add a new procedure, trigger, function, routine modals
- issue #15970 Removed wrong html a tag on "Replication status" header
- issue Add missing css classes on some buttons
- issue #15937 Make modals draggability/expand (down) work after a screen zoom change
- issue Fix php notice "Undefined index: on_delete" while creating a foreign key
- issue #15876 Fixed select "IN (...)" is a simple select instead of a multiple select
- issue Fix maxlength for User and Host on replication add user form
- issue #15282 Fixed MySQL 8.0 password syntax error when creating a replication user
- issue #15986 Fixed php fatal error "Uncaught TypeError: array_flip() expects parameter 1 to be array, null given"
- issue Fixed php fatal error "Uncaught TypeError: htmlspecialchars() expects parameter 1 to be string, int given"
- issue Support phpunit 9.0
- issue Fix error in NavigationTree where $key might be sent as an int instead of a str to urlencode
- issue #16022 Fix uncaught TypeError on browse foreigners
- issue Fix failure if relational display field value is NULL - "Display column for relationships"
- issue #16033 Remove vendor bin files from non source version of phpMyAdmin
- issue #15898 [security] Fix escape tbl_storage_engine argument used on tbl_create.php
- issue #15224 Don't fire keyboard shortcuts while SQL query area is focused (on a mobile for example)
- issue [security] Fix SQL injection with certain usernames (PMASA-2020-2)
- issue [security] Fix SQL injection in particular search situations (PMASA-2020-3)
- issue [security] Fix SQL injection and XSS flaw (PMASA-2020-4)
- issue Deprecate "options" for the external transformation; options must now be hard-coded along with the program name directly in the file.
5.0.1 (2020-01-07)
- issue #15719 Fixed error 500 when browsing a table when $cfg['LimitChars'] used a string and not an int value
- issue #14936 Fixed display NULL on numeric fields has showing empty string since 5.0.0
- issue #15722 Fix get Database structure fails with PHP error on replicated server
- issue #15723 Fix can't browse certain tables since 5.0.0 update
- issue Prevent line wrap in DB structure size column
- issue Remove extra line break from downloaded blob content
- issue #15725 Fixed error 500 when exporting - set time limit when $cfg['ExecTimeLimit'] used a string and not an int value
- issue #15726 Fixed double delete icons on enum editor
- issue #15717 Fixed warning popup not dissapearing on table stucture when using actions without any column selection
- issue #15693 Fixed focus of active tab is lost by clicking refresh option on browse tab
- issue #15734 Fix Uncaught TypeError: http_build_query() in setup
- issue Fix double slash in path when $cfg['TempDir'] has a trailing slash
- issue #14875 Fix shp file import tests where failing when php dbase extension was enabled
- issue #14299 Fix JS error "PMA_makegrid is not defined" when clicking on a table from the "Insert" tab opened in a new tab
- issue #15351 Fixed 2FA setting removed each time the user edits another configuration setting
- issue [security] Fix SQL injection vulnerability on the user accounts page (PMASA-2020-1)
5.0.0 (2019-12-26)
- issue #13896 Drop support for PHP 5.5, PHP 5.6, PHP 7.0 and HHVM
- issue #14007 Enable columns names by default for CSV exports
- issue #13919 Remove font size feature
- issue #12373 Add Metro theme
- issue #14155 Add move columns preview SQL button
- issue #14296 Enable strict mode in PHP files
- issue #13627 Increase field width for editing varchar fields
- issue #12603 Show warning for users with the default values for controluser and controlpass
- issue #14589 Fix rendering of column comments in Safari, improve display in all browsers
- issue #14330 New features for csv import plugin
- issue #14417 Automatically add index while editing an existing row and setting auto increment
- issue #13057 Add export option to drop user security definers from views
- issue #14404 Drop view and or replace added to exporting view
- issue #14594 Database "Search" selects all tables by default
- issue #12158 Auto expand the single database
- issue #13067 Inconsistency with submit buttons
- issue #14683 Improper message in Show Hidden Navigation Tree Items
- issue #14695 Remove unlabeled default collation from the bottom of the database list; this information is available elsewhere
- issue #14677 Security confirm() before running UPDATE statement without WHERE condition
- issue #13023 Show errors at the bottom of the page and add copy query button for errors in processing sql queries
- issue #14633 Use Sass instead of PHP to compile CSS
- issue #14765 Add initial support for Bootstrap 4
- issue #14829 Change table column comment field from input to textarea
- issue #14725 Console: ctrl+l clear line and ctrl+u clear console
- issue #14837 Use charset 'windows-1252' when format is MS Excel
- issue #15030 Move 'More settings' link from 'Appearance settings' to 'General settings'
- issue #15029 Remove the redundant 'i' help/tool tip in page settings "Query History Length" area
- issue #13424 Importing CSV now uses file name as the table name instead of 'TABLE #'
- issue #14926 Add an Edit link for each view in tables list
- issue #14890 Display column details in navigation bar
- issue #14977 Add title for group in navigation bar
- issue #14927 Show InnoDB table overhead (free space)
- issue #15072 Add 'Close' button to the Monitor Instructions modal
- issue #15174 Improved filter method in server variables page
- issue #15266 Add an external dependency injection system
- issue #15350 Change MIME type references to Media (MIME) type
- issue Fixed url.php crashing because it's not loading the DatabaseInterface service
- issue #15540 Fixed uncaught TypeError: htmlspecialchars() in NavigationTree
- issue Fix twig deprecation notices for php 8.0
- issue #15435 Fix ReCAPTCHA couldn't find user-provided function: Functions.recaptchaCallback
- issue #15623 Fix width of picker modal and remove date picker for int fields
- issue #14732 Fixed can't rename primary key with auto increment
- issue #15677 Fix show process-list triggers a php exception
- issue #15697 Fix uncaught php error: "Call to a member function get() on null" in db_export.php when exporting a table from the list
4.9.7 (2020-10-15)
- issue #16397 Fix compatibility problems with older PHP versions (also issue #16399)
- issue #16396 Fix broken two-factor authentication
4.9.6 (2020-10-09)
- issue [security] Fix XSS vulnerability with the transformation feature (PMASA-2020-5)
- issue [security] Fix SQL injection vulnerability with search feature (PMASA-2020-6)
4.9.5 (2020-03-20)
- issue [security] Fix SQL injection with certain usernames (PMASA-2020-2)
- issue [security] Fix SQL injection in particular search situations (PMASA-2020-3)
- issue [security] Fix SQL injection and XSS flaw (PMASA-2020-4)
- issue Deprecate "options" for the external transformation; options must now be hard-coded along with the program name directly in the file.
4.9.4 (2020-01-07)
- issue #15724 Fix 2FA was disabled by a bug
- issue [security] Fix SQL injection vulnerability on the user accounts page (PMASA-2020-1)
4.9.3 (2019-12-26)
- issue #15570 Fix page contents go underneath of floating menubar in some cases
- issue #15591 Fix php notice 'Undefined index: foreign_keys_data' on relations view when the user has column access
- issue #15592 Fix php warning "error_reporting() has been disabled for security reasons"
- issue #15434 Fix middle click on table sort column name shows a blank page
- issue Fix php notice "Undefined index table_create_time" when setting displayed columns on results of a view
- issue #15571 Fix fatal error when trying to edit row with row checked and button under the table
- issue #15633 Fix designer set display field broken for php 5.x versions
- issue #15621 Support CloudFront-Forwarded-Proto header for Amazon CloudFront proxy
- issue Fix php 8.0 php notices - Undefined index on login page
- issue #15640 Fix php 7.4 error when trying to access array offset on value of type null on table browse
- issue #15641 Fix replication actions where broken (start slave, stop slave, reset, ...)
- issue #15608 Fix DisableIS is broken when with controluser configured (database list broken)
- issue #15614 Fix undefined offset on index page for MySQL 5.7.8 (server charset)
- issue #15692 Fix JavaScript error when user has not enough privilege to view query statistics.
- issue #14248 Fixed date selection in search menu missing higher Z-index value
- issue Fix Uncaught php TypeError on php 8.0 when adding a column to table create form
- issue #15682 Fix calendar not taking current time as default value
- issue #15636 Fix php error trying to access array offset on value o type null on replication GUI
- issue #15695 Fix input field for the time in datetime picker is disabled
4.9.2 (2019-11-21)
- issue #14184 Change the cookie name from phpMyAdmin to phpMyAdmin_https for HTTPS, fixes many "Failed to set session cookie" errors
- issue #15304 Fix ssl_use php error
- issue #14804 Fix undefined index: ssl_* variables
- issue #14245 Fix mysql 8.0.3 and above fails on advisor
- issue #15499 Fix unparenthesized php deprecation
- issue #15482 Fix URL encoding plus sign (+) in the table or DB name when configuring foreign keys
- issue #14898 Fixed bottom table in list in left panel blocked by horizontal scroll bar
- issue #15161 Fix text area overflows its parent element on "Query" page
- issue #15511 Fixed exporting users after a delete will delete all selected users on "Users" page
- issue #14598 Fixed checking referencial integrity on "Operations" page
- issue #14433 Fix "You do not have privileges to manipulate with the users!" on root superadmin
- issue #15391 Fix GIS polygon of a geometry field is not drawn on "GIS visualization"
- issue #15311 Fix adjust privileges on copy database fails with MariaDB
- issue #15477 Fix display referential integrity check for InnoDB
- issue #15236 Support phpunit 8 in our test suite to help packaging phpMyAdmin on Debian
- issue #15522 Fix missing image error fills logs, removed ic_b_info icon from icon list
- issue #15537 Fixed some issues with the sort by key selectors
- issue #15546 Fix operators precedence in DatabaseInterface class
- issue #14906 Test test suite on 32-bit systems
- issue Fix Long2IP transformation issue with PHP 7.1
- issue #14951 Fix moving columns with DEFAULT NULL doesn't work on MariaDB 10.2+
- issue #14951 Fix moving columns with INT AND DEFAULT CURRENT_TIMESTAMP doesn't work on MariaDB
- issue #12241 Fixed table alias is removed when exporting a query
- issue #15316 Fixed cross join clause is removed on export
- issue #14809 Fix error "is_uploaded_file() expects parameter 1 to be string" when inserting blobs from files
- issue #15127 Fix white square when refreshing designer or browsing other pages
- issue #13912 Detect when phpMyAdmin storage tables are not accessible, help users browse corrupt DBs
- issue #15465 Display profiling when query outputs no rows
- issue Fix setting and removing display field on Designer
- issue Added a warning when trying to set a display field on Designer and configuration storage is not setup
- issue #15327 Fix shift-click in Export misses a checkbox
- issue [security] Fix improperly sanitized data when showing the Git branch (thanks to Ali Hubail for this report)
- issue [security] Fix security weaknesses in Designer feature,including a flaw where an attacker could trigger an SQL injection attack (PMASA-2019-5)
4.9.1 (2019-09-20)
- issue #15313 Added support for Twig 2
- issue #15315 Fix cannot edit or export column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13
- issue Fix a TypeError in Import class with PHP 8
- issue #14270 Fix Middle-click on foreign key link broken
- issue #14363 Fix broken relational links in tables
- issue #14987 Fix weird error for empty collation
- issue #15334 Fix export of GIS visualisation not working (PNG, PDF, SVG)
- issue #14918 Use hex for the phpMyAdmin session token
- issue Added GB18030 Chinese collations description
- issue Added Russian, Swedish, Slovak and Chinese UCA 9.0.0 collations description
- issue Added description for the _ks (kana-sensitive) collation suffix
- issue Added description for the _nopad (NO PAD) collation suffix
- issue #15404 Remove array/string curly braces access
- issue #15427 Fixed "FilterLanguages" option does not work (configuration)
- issue #15202 Fixed creating user with single quote in password results in no password user
- issue #14950 Fixed left database overview "add column" triggers error
- issue #15363 Fix remove unexpected quotes on text fields (structure and insert)
- issue Fix NULL wrongly checked on field change
- issue #15388 Fix allow to rollback an empty statement
- issue #14291 Fixed incorrect linkage from one table's value to another table
- issue #15446 Fix tables added from other databases are not collapsing in the designer section
- issue #14945 Fix designer page save fails if dB name contains period
- issue Display an error when trying to import in designer a table that's already imported
- issue Fix many bugs when adding new tables to designer
- issue Update CodeMirror to v5.48.4
- issue Update jQuery Migrate to v3.1.0
- issue Update jQuery Validation to v1.19.1
- issue Update jQuery to v3.4.1
- issue Update js-cookie to v2.2.1
- issue Remove fieldset closing tag when setting global privileges
- issue #15425 Fix backslash in column name resulting an error in editing
- issue #15380 Fix Status - Advisor error
- issue #15439 Fix designer page status not updated when added a new table from another database
- issue #15440 Fix page number is not being updated in the URL after saving a designer's page
- issue Fix reloading a designer's page
- issue Fix designer full screen mode button and text stuck when exiting full-screen mode
- issue Reduced possibility of causing heavy server traffic between the database and web servers
- issue Fix a situation where a server could be deleted while an administator is using the setup script
4.9.0.1 (2019-06-04)
- issue #14478 phpMyAdmin no longer streams the export data
- issue #14514 Tables with SYSTEM VERSIONING show up as views instead of tables
- issue #14515 Values cannot be edited in SYSTEM VERSIONING tables with INVISIBLE timestamps
- issue Fix header icon on server plugins page
- issue #14298 Fixed error 500 on MultiTableQuery page when a empty query is passed
- issue #14402 Fixed fatal javascript error while adding index to a new column
- issue #14896 Fixed issue with plus/minus icon when refreshing an expanded database
- issue #14922 Fixed json encode error in export
- issue #13975 Fixed missing query time in German (fix decimal number format issue)
- issue #14503 Fixed JavaScript events not activating on input (sql bookmark issue)
- issue #14898 Fixed Bottom table is blocked in database list (left panel)
- issue #14425 Fixed Null Checkbox automatically unmarked
- issue #14870 Display correct date and time in Zip files
- issue #14763 Fixed the loading symbol not appearing when refreshing the navigation
- issue #14607 Count rows only if needed
- issue #14832 Show Designer combo boxes when adding a constraint
- issue #14948 Fix change password is not showing password strength difference at the second attempt
- issue #14868 Fix edit view
- issue #14943 Fixed loading Forever when creating new view without filling any field
- issue #14843 Fix Bookmark::get() id matching SQL
- issue #14734 Fixed invalid default value for bit field
- issue #14311 Fixed undefined index in setup script
- issue #14991 Fixed TypeError in GIS editor
- issue Fixed GIS data editor for multi server setup
- issue #14312 Fixed type error in setup script when adding new server
- issue #14053 Fix missed padding on query results
- issue #14826 Fixed javascript error PMA_messages is not defined
- issue Show error message if config-set fails and not "loading..." forever
- issue #14359 Prevent multiple error modals, and error-report request spamming from script
- issue Fixed error reporting javascript errors on multi server setup
- issue Fixed wrong property name on TableStructureController
- issue #14811 Fix SHOW FULL TABLES FROM when a table is locked
- issue #14916 Fix bug when creating or editing views
- issue #14931 Fixed php error when using a query like SELECT 1 INTO @a; SELECT @a; in inline query edit
- issue #15074 Make the server logo visible on theme "original"
- issue #15077 Fixed incorrect page numbers
- issue #14205 Fixed "No tables found in database" when you delete all tables from last page
- issue #14957 Virtuality is not selected when editing generated column (added virtuality(stored) option for mariadb)
- issue #14853 Insert page should not allow entering things into virtual columns
- issue #15110 Fixed TypeError e.preventDefaulut is not a function
- issue #15115 Improved label in Settings export, clarifying that it's a JSON file
- issue #14816 Fixed [designer] Cannot read property 'style' of null
- issue Fixed [designer] Add new tables with database/table list modal
- issue Fixed query format on multi server setup
- issue Fixed remove partitioning on multi server setup
- issue Fixed normalization
- issue Fixed 'RESET SLAVE' button on replication slave
- issue Fixed sending a php error report on multi server setup
- issue Fixed downloading of monitor parameters for IE 11, Edge, Chrome and others
- issue #15141 Fixed php notice Undefined index: designer_settings
- issue #12729 Fixed sticky table header over dropdown menu
- issue #15140 Fixed edit link does not work on failed insert
- issue #14334 Fixed export table structure shows rows fields
- issue #15010 Fixed empty SQL preview modal on tbl_relation
- issue #14673 Fixed innodb & MySQL 8: DYNAMIC & COMPRESSED ROW_FORMAT missing
- issue Fixed empty success message when adding a new INDEX from left panel
- issue #15150 Fixed generate password hidden on second open of change password modal
- issue Fixed import XML data with leading zeros
- issue #15036 Fixed missing input fields checks for MaxSizeForInputField
- issue #15119 Fixed uninterpreted HTML on Settings->Export page
- issue #15159 Fixed missing query time and database in console
- issue #13713 Fixed column comments in the floating table header
- issue #15177 Fixed label alignment on login page
- issue #15210 Fixed a typo in the english name of the Albanian language
- issue Fixed issue when resetting charset in import.php
- issue #14460 Fixed forms where submitted multiple times on CTRL + ENTER
- issue #15038 Fixed console height was allowing a negative values
- issue #15219 Fixed 'No Password' option does not switch automatically to 'Use Text Field' in add user account
- issue Fixed importing the exported config on Server status monitor page
- issue #15228 Fixed php notice 'Undefined index: foreign_keys_data' on designer when the user has column access
- issue #12900 Fixed designer page saving gives error when configuration storage is not set up
- issue #15229 Fixed php notice, added support for 'DELETE HISTORY' table privilege (MariaDB >= 10.3.4)
- issue #14527 Fixed import settings function not working
- issue #14908 Fixed uninterpreted HTML on Settings->Import (missing data error descriptions)
- issue #14800 Fixed status->Processes doesn't show full query process list page
- issue #14833 Fixed sort by Time not working in process list page
- issue #14982 Fixed setting "null" keep an "enum" value
- issue #14401 Fixed insert rows keypress Enter behavior
- issue #15146 Fixed error reports can not be sent because they are too large
- issue #15205 Fixed useless backquotes on sql preview modal when deleting an index
- issue #13178 Fixed issues with uppercase table and database names (lower_case_table_names=1)
- issue #14383 Fixed warning when browsing certain tables (GIS data)
- issue #12865 Fixed MySQL 8.0.0 issues with GIS display
- issue #15059 Fixed "Server charset" in "Database server" tab showing wrong information
- issue #14614 Fixed mysql error "#2014 - Commands out of sync; you can't run this command now" on sql query
- issue #15238 Fixed phpMyAdmin 4.8.5 doesn't show privileges of procedures (raw html displayed instead)
- issue #13726 Fixed can not copy user on Percona Server 5.7
- issue #15239 Fixed javascript error while fetching latest version info and switching pages
- issue #14301 Fixed javascript error when editing a JSON data type column
- issue #15240 Fixed apply a Settings form with errors shows a JSON response after using return back
- issue #15043 Fixed multiple errors printing on Settings page
- issue #15037 Fixed unexpected behavior of reset button on Settings
- issue #15157 Fixed 'Settings' tab not marked as active when browsing 2FA settings
- issue #14934 Fixed all fields readonly on Edit/Insert screens
- issue #14588 Fixed export of geometry objects, GIS objects are now exported as hex
- issue #14412 Better handling of errors with Signon authentication type
- issue Added support for AUTO_INCREMENT when using ROCKSDB, on Operations page
- issue #15276 Fixed partitioning is missing in Structure page UI (MySQL 8.0)
- issue #14252 Fixed DisableIS and database tree list (new database missing when refreshing the list)
- issue #14621 Removed "Propose table structure" on MySQL 8.0
- issue Fixed editing of virtual columns on PerconaDB
- issue #13854 Fixed column options are ignored for GENERATED/VIRTUAL/STORED columns
- issue #15262 Fixed incorrect display of charset column (raw html)
- issue Added explicit parentheses in nested ternary operators
- issue #15287 Fix auto_increment field is too small
- issue #15283 Fix tries to change collation on views when changing collation on all tables/fields
- issue Fixed empty PMA_gotoWhitelist JavaScript array
- issue #15079 Fixed responsive behaviour of instruction dialog box
- issue #10846 Fixed javascript error when renaming a table
- issue Updated sql-parser to version 4.3.2
- issue [security] SQL injection in Designer (PMASA-2019-3)
- issue [security] CSRF attack on 'cookie' login form (PMASA-2019-4)
4.8.5 (2019-01-25)
- issue Developer debug data was saved to the PHP error log
- issue #14217 Fix issue when adding user on MySQL 8.0.11
- issue #13788 Exporting a view structure based on another view with a sub-query throws no database selected error
- issue #14635 Fix PHP error in GitRevision, error in processing request, error code 200
- issue #14787 Cannot execute stored procedure
- issue Add Burmese language
- issue #14794 Not responding to click, frozen interface, plugin Text_Plain_Sql error
- issue #14786 Table level Operations functions missing
- issue #14791 PHP warning, db_export.php#L91 urldecode()
- issue #14775 Export to SQL format not available for tables
- issue #14782 Error message shown instead of two-factor QR code when adding 2fa to a user
- issue [security] Arbitrary file read/delete relating to MySQL LOAD DATA LOCAL INFILE and an evil server instance (PMASA-2019-1)
- issue [security] SQL injection in Designer (PMASA-2019-2)
--- Older ChangeLogs can be found on our project website ---
https://www.phpmyadmin.net/old-stuff/ChangeLogs/
# vim: et ts=4 sw=4 sts=4
# vim: ft=changelog fenc=utf-8
# vim: fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>4&&getline(v\:lnum)!~'^#'
# vim: fdn=1 fdm=expr

6
README
View File

@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
Version 6.0.0-dev
Version 5.0.5-dev
A web interface for MySQL and MariaDB.
@ -12,7 +12,7 @@ Summary
phpMyAdmin is intended to handle the administration of MySQL over the web.
For a summary of features, list of requirements, and installation instructions,
please see the documentation in the ./docs/ folder or at https://docs.phpmyadmin.net/
please see the documentation in the ./doc/ folder or at https://docs.phpmyadmin.net/
Copyright
---------
@ -22,7 +22,7 @@ Copyright © 1998 onwards -- the phpMyAdmin team
Certain libraries are copyrighted by their respective authors;
see the full copyright list for details.
For full copyright information, please see ./docs/copyright.rst
For full copyright information, please see ./doc/copyright.rst
License
-------

View File

@ -8,41 +8,27 @@ https://www.phpmyadmin.net/
Code status
-----------
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml/badge.svg?branch=master
:alt: Testsuite
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml?query=branch%3Amaster
.. image:: https://travis-ci.org/phpmyadmin/phpmyadmin.svg?branch=QA_5_0
:alt: Build status
:target: https://travis-ci.org/phpmyadmin/phpmyadmin
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml/badge.svg?branch=master
:alt: End-to-End tests
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml?query=branch%3Amaster
.. image:: https://readthedocs.org/projects/phpmyadmin/badge/?version=master
:target: https://docs.phpmyadmin.net/en/master/
:alt: Documentation build status
.. image:: https://hosted.weblate.org/widgets/phpmyadmin/-/master/svg-badge.svg
.. 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
:alt: Coverage percentage
:target: https://codecov.io/gh/phpmyadmin/phpmyadmin
.. image:: https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/badges/quality-score.png
:alt: Code quality score
.. 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://shepherd.dev/github/phpmyadmin/phpmyadmin/coverage.svg
:alt: Type coverage
:target: https://shepherd.dev/github/phpmyadmin/phpmyadmin
.. image:: https://img.shields.io/endpoint?url=https://badge-api.stryker-mutator.io/github.com/phpmyadmin/phpmyadmin/master
:alt: Infection MSI
:target: https://infection.github.io
.. 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
@ -50,23 +36,20 @@ 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:
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 5.0.1 was tagged as ``RELEASE_5_0_1``.
* Releases are tagged, for example version 4.0.1 was tagged as ``RELEASE_4_0_1``.
Note that phpMyAdmin uses `Composer <https://getcomposer.org/>`_ to manage library dependencies; when using Git
development versions, you must manually run Composer.
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 https://docs.phpmyadmin.net/, or browse the documentation in the docs folder.
Please see the documentation in the doc folder or at https://docs.phpmyadmin.net/.
For `support <https://www.phpmyadmin.net/support/>`_ or `security issues, <https://www.phpmyadmin.net/security/>`_ you can visit https://www.phpmyadmin.net/
Translations are welcome. You can `translate phpMyAdmin into your language <https://hosted.weblate.org/projects/phpmyadmin/>`_.
If you would like to contribute to the phpMyAdmin's codebase, you can read the `code contribution file <CONTRIBUTING.md>`_ or browse our website's `contributing page <https://www.phpmyadmin.net/contribute/>`_.
For support or to learn how to contribute code or by translating to your language,
visit https://www.phpmyadmin.net/

74
ajax.php Normal file
View File

@ -0,0 +1,74 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Generic AJAX endpoint for getting information about database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\AjaxController;
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
$_GET['ajax_request'] = 'true';
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
$response->setAjax(true);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var AjaxController $controller */
$controller = $containerBuilder->get(AjaxController::class);
if (empty($_POST['type'])) {
Core::fatalError(__('Bad type!'));
}
switch ($_POST['type']) {
case 'list-databases':
$response->addJSON($controller->databases());
break;
case 'list-tables':
Util::checkParameters(['db'], true);
$response->addJSON($controller->tables([
'db' => $_POST['db'],
]));
break;
case 'list-columns':
Util::checkParameters(['db', 'table'], true);
$response->addJSON($controller->columns([
'db' => $_POST['db'],
'table' => $_POST['table'],
]));
break;
case 'config-get':
Util::checkParameters(['key'], true);
$response->addJSON($controller->getConfig([
'key' => $_POST['key'],
]));
break;
case 'config-set':
Util::checkParameters(['key', 'value'], true);
$result = $controller->setConfig([
'key' => $_POST['key'],
'value' => $_POST['value'],
]);
if ($result !== true) {
$response->setRequestStatus(false);
$response->addJSON('message', $result);
}
break;
default:
Core::fatalError(__('Bad type!'));
}

0
app/cache/.gitkeep vendored
View File

View File

@ -1,49 +0,0 @@
<?php
declare(strict_types=1);
$vendorConfig = require_once ROOT_PATH . 'app/vendor_config.php';
if (
! is_array($vendorConfig) || ! isset(
$vendorConfig['autoloadFile'],
$vendorConfig['tempDir'],
$vendorConfig['changeLogFile'],
$vendorConfig['licenseFile'],
$vendorConfig['sqlDir'],
$vendorConfig['configFile'],
$vendorConfig['customHeaderFile'],
$vendorConfig['customFooterFile'],
$vendorConfig['versionCheckDefault'],
$vendorConfig['localePath'],
$vendorConfig['cacheDir'],
$vendorConfig['versionSuffix'],
)
) {
exit;
}
// phpcs:disable PSR1.Files.SideEffects
define('AUTOLOAD_FILE', (string) $vendorConfig['autoloadFile']);
define('TEMP_DIR', (string) $vendorConfig['tempDir']);
define('CHANGELOG_FILE', (string) $vendorConfig['changeLogFile']);
define('LICENSE_FILE', (string) $vendorConfig['licenseFile']);
define('SQL_DIR', (string) $vendorConfig['sqlDir']);
define('CONFIG_FILE', (string) $vendorConfig['configFile']);
define('CUSTOM_HEADER_FILE', (string) $vendorConfig['customHeaderFile']);
define('CUSTOM_FOOTER_FILE', (string) $vendorConfig['customFooterFile']);
define('VERSION_CHECK_DEFAULT', (bool) $vendorConfig['versionCheckDefault']);
define('LOCALE_PATH', (string) $vendorConfig['localePath']);
define('CACHE_DIR', (string) $vendorConfig['cacheDir']);
define('VERSION_SUFFIX', (string) $vendorConfig['versionSuffix']);
/**
* TCPDF workaround. Avoid referring to nonexistent files (causes warnings when open_basedir is used).
* This is defined to avoid the TCPDF code to search for a directory outside of open_basedir.
* This value if not used but is useful, no header logic is used for PDF exports.
*
* @see https://github.com/phpmyadmin/phpmyadmin/issues/16709
*/
define('K_PATH_IMAGES', ROOT_PATH);
// phpcs:enable
unset($vendorConfig);

View File

@ -1,416 +0,0 @@
<?php
declare(strict_types=1);
use PhpMyAdmin\Advisory\Advisor;
use PhpMyAdmin\Application;
use PhpMyAdmin\Bookmarks\BookmarkRepository;
use PhpMyAdmin\BrowseForeigners;
use PhpMyAdmin\Clock\Clock;
use PhpMyAdmin\Config;
use PhpMyAdmin\Config\UserPreferences;
use PhpMyAdmin\Config\UserPreferencesHandler;
use PhpMyAdmin\ConfigStorage\Relation;
use PhpMyAdmin\ConfigStorage\RelationCleanup;
use PhpMyAdmin\Console\Console;
use PhpMyAdmin\Console\History;
use PhpMyAdmin\CreateAddField;
use PhpMyAdmin\Database\CentralColumns;
use PhpMyAdmin\Database\Designer;
use PhpMyAdmin\Database\Designer\Common;
use PhpMyAdmin\Database\Events;
use PhpMyAdmin\Database\Routines;
use PhpMyAdmin\Dbal\DatabaseInterface;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Error\ErrorHandler;
use PhpMyAdmin\Error\ErrorReport;
use PhpMyAdmin\Export\Export;
use PhpMyAdmin\Export\Options;
use PhpMyAdmin\Export\OutputHandler;
use PhpMyAdmin\Export\TemplateModel;
use PhpMyAdmin\FileListing;
use PhpMyAdmin\FlashMessenger;
use PhpMyAdmin\Footer;
use PhpMyAdmin\Header;
use PhpMyAdmin\Http\Factory\ResponseFactory;
use PhpMyAdmin\Http\Middleware;
use PhpMyAdmin\I18n\LanguageManager;
use PhpMyAdmin\Import\Import;
use PhpMyAdmin\Import\SimulateDml;
use PhpMyAdmin\InsertEdit;
use PhpMyAdmin\Navigation\Navigation;
use PhpMyAdmin\Normalization;
use PhpMyAdmin\Operations;
use PhpMyAdmin\Partitioning\Maintenance;
use PhpMyAdmin\Plugins\AuthenticationPluginFactory;
use PhpMyAdmin\Replication\Replication;
use PhpMyAdmin\Replication\ReplicationGui;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Server\Plugins;
use PhpMyAdmin\Server\Privileges;
use PhpMyAdmin\Server\Privileges\AccountLocking;
use PhpMyAdmin\Server\Status\Data;
use PhpMyAdmin\Server\Status\Monitor;
use PhpMyAdmin\Server\Status\Processes;
use PhpMyAdmin\Sql;
use PhpMyAdmin\SqlQueryForm;
use PhpMyAdmin\Table\ColumnsDefinition;
use PhpMyAdmin\Table\Indexes;
use PhpMyAdmin\Table\Search;
use PhpMyAdmin\Table\TableMover;
use PhpMyAdmin\Template;
use PhpMyAdmin\Theme\ThemeManager;
use PhpMyAdmin\Tracking\Tracking;
use PhpMyAdmin\Tracking\TrackingChecker;
use PhpMyAdmin\Transformations;
use PhpMyAdmin\Triggers\Triggers;
use PhpMyAdmin\UrlRedirector;
use PhpMyAdmin\UserPassword;
use PhpMyAdmin\UserPrivilegesFactory;
use PhpMyAdmin\Utils\HttpRequest;
use PhpMyAdmin\VersionInformation;
use Psr\Clock\ClockInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
return [
Advisor::class => ['class' => Advisor::class, 'arguments' => [DatabaseInterface::class, ExpressionLanguage::class]],
Application::class => [
'class' => Application::class,
'arguments' => [ResponseFactory::class, ResponseRenderer::class],
],
BrowseForeigners::class => [
'class' => BrowseForeigners::class,
'arguments' => [Template::class, Config::class, ThemeManager::class],
],
Config::class => ['class' => Config::class, 'factory' => [Config::class, 'getInstance']],
Config\PageSettings::class => [
'class' => Config\PageSettings::class,
'arguments' => [UserPreferences::class, ResponseRenderer::class],
],
CentralColumns::class => ['class' => CentralColumns::class, 'arguments' => [DatabaseInterface::class]],
CreateAddField::class => ['class' => CreateAddField::class, 'arguments' => [DatabaseInterface::class]],
DatabaseInterface::class => [
'class' => DatabaseInterface::class,
'factory' => [DatabaseInterface::class, 'getInstance'],
'arguments' => [Config::class],
],
DbTableExists::class => ['class' => DbTableExists::class, 'arguments' => [DatabaseInterface::class]],
Designer::class => [
'class' => Designer::class,
'arguments' => [DatabaseInterface::class, Relation::class, Template::class, Config::class],
],
Common::class => [
'class' => Common::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
ErrorHandler::class => ['class' => ErrorHandler::class, 'factory' => [ErrorHandler::class, 'getInstance']],
ErrorReport::class => [
'class' => ErrorReport::class,
'arguments' => [HttpRequest::class, Relation::class, Template::class, Config::class],
],
Events::class => ['class' => Events::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Export::class => ['class' => Export::class, 'arguments' => [DatabaseInterface::class, OutputHandler::class]],
Options::class => [
'class' => Options::class,
'arguments' => [Relation::class, TemplateModel::class, UserPreferencesHandler::class],
],
TemplateModel::class => ['class' => TemplateModel::class, 'arguments' => [DatabaseInterface::class]],
ExpressionLanguage::class => ['class' => ExpressionLanguage::class],
FileListing::class => ['class' => FileListing::class],
FlashMessenger::class => ['class' => FlashMessenger::class],
Header::class => [
'class' => Header::class,
'arguments' => [
Template::class,
Console::class,
Config::class,
DatabaseInterface::class,
Relation::class,
UserPreferences::class,
UserPreferencesHandler::class,
],
],
HttpRequest::class => ['class' => HttpRequest::class],
ResponseFactory::class => ['class' => ResponseFactory::class, 'factory' => [ResponseFactory::class, 'create']],
Import::class => [
'class' => Import::class,
'arguments' => [DatabaseInterface::class, ResponseRenderer::class, Config::class],
],
SimulateDml::class => ['class' => SimulateDml::class, 'arguments' => [DatabaseInterface::class]],
InsertEdit::class => [
'class' => InsertEdit::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
Transformations::class,
FileListing::class,
Template::class,
Config::class,
ResponseRenderer::class,
],
],
Middleware\ErrorHandling::class => [
'class' => Middleware\ErrorHandling::class,
'arguments' => [ErrorHandler::class],
],
Middleware\OutputBuffering::class => ['class' => Middleware\OutputBuffering::class],
Middleware\PhpExtensionsChecking::class => [
'class' => Middleware\PhpExtensionsChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\ServerConfigurationChecking::class => [
'class' => Middleware\ServerConfigurationChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\PhpSettingsConfiguration::class => ['class' => Middleware\PhpSettingsConfiguration::class],
Middleware\RouteParsing::class => ['class' => Middleware\RouteParsing::class],
Middleware\ConfigLoading::class => [
'class' => Middleware\ConfigLoading::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\UriSchemeUpdating::class => [
'class' => Middleware\UriSchemeUpdating::class,
'arguments' => [Config::class],
],
Middleware\SessionHandling::class => [
'class' => Middleware\SessionHandling::class,
'arguments' => [Config::class, ErrorHandler::class, Template::class, ResponseFactory::class],
],
Middleware\EncryptedQueryParamsHandling::class => ['class' => Middleware\EncryptedQueryParamsHandling::class],
Middleware\UrlParamsSetting::class => [
'class' => Middleware\UrlParamsSetting::class,
'arguments' => [Config::class],
],
Middleware\TokenRequestParamChecking::class => [
'class' => Middleware\TokenRequestParamChecking::class,
'arguments' => [ResponseRenderer::class],
],
Middleware\DatabaseAndTableSetting::class => ['class' => Middleware\DatabaseAndTableSetting::class],
Middleware\SqlQueryGlobalSetting::class => ['class' => Middleware\SqlQueryGlobalSetting::class],
Middleware\LanguageLoading::class => ['class' => Middleware\LanguageLoading::class],
Middleware\ConfigErrorAndPermissionChecking::class => [
'class' => Middleware\ConfigErrorAndPermissionChecking::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\RequestProblemChecking::class => [
'class' => Middleware\RequestProblemChecking::class,
'arguments' => [Template::class, ResponseFactory::class],
],
Middleware\CurrentServerGlobalSetting::class => [
'class' => Middleware\CurrentServerGlobalSetting::class,
'arguments' => [Config::class],
],
Middleware\ThemeInitialization::class => ['class' => Middleware\ThemeInitialization::class],
Middleware\UrlRedirection::class => [
'class' => Middleware\UrlRedirection::class,
'arguments' => [UrlRedirector::class, UserPreferencesHandler::class],
],
Middleware\SetupPageRedirection::class => [
'class' => Middleware\SetupPageRedirection::class,
'arguments' => [Config::class, ResponseFactory::class, UserPreferencesHandler::class, ResponseRenderer::class],
],
Middleware\MinimumCommonRedirection::class => [
'class' => Middleware\MinimumCommonRedirection::class,
'arguments' => [ResponseFactory::class, UserPreferencesHandler::class, ResponseRenderer::class],
],
Middleware\LanguageAndThemeCookieSaving::class => [
'class' => Middleware\LanguageAndThemeCookieSaving::class,
'arguments' => [Config::class],
],
Middleware\LoginCookieValiditySetting::class => [
'class' => Middleware\LoginCookieValiditySetting::class,
'arguments' => [Config::class, UserPreferencesHandler::class],
],
Middleware\Authentication::class => [
'class' => Middleware\Authentication::class,
'arguments' => [
Config::class,
Template::class,
ResponseFactory::class,
AuthenticationPluginFactory::class,
DatabaseInterface::class,
Relation::class,
ResponseRenderer::class,
],
],
Middleware\DatabaseServerVersionChecking::class => [
'class' => Middleware\DatabaseServerVersionChecking::class,
'arguments' => [Config::class, Template::class, ResponseFactory::class],
],
Middleware\SqlDelimiterSetting::class => [
'class' => Middleware\SqlDelimiterSetting::class,
'arguments' => [Config::class],
],
Middleware\ResponseRendererLoading::class => [
'class' => Middleware\ResponseRendererLoading::class,
'arguments' => [Config::class, ResponseRenderer::class],
],
Middleware\ProfilingChecking::class => [
'class' => Middleware\ProfilingChecking::class,
'arguments' => [ResponseRenderer::class, DatabaseInterface::class],
],
Middleware\UserPreferencesLoading::class => [
'class' => Middleware\UserPreferencesLoading::class,
'arguments' => [UserPreferencesHandler::class],
],
Middleware\RecentTableHandling::class => [
'class' => Middleware\RecentTableHandling::class,
'arguments' => [Config::class],
],
Middleware\StatementHistory::class => [
'class' => Middleware\StatementHistory::class,
'arguments' => [Config::class, History::class],
],
Navigation::class => [
'class' => Navigation::class,
'arguments' => [Template::class, Relation::class, DatabaseInterface::class, Config::class],
],
Normalization::class => [
'class' => Normalization::class,
'arguments' => [DatabaseInterface::class, Relation::class, Transformations::class, Template::class],
],
Operations::class => [
'class' => Operations::class,
'arguments' => [DatabaseInterface::class, Relation::class, TableMover::class],
],
OutputHandler::class => ['class' => OutputHandler::class],
Maintenance::class => ['class' => Maintenance::class, 'arguments' => [DatabaseInterface::class]],
AuthenticationPluginFactory::class => [
'class' => AuthenticationPluginFactory::class,
'arguments' => [ResponseRenderer::class],
],
Relation::class => ['class' => Relation::class, 'arguments' => [DatabaseInterface::class, Config::class]],
RelationCleanup::class => [
'class' => RelationCleanup::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Replication::class => ['class' => Replication::class, 'arguments' => [DatabaseInterface::class]],
ReplicationGui::class => ['class' => ReplicationGui::class, 'arguments' => [Replication::class, Template::class]],
ResponseRenderer::class => [
'class' => ResponseRenderer::class,
'factory' => [ResponseRenderer::class, 'getInstance'],
'arguments' => [
Config::class,
Template::class,
Header::class,
Footer::class,
ErrorHandler::class,
DatabaseInterface::class,
ResponseFactory::class,
],
],
Routines::class => ['class' => Routines::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Plugins::class => ['class' => Plugins::class, 'arguments' => [DatabaseInterface::class]],
Privileges::class => [
'class' => Privileges::class,
'arguments' => [
Template::class,
DatabaseInterface::class,
Relation::class,
RelationCleanup::class,
Plugins::class,
Config::class,
],
],
AccountLocking::class => ['class' => AccountLocking::class, 'arguments' => [DatabaseInterface::class]],
Sql::class => [
'class' => Sql::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
RelationCleanup::class,
Transformations::class,
Template::class,
BookmarkRepository::class,
Config::class,
ResponseRenderer::class,
],
],
SqlQueryForm::class => [
'class' => SqlQueryForm::class,
'arguments' => [Template::class, DatabaseInterface::class, BookmarkRepository::class],
],
Data::class => ['class' => Data::class, 'arguments' => [DatabaseInterface::class, Config::class]],
Monitor::class => ['class' => Monitor::class, 'arguments' => [DatabaseInterface::class]],
Processes::class => ['class' => Processes::class, 'arguments' => [DatabaseInterface::class]],
ColumnsDefinition::class => [
'class' => ColumnsDefinition::class,
'arguments' => [DatabaseInterface::class, Relation::class, Transformations::class],
],
Indexes::class => ['class' => Indexes::class, 'arguments' => [DatabaseInterface::class]],
\PhpMyAdmin\Table\Maintenance::class => [
'class' => \PhpMyAdmin\Table\Maintenance::class,
'arguments' => [DatabaseInterface::class],
],
Search::class => ['class' => Search::class, 'arguments' => [DatabaseInterface::class]],
Template::class => ['class' => Template::class, 'arguments' => [Config::class]],
ThemeManager::class => ['class' => ThemeManager::class],
Tracking::class => [
'class' => Tracking::class,
'arguments' => [
SqlQueryForm::class,
Template::class,
Relation::class,
DatabaseInterface::class,
TrackingChecker::class,
],
],
TrackingChecker::class => [
'class' => TrackingChecker::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Transformations::class => [
'class' => Transformations::class,
'arguments' => [DatabaseInterface::class, Relation::class],
],
Triggers::class => ['class' => Triggers::class, 'arguments' => [DatabaseInterface::class]],
UserPassword::class => [
'class' => UserPassword::class,
'arguments' => [Privileges::class, AuthenticationPluginFactory::class, DatabaseInterface::class],
],
UserPreferences::class => [
'class' => UserPreferences::class,
'arguments' => [
DatabaseInterface::class,
Relation::class,
Template::class,
Config::class,
ClockInterface::class,
],
],
UserPrivilegesFactory::class => [
'class' => UserPrivilegesFactory::class,
'arguments' => [DatabaseInterface::class],
],
VersionInformation::class => ['class' => VersionInformation::class],
BookmarkRepository::class => [
'class' => BookmarkRepository::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
Console::class => [
'class' => Console::class,
'arguments' => [Relation::class, Template::class, BookmarkRepository::class, History::class],
],
TableMover::class => ['class' => TableMover::class, 'arguments' => [DatabaseInterface::class, Relation::class]],
History::class => [
'class' => History::class,
'arguments' => [DatabaseInterface::class, Relation::class, Config::class],
],
UserPreferencesHandler::class => [
'class' => UserPreferencesHandler::class,
'arguments' => [
Config::class,
DatabaseInterface::class,
UserPreferences::class,
LanguageManager::class,
ThemeManager::class,
],
],
LanguageManager::class => ['class' => LanguageManager::class, 'factory' => [LanguageManager::class, 'getInstance']],
ClockInterface::class => ['class' => Clock::class],
Footer::class => ['class' => Footer::class, 'arguments' => [Template::class, Config::class]],
UrlRedirector::class => [
'class' => UrlRedirector::class,
'arguments' => [ResponseRenderer::class, Template::class, ResponseFactory::class],
],
];

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +0,0 @@
<?php
declare(strict_types=1);
use PhpMyAdmin\Container\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $configurator): void {
$services = $configurator->services();
/** @var array<string, array{class: string, arguments?: array<string>, factory?: callable}> $servicesFile */
$servicesFile = include ROOT_PATH . 'app/services.php';
ContainerBuilder::loadServices($servicesFile, $services);
/** @var array<string, array{class: string, arguments?: array<string>, factory?: callable}> $servicesFile */
$servicesFile = include ROOT_PATH . 'app/services_controllers.php';
ContainerBuilder::loadServices($servicesFile, $services);
};

View File

@ -1,73 +0,0 @@
<?php
/**
* File for vendor customization, you can change here paths or some behaviour,
* which vendors such as Linux distributions might want to change.
*
* For changing this file you should know what you are doing. For this reason
* options here are not part of normal configuration.
*/
declare(strict_types=1);
return [
/**
* Path to vendor autoload file. Useful when you want to have vendor dependencies somewhere else.
*/
'autoloadFile' => ROOT_PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php',
/**
* Directory where cache files are stored.
*/
'tempDir' => ROOT_PATH . 'tmp' . DIRECTORY_SEPARATOR,
/**
* Path to changelog file, can be gzip compressed.
* Useful when you want to have documentation somewhere else, e.g. /usr/share/doc.
*/
'changeLogFile' => ROOT_PATH . 'CHANGELOG-6.0.md',
/**
* Path to license file. Useful when you want to have documentation somewhere else, e.g. /usr/share/doc.
*/
'licenseFile' => ROOT_PATH . 'LICENSE',
/**
* Directory where SQL scripts to create/upgrade configuration storage reside.
*/
'sqlDir' => ROOT_PATH . 'resources' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR,
/**
* Filename of a configuration file.
*/
'configFile' => ROOT_PATH . 'config.inc.php',
/**
* Filename of custom header file.
*/
'customHeaderFile' => ROOT_PATH . 'config.header.inc.php',
/**
* Filename of custom footer file.
*/
'customFooterFile' => ROOT_PATH . 'config.footer.inc.php',
/**
* Default value for check for version upgrades.
*/
'versionCheckDefault' => true,
/**
* Path to files with compiled locales (*.mo)
*/
'localePath' => ROOT_PATH . 'resources' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR,
/**
* Define the cache directory for routing cache and other cache files
*/
'cacheDir' => ROOT_PATH . 'app' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
/**
* Suffix to add to the phpMyAdmin version
*/
'versionSuffix' => '',
];

View File

@ -1,13 +0,0 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-typescript"
]
}

View File

@ -1,43 +0,0 @@
#!/usr/bin/env php
<?php
use PhpMyAdmin\Command\CacheWarmupCommand;
use PhpMyAdmin\Command\FixPoTwigCommand;
use PhpMyAdmin\Command\SetVersionCommand;
use PhpMyAdmin\Command\TwigLintCommand;
use PhpMyAdmin\Command\WriteGitRevisionCommand;
use PhpMyAdmin\Config;
use PhpMyAdmin\Container\ContainerBuilder;
use PhpMyAdmin\Dbal\DatabaseInterface;
use PhpMyAdmin\Tests\Stubs\DbiDummy;
use Symfony\Component\Console\Application;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'app/constants.php';
require_once AUTOLOAD_FILE;
if (! class_exists(Application::class)) {
echo 'Be sure to have dev-dependencies installed.' . PHP_EOL;
echo 'Command aborted.' . PHP_EOL;
exit(1);
}
$containerBuilder = ContainerBuilder::getContainer();
$cfg['environment'] = 'production';
$config = new Config();
$config->loadFromFile(CONFIG_FILE);
$config->set('environment', $cfg['environment']);
$dbi = DatabaseInterface::getInstanceForTest(new DbiDummy());
$application = new Application('phpMyAdmin Console Tool');
$application->add(new CacheWarmupCommand());
$application->add(new TwigLintCommand());
$application->add(new SetVersionCommand());
$application->add(new WriteGitRevisionCommand());
$application->add(new FixPoTwigCommand());
$application->run();

View File

@ -1,40 +0,0 @@
#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ "$1" = --quiet ] ; then
stats=""
shift
else
stats="--statistics"
fi
compile() {
lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
if [ -n "$stats" ] ; then
printf "%s: " "$lang"
fi
mkdir -p resources/locale/"$lang"/LC_MESSAGES
msgfmt $stats --check -o resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo "$1"
return $?
}
if [ -n "$1" ] ; then
compile resources/po/"$1".po
exit $?
fi
result=0
for x in resources/po/*.po ; do
compile "$x"
ret=$?
if [ $ret != 0 ] ; then
echo Error when compiling "$x" >&2
result=$ret
fi
done
exit $result

View File

@ -1,358 +0,0 @@
#!/bin/bash
set -e
FILE="$1"
if [ ! -f "${FILE}" ]; then
echo 'Please provide a file as a first argument.'
exit 1
fi
FILE_LIST="$(tar --list --file="${FILE}")"
found=0;
echo 'Searching for files'
foundFile() {
found=1
printf "Found: %s\n" "${filePath}"
}
foundFileExt() {
found=1
printf "Found unexpected file: %s with extension %s\n" "${pathWithoutFirst}" "${extension}"
}
validateExtension() {
if [ "${filePath: -1}" = "/" ]; then
return;
fi
pathWithoutFirst="$(echo "$filePath" | cut -d / -f 2-)"
filename=$(basename -- "$pathWithoutFirst")
extension="${filename##*.}"
case $pathWithoutFirst in
public/docs/*)
if [ "${extension}" != "png" ] && [ "${extension}" != "txt" ] &&
[ "${extension}" != "html" ] && [ "${extension}" != "js" ] &&
[ "${extension}" != "css" ] && [ "${extension}" != "gif" ]; then
foundFileExt
fi
;;
resources/js/global.d.ts)
;;
public/js/vendor/*)
if [ "${extension}" != "js" ] && [ "${extension}" != "map" ] &&
[ "${extension}" != "css" ] && [ "${filename}" != "LICENSE" ] &&
[ "${extension}" != "txt" ]; then
foundFileExt
fi
;;
public/js/*)
if [ "${extension}" != "js" ] && [ "${extension}" != "map" ]; then
foundFileExt
fi
;;
resources/js/*)
if [ "${extension}" != "ts" ]; then
foundFileExt
fi
;;
resources/sql/*)
if [ "${extension}" != "sql" ]; then
foundFileExt
fi
;;
examples/*)
if [ "${extension}" != "php" ]; then
foundFileExt
fi
;;
resources/locale/*)
if [ "${extension}" != "mo" ]; then
foundFileExt
fi
;;
public/setup/*)
if [ "${extension}" != "php" ] && [ "${extension}" != "twig" ] &&
[ "${extension}" != "css" ] && [ "${extension}" != "scss" ] &&
[ "${extension}" != "gif" ] && [ "${extension}" != "map" ]; then
foundFileExt
fi
;;
resources/templates/*)
if [ "${extension}" != "twig" ]; then
foundFileExt
fi
;;
app/*)
if [ "${extension}" != "php" ]; then
foundFileExt
fi
;;
src/*)
if [ "${extension}" != "php" ] && [ "${extension}" != "md" ] &&
[ "${filename}" != "README" ] && [ "${filename}" != "TEMPLATE" ] &&
[ "${filename}" != "TEMPLATE_ABSTRACT" ]; then
foundFileExt
fi
;;
public/themes/*)
if [ "${extension}" != "css" ] && [ "${extension}" != "png" ] &&
[ "${extension}" != "scss" ] && [ "${extension}" != "map" ] &&
[ "${extension}" != "svg" ] && [ "${extension}" != "ico" ] &&
[ "${extension}" != "gif" ] && [ "${extension}" != "json" ]; then
foundFileExt
fi
;;
vendor/phpmyadmin/sql-parser/locale/*)
if [ "${extension}" != "mo" ]; then
foundFileExt
fi
;;
vendor/composer/ca-bundle/res/cacert.pem)
;;
vendor/pragmarx/google2fa-qrcode/composer.lock)
;;
vendor/williamdes/mariadb-mysql-kbs/cliff.toml)
;;
vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.json)
;;
vendor/composer/installed.json)
;;
vendor/tecnickcom/tcpdf/*)
if [ "${extension}" != "php" ] && [ "${filename}" != "LICENSE.TXT" ] &&
[ "${filename}" != "README.md" ] && [ "${filename}" != "CHANGELOG.TXT" ] &&
[ "${filename}" != "VERSION" ] && [ "${filename}" != "composer.json" ] &&
[ "${extension}" != "z" ]; then
foundFileExt
fi
;;
vendor/*)
if [ "${extension}" != "php" ] && [ "${filename}" != "LICENSE" ] &&
[ "${filename}" != "README" ] && [ "${filename}" != "CHANGELOG" ] &&
[ "${filename}" != "composer.json" ] && [ "${filename}" != "CHANGELOG.md" ] &&
[ "${filename}" != "README.md" ] && [ "${filename}" != "BACKERS.md" ] &&
[ "${filename}" != "LICENSE.md" ] && [ "${filename}" != "ARCHITECTURE.md" ] &&
[ "${filename}" != "LICENSE.txt" ] && [ "${filename}" != "AUTHORS" ] &&
[ "${filename}" != "LICENCE.md" ] && [ "${filename}" != "LICENCE" ] &&
[ "${filename}" != "COPYRIGHT.md" ]; then
foundFileExt
fi
;;
CHANGELOG-[5-9].[0-9].md)
;;
LICENSE)
;;
RELEASE-DATE-[1-9].[0-9].[0-9])
;;
RELEASE-DATE-[1-9].[0-9].[0-9]-dev)
;;
RELEASE-DATE-[1-9].[0-9]+snapshot)
;;
CONTRIBUTING.md)
;;
README)
;;
public/favicon.ico)
;;
tsconfig.json)
;;
webpack.config.cjs)
;;
babel.config.json)
;;
package.json)
;;
composer.json)
;;
composer.lock)
;;
yarn.lock)
;;
public/robots.txt)
;;
index.php)
;;
public/index.php)
;;
config.sample.inc.php)
;;
*)
foundFileExt
;;
esac
}
for filePath in ${FILE_LIST}; do
validateExtension
case $filePath in
*/composer-require-checker.json)
foundFile;;
*/CLAUDE.MD)
foundFile;;
*/Readme.php)
foundFile;;
*/rector*.php)
foundFile;;
*/.editorconfig)
foundFile;;
*/easy-coding-standard.neon)
foundFile;;
*/.travis.yml)
foundFile;;
*/psalm.xml.dist)
foundFile;;
*/phpdoc.xml)
foundFile;;
*/phpdoc.dist.xml)
foundFile;;
*/.coveralls.yml)
foundFile;;
*/.yamllint.yaml)
foundFile;;
*/appveyor.yml)
foundFile;;
*/phpunit.xml)
foundFile;;
*/phpunit.xml.dist)
foundFile;;
*/phive.xml)
foundFile;;
*/Makefile)
foundFile;;
*/splitsh.json)
foundFile;;
*/phpbench.json)
foundFile;;
*/phpbench.json.dist)
foundFile;;
*/.php-cs-fixer.dist.php)
foundFile;;
*/.php_cs)
foundFile;;
*/.php_cs.dist)
foundFile;;
*/.php_cs.cache)
foundFile;;
*/.php-cs-fixer.php)
foundFile;;
*/psalm.xml)
foundFile;;
*/phpcs.xml)
foundFile;;
*/phpcs.xml.dist)
foundFile;;
*/ecs.php)
foundFile;;
*/.scrutinizer.yml)
foundFile;;
*/.phpstorm.meta.php)
foundFile;;
*/codecov.yml)
foundFile;;
*/.gitattributes)
foundFile;;
*/.gitignore)
foundFile;;
*/.gitkeep)
foundFile;;
*/.mailmap)
foundFile;;
*/.env)
foundFile;;
*/infection.json.dist)
foundFile;;
*/infection.json)
foundFile;;
*/infection.json5.dist)
foundFile;;
*/infection.json5)
foundFile;;
*/makefile)
foundFile;;
*/.phpunit.result.cache)
foundFile;;
*/phpstan.neon)
foundFile;;
*/phpstan.neon.dist)
foundFile;;
*/phpstan-baseline.neon)
foundFile;;
*/phpmd.xml.dist)
foundFile;;
*/.travis.php.ini)
foundFile;;
*/vendor/*/tests/*)
foundFile;;
*/vendor/*/Tests/*)
foundFile;;
*/vendor/*/test/*)
foundFile;;
*/twig/twig/lib/Twig/Node/Expression/Test/*)
;;
*/twig/twig/lib/Twig/Test/*)
;;
*twig/twig/src/Node/Expression/Test/*)
;;
*/vendor/*/Test/*)
foundFile;;
*/.dependabot/*)
foundFile;;
*/.github/*)
foundFile;;
*/.circleci/*)
foundFile;;
*/vendor/examples/*)
foundFile;;
*/.git/*)
foundFile;;
*vendor/*.rst)
foundFile;;
*vendor/*.po)
foundFile;;
*vendor/*.pot)
foundFile;;
*vendor/*.m4)
foundFile;;
*vendor/*.c)
foundFile;;
*vendor/*.h)
foundFile;;
*vendor/*.sh)
foundFile;;
*vendor/*.w32)
foundFile;;
*.hhconfig)
foundFile;;
*.hhi)
foundFile;;
*.xsd)
foundFile;;
*.xml)
foundFile;;
*vendor/*CONTRIBUTING.md*)
foundFile;;
*CODE_OF_CONDUCT.md*)
foundFile;;
*PERFORMANCE.md*)
foundFile;;
*phar*)
foundFile;;
*) ;;
esac
done
if [ ${found} -gt 0 ]; then
echo 'Some new files to be excluded were found.'
echo 'Please update create-release.sh'
exit 1
else
echo 'Everything looks okay'
exit 0
fi

View File

@ -1,755 +0,0 @@
#!/bin/sh
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# More documentation about making a release is available at:
# https://wiki.phpmyadmin.net/pma/Releasing
# Fail on undefined variables
set -u
# Fail on failure
set -e
KITS="all-languages english source"
COMPRESSIONS="zip-7z txz tgz"
# The version series this script is allowed to handle
VERSION_SERIES="6.0"
# Process parameters
version=""
branch=""
do_tag=0
do_stable=0
do_test=0
do_ci=0
do_sign=1
do_pull=0
do_daily=0
do_revision=0
while [ $# -gt 0 ] ; do
case "$1" in
--tag)
do_tag=1
;;
--stable)
do_stable=1
;;
--test)
do_test=1
;;
--revision-info)
do_revision=1
;;
--daily)
do_sign=0
do_pull=1
do_daily=1
do_test=1
;;
--ci)
do_test=1
do_ci=1
if [ -z "$branch" ] ; then
git branch ci
branch="ci"
fi
;;
--no-sign)
do_sign=0
;;
--kits)
KITS="$2"
# Skip one position, the value
shift
;;
--compressions)
COMPRESSIONS="$2"
# Skip one position, the value
shift
;;
--help)
echo "Usages:"
echo " create-release.sh <version> <from_branch> [--tag] [--stable] [--test] [--ci] [--daily] [--revision-info] [--compressions] [--kits] [--no-sign]"
echo ""
echo "If --tag is specified, release tag is automatically created (use this for all releases including pre-releases)"
echo "If --stable is specified, the STABLE branch is updated with this release"
echo "If --test is specified, the testsuite is executed before creating the release"
echo "If --ci is specified, the testsuite is executed and no actual release is created"
echo "If --no-sign is specified, the output files will not be signed"
echo "If --daily is specified, the output files will have snapshot information"
echo "If --revision-info is specified, the output files will contain git revision info"
echo "If --compressions is specified, it changes the compressions available. Space separated values. Valid values: $COMPRESSIONS"
echo "If --kits is specified, it changes the kits to be built. Space separated values. Valid values: $KITS"
echo ""
echo "Examples:"
echo " create-release.sh 5.2.2-dev QA_5_2"
echo " create-release.sh 5.2.2 QA_5_2 --tag --stable"
exit 65
;;
*)
do_test=1
if [ -z "$version" ] ; then
version=$(echo "$1" | tr -d -c '0-9a-z.+-')
if [ "x$version" != "x$1" ] ; then
echo "Invalid version: $1"
exit 1
fi
elif [ -z "$branch" ] ; then
branch=$(echo "$1" | tr -d -c '/0-9A-Za-z_-')
if [ "x$branch" != "x$1" ] ; then
echo "Invalid branch: $1"
exit 1
fi
else
echo "Unknown parameter: $1!"
echo "Use --help to check the syntax."
exit 1
fi
esac
shift
done
if [ -z "$version" ] && [ $do_ci -eq 0 ]; then
echo "Version must be specified!"
exit 1
fi
if [ -z "$branch" ]; then
echo "Branch must be specified!"
exit 1
fi
kit_prefix="phpMyAdmin-$version"
# Checks whether remote branch has local tracking branch
ensure_local_branch() {
if ! git branch | grep -q '^..'"$1"'$' ; then
git branch --track "$1" origin/"$1"
fi
}
# Marks current head of given branch as head of other branch
# Used for STABLE tracking
mark_as_release() {
branch=$1
rel_branch=$2
echo "* Marking release as $rel_branch"
ensure_local_branch "$rel_branch"
git checkout "$rel_branch"
git merge -s recursive -X theirs "$branch"
git checkout master
}
cleanup_composer_vendors() {
echo "* Cleanup of composer packages"
rm -r \
vendor/phpmyadmin/sql-parser/tests/ \
vendor/phpmyadmin/sql-parser/src/Tools/ \
vendor/phpmyadmin/sql-parser/locale/sqlparser.pot \
vendor/phpmyadmin/sql-parser/locale/*/LC_MESSAGES/sqlparser.po \
vendor/phpmyadmin/sql-parser/bin/ \
vendor/phpmyadmin/sql-parser/phpunit.xml.dist \
vendor/phpmyadmin/motranslator/phpunit.xml.dist \
vendor/phpmyadmin/motranslator/psalm-baseline.xml \
vendor/phpmyadmin/motranslator/psalm.xml \
vendor/phpmyadmin/motranslator/tests/ \
vendor/phpmyadmin/shapefile/phpunit.xml.dist \
vendor/phpmyadmin/shapefile/tests/ \
vendor/phpmyadmin/shapefile/examples/ \
vendor/phpmyadmin/shapefile/data/ \
vendor/symfony/service-contracts/Test/ \
vendor/symfony/expression-language/Resources/ \
vendor/symfony/dependency-injection/Loader/schema/services.schema.json \
vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.xsd \
vendor/tecnickcom/tcpdf/tools/ \
vendor/tecnickcom/tcpdf/fonts/ae_fonts_*/ \
vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.*/ \
vendor/tecnickcom/tcpdf/fonts/freefont-*/ \
vendor/tecnickcom/tcpdf/include/sRGB.icc \
vendor/williamdes/mariadb-mysql-kbs/schemas/ \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.json \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-raw.md \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-slim.json \
vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.php \
vendor/google/recaptcha/app.yaml \
vendor/laminas/laminas-httphandlerrunner/.laminas-ci.json \
vendor/nikic/fast-route/.travis.yml \
vendor/nikic/fast-route/.hhconfig \
vendor/nikic/fast-route/FastRoute.hhi \
vendor/nikic/fast-route/phpunit.xml \
vendor/nikic/fast-route/psalm.xml \
vendor/nikic/fast-route/test/ \
vendor/twig/twig/README.rst \
vendor/webmozart/assert/.php-cs-fixer.php \
vendor/twig/twig/src/Test/ \
vendor/psr/event-dispatcher/.editorconfig \
vendor/psr/http-message/docs/ \
vendor/pragmarx/google2fa/.github/ \
vendor/pragmarx/google2fa-qrcode/.scrutinizer.yml \
vendor/pragmarx/google2fa-qrcode/.travis.yml \
vendor/pragmarx/google2fa-qrcode/phpunit.xml \
vendor/pragmarx/google2fa-qrcode/tests \
vendor/slim/psr7/phpunit.xml.dist \
vendor/slim/psr7/tests/
rm \
vendor/phpmyadmin/motranslator/CODE_OF_CONDUCT.md \
vendor/phpmyadmin/motranslator/CONTRIBUTING.md \
vendor/phpmyadmin/motranslator/PERFORMANCE.md \
vendor/phpmyadmin/shapefile/CONTRIBUTING.md \
vendor/spomky-labs/cbor-php/CODE_OF_CONDUCT.md \
vendor/spomky-labs/cbor-php/RELEASES.md \
vendor/spomky-labs/cbor-php/SECURITY.md \
vendor/spomky-labs/pki-framework/SECURITY.md \
vendor/web-auth/cose-lib/CODE_OF_CONDUCT.md \
vendor/web-auth/cose-lib/RELEASES.md \
vendor/web-auth/cose-lib/SECURITY.md
find vendor/tecnickcom/tcpdf/fonts/ -maxdepth 1 -type f \
-not -name 'dejavusans.*' \
-not -name 'dejavusansb.*' \
-not -name 'helvetica.php' \
-print0 | xargs -0 rm
}
backup_vendor_folder() {
TEMP_FOLDER="$(mktemp -d /tmp/phpMyAdmin.XXXXXXXXX)"
cp -rp ./vendor "${TEMP_FOLDER}"
}
restore_vendor_folder() {
if [ ! -d "${TEMP_FOLDER}" ]; then
echo 'No backup to restore'
exit 1;
fi
rm -r ./vendor
mv "${TEMP_FOLDER}/vendor" ./vendor
rmdir "${TEMP_FOLDER}"
}
get_composer_package_version() {
awk '/require-dev/ {printline = 1; print; next } printline' composer.json | grep "$1" | awk -F [\"] '{print $4}'
}
create_phpunit_sandbox() {
PHPUNIT_VERSION="$(get_composer_package_version 'phpunit/phpunit')"
TEMP_PHPUNIT_FOLDER="$(mktemp -d /tmp/phpMyAdmin-phpunit.XXXXXXXXX)"
cd "${TEMP_PHPUNIT_FOLDER}"
composer require --no-interaction --dev "phpunit/phpunit:${PHPUNIT_VERSION}"
cd -
}
delete_phpunit_sandbox() {
if [ ! -d "${TEMP_PHPUNIT_FOLDER}" ]; then
echo 'No phpunit sandbox to delete'
exit 1;
fi
rm -r "${TEMP_PHPUNIT_FOLDER}"
}
security_checkup() {
if [ ! -f vendor/tecnickcom/tcpdf/tcpdf.php ]; then
echo 'TCPDF should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/web-auth/webauthn-lib/src/PublicKeyCredential.php ]; then
echo 'Webauthn-lib should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/code-lts/u2f-php-server/src/U2FServer.php ]; then
echo 'U2F-server should be installed, detection failed !'
exit 1;
fi
if [ ! -f vendor/pragmarx/google2fa-qrcode/src/Google2FA.php ]; then
echo 'Google 2FA should be installed, detection failed !'
exit 1;
fi
}
autoload_checkup() {
php <<'CODE'
<?php
$classMapFiles = require __DIR__ . '/vendor/composer/autoload_classmap.php';
$foundFiles = 0;
$notFoundFiles = 0;
foreach ($classMapFiles as $classMapFile) {
if (! file_exists($classMapFile)) {
echo 'Does not exist: ' . $classMapFile . PHP_EOL;
$notFoundFiles++;
continue;
}
$foundFiles++;
}
echo '[autoload class map checkup] Found files: ' . $foundFiles . PHP_EOL;
echo '[autoload class map checkup] NOT found files: ' . $notFoundFiles . PHP_EOL;
$minFilesToHave = 1100;// An arbitrary value based on how many files the autoload has on average
if ($foundFiles < $minFilesToHave) {
echo '[autoload class map checkup] The project expects at least ' . $minFilesToHave . ' in the autoload class map' . PHP_EOL;
exit(1);
}
if ($notFoundFiles > 0) {
echo '[autoload class map checkup] There is some missing files documented in the class map' . PHP_EOL;
exit(1);
}
echo '[autoload class map checkup] The autoload class map seems okay' . PHP_EOL;
CODE
}
# Ensure we have tracking branch
ensure_local_branch "$branch"
VERSION_FILE=src/Version.php
# Keep in sync with update-po script
fetchReleaseFromFile() {
SUFFIX="${1:-}"
php -r "define('VERSION_SUFFIX', '$SUFFIX'); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::VERSION;"
}
fetchVersionSeriesFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::SERIES;"
}
VERSION_FROM_FILE="$(fetchReleaseFromFile)"
VERSION_SERIES_FROM_FILE="$(fetchVersionSeriesFromFile)"
if [ $do_ci -eq 1 ]; then
VERSION_FROM_FILE="$(fetchReleaseFromFile '+ci')"
version="${VERSION_FROM_FILE}"
fi
if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then
echo "This script can not handle ${VERSION_SERIES_FROM_FILE} version series."
echo "Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch."
echo "By changing branches you will have a release script that was designed for your version series."
exit 1;
fi
echo "The actual configured release is: $VERSION_FROM_FILE"
echo "The actual configured release series is: $VERSION_SERIES_FROM_FILE"
if [ $do_ci -eq 0 ] && [ $do_daily -eq 0 ] ; then
cat <<END
Please ensure you have incremented rc count or version in the repository :
- run ./bin/console set-version $version
- in $VERSION_FILE Version class:
- check that VERSION, MAJOR, MINOR and PATCH are correct.
- in docs/conf.py the line
" version = '$version' "
- in README the "Version" line
- in package.json the line
" "version": "$version", "
- set release date in ChangeLog
Continue (y/n)?
END
read -r do_release
if [ "$do_release" != 'y' ]; then
exit 100
fi
echo "The actual configured release is now: $(fetchReleaseFromFile)"
fi
# Create working copy
mkdir -p release
git worktree prune
workdir_name=phpMyAdmin-$version
workdir=release/$workdir_name
if [ -d "$workdir" ] ; then
echo "Working directory '$workdir' already exists, please move it out of the way"
exit 1
fi
# Add worktree with chosen branch
git worktree add --force "$workdir" "$branch"
cd "$workdir"
if [ $do_pull -eq 1 ] ; then
git pull -q
fi
if [ $do_daily -eq 1 ] ; then
git_head=$(git log -n 1 --format=%H)
git_head_short=$(git log -n 1 --format=%h)
today_date=$(date +'%Y%m%d' -u)
fi
if [ $do_daily -eq 1 ] ; then
echo '* setting the version suffix for the snapshot'
sed -i "s/'versionSuffix' => '.*'/'versionSuffix' => '+$today_date.$git_head_short'/" app/vendor_config.php
php -l app/vendor_config.php
# Fetch it back and refresh $version
VERSION_FROM_FILE="$(fetchReleaseFromFile "+$today_date.$git_head_short")"
version="${VERSION_FROM_FILE}"
echo "The actual configured release is: $VERSION_FROM_FILE"
fi
# Check release version
if [ $do_ci -eq 0 ] && [ -$do_daily -eq 0 ] ; then
if ! grep -q "VERSION = '$version'" $VERSION_FILE ; then
echo "There seems to be wrong version in $VERSION_FILE!"
exit 2
fi
if ! grep -q "version = '$version'" docs/conf.py ; then
echo "There seems to be wrong version in docs/conf.py"
exit 2
fi
if ! grep -q "Version $version\$" README ; then
echo "There seems to be wrong version in README"
exit 2
fi
if ! grep -q "\"version\": \"$version\"," package.json ; then
echo "There seems to be wrong version in package.json"
exit 2
fi
fi
# Save the build date
if [ $do_daily -eq 1 ] ; then
LC_ALL=C date -u > RELEASE-DATE-"$VERSION_SERIES_FROM_FILE"+snapshot
else
LC_ALL=C date -u > RELEASE-DATE-"$version"
fi
# Building documentation
echo "* Running sphinx-build (version: $(sphinx-build --version))"
echo "* Generating documentation"
LC_ALL=C make -C docs html
find docs -name '*.pyc' -print0 | xargs -0 -r rm -f
# Check for gettext support
if [ -d resources/po ] ; then
echo "* Generating mo files"
./bin/generate-mo
if [ -f ./bin/remove-incomplete-mo ] ; then
echo "* Removing incomplete translations"
./bin/remove-incomplete-mo
fi
fi
if [ -f ./bin/line-counts.sh ] ; then
echo "* Generating line counts"
./bin/line-counts.sh
fi
echo "* Removing unneeded files"
# Remove developer information
rm -r .github CODE_OF_CONDUCT.md DCO
# Testsuite setup
rm .scrutinizer.yml .weblate codecov.yml
# Remove Doctum config file
rm tests/doctum-config.php
# Remove readme for github
rm README.rst
if [ -f ./bin/console ]; then
# Update the vendors to have the dev vendors
composer install --no-interaction
# Warm up the routing cache for 5.1+ releases
./bin/console cache:warmup --routing
if [ $do_revision -eq 1 ] ; then
./bin/console write-revision-info
fi
fi
echo "* Writing the version to composer.json (version: $version)"
composer config version "$version"
# Okay, there is no way to tell composer to install
# suggested package. Let's require it and then revert
# composer.json to original state.
cp composer.json composer.json.backup
COMPOSER_VERSION="$(composer --version)"
echo "* Running composer (version: $COMPOSER_VERSION)"
composer install --no-interaction --no-dev
# Parse the required versions from composer.json
PACKAGE_LIST='tecnickcom/tcpdf pragmarx/google2fa-qrcode bacon/bacon-qr-code code-lts/u2f-php-server web-auth/webauthn-lib'
set --
for PACKAGES in $PACKAGE_LIST
do
PKG_VERSION="$(get_composer_package_version "$PACKAGES")"
set -- "$@" "$PACKAGES:$PKG_VERSION"
done
echo "* Installing composer packages '$*'"
# Allows word splitting
# shellcheck disable=SC2086
composer require --no-interaction --update-no-dev "$@"
echo "* Running a security checkup"
security_checkup
echo "* Cleaning up vendor folders"
mv composer.json.backup composer.json
cleanup_composer_vendors
echo "* Re-generating the autoload class map"
# https://getcomposer.org/doc/articles/autoloader-optimization.md#what-does-it-do-
# We removed some files, we also need that composer removes them from autoload class maps
# If the class is in the class map (as explained in the link above) then it is assumed to exist as a file
composer dump-autoload --no-interaction --optimize --dev
echo "* Running an autoload checkup"
autoload_checkup
echo "* Running a security checkup"
security_checkup
if [ -f package.json ] ; then
echo "* Running Yarn"
yarn install --production
fi
# Remove git metadata
rm .git
find . -name .gitignore -print0 | xargs -0 -r rm
find . -name .gitkeep -print0 | xargs -0 -r rm
find . -name .gitattributes -print0 | xargs -0 -r rm
if [ $do_test -eq 1 ] ; then
# Move the folder out and install dev vendors
create_phpunit_sandbox
# Backup the files because the new autoloader will change the composer vendor
backup_vendor_folder
# Generate an autoload for test class files (and include dev namespaces)
composer dump-autoload --dev || php -r "echo 'Requires: composer >= v2.1.2' . PHP_EOL; exit(1);"
"${TEMP_PHPUNIT_FOLDER}/vendor/bin/phpunit" --no-coverage --testsuite unit
test_ret=$?
if [ $do_ci -eq 1 ] ; then
cd ../..
rm -r "$workdir"
git worktree prune
if [ "$branch" = "ci" ] ; then
git branch -D ci
fi
exit $test_ret
fi
if [ $test_ret -ne 0 ] ; then
exit $test_ret
fi
# Remove PHPUnit cache file
rm -f .phpunit.result.cache
# Generate an normal autoload (this is just a security, because normally the vendor folder will be restored)
composer dump-autoload
# Remove libs installed for testing
rm -r build
delete_phpunit_sandbox
restore_vendor_folder
fi
security_checkup
cd ..
SIGN_FILES=""
# Prepare all kits
for kit in $KITS ; do
echo "* Building kit: $kit"
# Copy all files
name=$kit_prefix-$kit
cp -r "$workdir_name" "$name"
# Cleanup translations
cd "$name"
./bin/internal/lang-cleanup.sh "$kit"
# Remove tests, source code,...
if [ "$kit" != source ] ; then
echo "* Removing source files"
# Testsuite
rm -r tests/
# Template test files
rm -r resources/templates/test/
rm phpunit.xml.*
rm .editorconfig .browserslistrc .eslintignore .jshintrc .eslintrc.json .stylelintrc.json psalm.xml psalm-baseline.xml phpstan.neon.dist phpstan-baseline.neon phpcs.xml.dist jest.config.cjs infection.json5.dist .phpstorm.meta.php
# Gettext po files (if they were not removed by ./bin/internal/lang-cleanup.sh)
rm -rf resources/po
# Documentation source code
mv docs/html htmldoc
rm -r docs
mkdir public/docs
mv htmldoc public/docs/html
rm public/docs/html/.buildinfo public/docs/html/objects.inv
rm -r node_modules
# Remove bin files for non source version
# https://github.com/phpmyadmin/phpmyadmin/issues/16033
rm -r vendor/bin
# Remove developer scripts
rm -r bin
fi
# Remove possible tmp folder
rm -rf tmp
cd ..
# Remove tar file possibly left from previous run
rm -f "$name".tar
# Prepare distributions
for comp in $COMPRESSIONS ; do
case $comp in
tbz|tgz|txz)
if [ ! -f "$name".tar ] ; then
echo "* Creating $name.tar"
tar --owner=root --group=root --numeric-owner --sort=name -cf "$name".tar "$name"
fi
if [ "$comp" = txz ] ; then
echo "* Creating $name.tar.xz"
xz -9k "$name".tar
SIGN_FILES="$SIGN_FILES $name.tar.xz"
fi
if [ "$comp" = tgz ] ; then
echo "* Creating $name.tar.gz"
gzip -9c "$name".tar > "$name".tar.gz
SIGN_FILES="$SIGN_FILES $name.tar.gz"
fi
;;
zip-7z)
echo "* Creating $name.zip"
7za a -bd -tzip "$name".zip "$name" > /dev/null
SIGN_FILES="$SIGN_FILES $name.zip"
;;
*)
echo "WARNING: ignoring compression '$comp', not known!"
;;
esac
done
# Cleanup
rm -f "$name".tar
# Remove directory with current dist set
rm -r "$name"
done
# Cleanup
rm -r "$workdir_name"
git worktree prune
# Signing of files with default GPG key
if [ $do_sign -eq 1 ] ; then
echo "* Signing and making .sha{1,256} files"
else
echo "* Making .sha{1,256} files"
fi
for file in $SIGN_FILES; do
if [ $do_sign -eq 1 ] ; then
gpg --detach-sign --armor "$file"
fi
sha1sum "$file" > "$file".sha1
sha256sum "$file" > "$file".sha256
done
if [ $do_daily -eq 1 ] ; then
cat > "$kit_prefix".json << EOT
{
"date": "$(date --iso-8601=seconds)",
"commit": "$git_head"
}
EOT
exit 0
fi
echo ""
echo ""
echo ""
echo "Files:"
echo "------"
ls -la $SIGN_FILES
cd ..
# Tag as release
if [ $do_tag -eq 1 ] ; then
echo
echo "Additional tasks:"
tagname=RELEASE_$(echo "$version" | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -)
echo "* Tagging release as $tagname"
git tag -s -a -m "Released $version" "$tagname" "$branch"
echo " Dont forget to push tags using: git push --tags"
fi
# Mark as stable release
if [ $do_stable -eq 1 ] ; then
mark_as_release "$branch" STABLE
fi
cat <<END
Todo now:
---------
1. Push the new tag upstream, with a command like git push origin --tags
2. Push the new STABLE branch upstream
3. prepare a release/phpMyAdmin-$version-notes.html explaining in short the goal of
this release and paste into it the ChangeLog for this release, followed
by the notes of all previous incremental versions (i.e. 4.4.9 through 4.4.0)
4. upload the files to our file server, use bin/internal/upload-release, eg.:
./bin/internal/upload-release $version release
5. add a news item to our website; a good idea is to include a link to the release notes such as https://www.phpmyadmin.net/files/4.4.10/
6. send a short mail (with list of major changes) to
developers@phpmyadmin.net
news@phpmyadmin.net
Don't forget to update the Description section in the announcement,
based on documentation.
7. increment rc count or version in the repository :
- run ./bin/console set-version $version
- in $VERSION_FILE Version class:
- check that VERSION, MAJOR, MINOR and PATCH are correct.
- in README the "Version" line
" Version 2.7.1-dev "
- in package.json the line
" "version": " 2.7.1-dev", "
- in docs/conf.py (if it exists) the line
" version = '2.7.1-dev' "
8. on https://github.com/phpmyadmin/phpmyadmin/milestones close the milestone corresponding to the released version (if this is a stable release) and open a new one for the next minor release
9. for a major release, update demo/php/versions.ini in the scripts repository so that the demo server shows current versions
10. in case of a new major release ('y' in x.y.0), update the pmaweb/settings.py in website repository to include the new major releases
11. update the Dockerfile in the docker repository to reflect the new version and create a new annotated tag (such as with git tag -s -a 4.7.9-1 -m "Version 4.7.9-1"). Remember to push the tag with git push origin {tagName}
END

View File

@ -1,52 +0,0 @@
#!/bin/sh
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# Script for removing language selection from phpMyAdmin
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ $# -lt 1 ] ; then
echo "Usage: lang-cleanup.sh type"
echo "Type can be one of:"
echo " all-languages - nothing will be done"
echo " source - nothing will be done"
echo " english - no translations will be kept"
echo " langcode - keeps language"
echo
echo "Languages can be specified multiple times"
exit 1
fi
# Expression for find
match=""
for type in "$@" ; do
case $type in
all-languages|source)
exit 0
;;
english)
rm -rf resources/po
rm -rf resources/locale
rm -rf vendor/phpmyadmin/sql-parser/locale
exit 0
;;
*)
match="$match -and -not -name $type.po -and -not -path resources/locale/$type/LC_MESSAGES/phpmyadmin.mo -and -not -path vendor/phpmyadmin/sql-parser/locale/$type/LC_MESSAGES/sqlparser.mo"
;;
esac
done
# Delete unwanted languages
# shellcheck disable=SC2086
find resources/po resources/locale vendor/phpmyadmin/sql-parser/locale -type f $match -print0 | xargs -0r rm
# Delete empty directories
rmdir --ignore-fail-on-non-empty resources/locale/*/*
rmdir --ignore-fail-on-non-empty resources/locale/*
rmdir --ignore-fail-on-non-empty vendor/phpmyadmin/sql-parser/locale/*/*
rmdir --ignore-fail-on-non-empty vendor/phpmyadmin/sql-parser/locale/*

View File

@ -1,11 +0,0 @@
#!/bin/sh
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
for x in resources/po/*.po ; do
grep 'Team' "$x" | sed 's/.*: \(.*\)<.*/\1/'
git shortlog -sne --no-merges -- "$x" | grep '^ [ 0-9][0-9]\{3\}'
done

View File

@ -1,76 +0,0 @@
#!/bin/bash
#
# vim: expandtab sw=4 ts=4 sts=4:
#
# This requires Bash for the search and replace substitution to escape dots
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# Fail on undefined variables
set -u
# Fail on failure
set -e
printHelp () {
echo
echo "Please pass the new version number as a command line argument such as"
echo "$0 -v 5.0.0-dev"
echo
}
if [ $# -eq 0 ]
then
printHelp
exit 1
fi
if [ "$1" = '-v' ]
then
newVersion=$2
else
printHelp
exit 2
fi
# If we're in the scripts directory, we need to do all our work up a directory level
if [ "$(basename "$(pwd)")" = 'bin' ]
then
dir='../'
else
dir=''
fi
# There are half a dozen ways to do this, including individually recreating the line of
# each file (search for 'version =' in conf.py and replace it with 'version = 5.0.0-dev'
# for instance), and while that's more precise this should work with less to fix if a line changes.
# This method wasn't selected for any particular strength.
oldVersion="$(grep 'version =' "${dir}"docs/conf.py | cut -d "'" -f2)"
echo "Changing from ${oldVersion} to ${newVersion}..."
# Escape the dot for sed
oldVersion=${oldVersion//./\.}
newVersion=${newVersion//./\.}
for f in README docs/conf.py package.json
do
if ! grep --quiet "${oldVersion}" "${dir}${f}"
then
# There may be a better way to test for a failure of the substitution itself, such as using the 'q' directive with sed
# See https://stackoverflow.com/questions/15965073/return-code-of-sed-for-no-match
echo "FAILED! Substitution string ${oldVersion} not found in ${dir}${f}"
fi
sed -i "s/${oldVersion}/${newVersion}/g" "${dir}${f}"
done
echo
echo "- Next, you need to manually edit ChangeLog to manually change the version number and set the release date, and verify the changes with 'git diff'."
echo "- You will probably want to call: \"./bin/console set-version ${newVersion}\" afterwards"
echo "- You should check if you need to change the composer.json file and the theme.json file for each bundled theme."
echo " To change the composer.json file you can call something like: \"composer config extra.branch-alias.dev-master \"5.2.x-dev\"\""
echo "- Suggested commit message: Prepare for version ${newVersion}"

View File

@ -1,75 +0,0 @@
#!/bin/sh
#
# Removes mo files for incomplete translations
#
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
set -e
#
# How many percent needs to be translated
#
THRESHOLD=40
#
# Generated output file
#
TMPOUTPUTFILE=app/language_stats.inc.php.tmp
OUTPUTFILE=app/language_stats.inc.php
if [ -n "$1" ] ; then
THRESHOLD=$1
fi
{
echo '<?php'
echo '/**'
echo ' * Automatically generated file, do not edit!'
echo ' * Generated by bin/remove-incomplete-mo'
echo ' */'
echo ''
echo "return ["
} > $TMPOUTPUTFILE
check() {
TMPOUTPUTFILE=$2
lang=$(echo "$1" | sed 's@resources/po/\(.*\)\.po@\1@')
STATS=$(LC_ALL=C msgfmt --statistics -o /dev/null "$1" 2>&1)
if echo "$STATS" | grep -q ' translated ' ; then
TRANSLATED=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) translated.*/\2/')
else
TRANSLATED=0
fi
if echo "$STATS" | grep -q ' fuzzy ' ; then
FUZZY=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) fuzzy.*/\2/')
else
FUZZY=0
fi
if echo "$STATS" | grep -q ' untranslated ' ; then
UNTRANSLATED=$(echo "$STATS" | sed 's/\(^\|.* \)\([0-9]*\) untranslated.*/\2/')
else
UNTRANSLATED=0
fi
PERCENT=$((100 * TRANSLATED / ( TRANSLATED + FUZZY + UNTRANSLATED )))
echo " '$lang' => $PERCENT," >> "$TMPOUTPUTFILE"
if [ "$PERCENT" -lt "$THRESHOLD" ] ; then
echo "Removing $lang, only $PERCENT%"
rm -f resources/locale/"$lang"/LC_MESSAGES/phpmyadmin.mo
rmdir resources/locale/"$lang"/LC_MESSAGES
rmdir resources/locale/"$lang"
fi
}
for x in resources/po/*.po ; do
check "$x" "$TMPOUTPUTFILE"
done
echo '];' >> "$TMPOUTPUTFILE"
mv "$TMPOUTPUTFILE" $OUTPUTFILE

View File

@ -1,63 +0,0 @@
#!/bin/bash
#
# Shell script that creates a new transformation plug-in (both main and
# abstract class) using a template.
#
# The 'description' parameter will add a new entry in the language file.
# Watch out for special escaping.
#
# $1: MIMEType
# $2: MIMESubtype
# $3: Transformation Name
# $4: (optional) Description
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
if [ $# -ne 3 ] && [ $# -ne 4 ]; then
echo -e "Usage: ./generator_plugin.sh MIMEType MIMESubtype TransformationName [Description]\n"
exit 65
fi
# make sure that the MIME Type, MIME Subtype and Transformation names
# are in the correct format
# make all names lowercase
MT="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
MS="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
TN="$(echo "$3" | tr '[:upper:]' '[:lower:]')"
# make first letter uppercase
MT="${MT^}"
MS="${MS^}"
TN="${TN^}"
# make the first letter after each underscore uppercase
# define the name of the main class file and of its template
CLASS_NAME=$(echo "$MT"_"$MS"_"$TN" | sed -e 's/_./\U&\E/g')
BASE_DIR="./src/Plugins/Transformations"
ClassFile="$BASE_DIR"/"$CLASS_NAME".php
Template="$BASE_DIR"/TEMPLATE
# define the name of the abstract class file and its template
AbstractClassFile="$BASE_DIR"/Abs/"$TN"TransformationsPlugin.php
AbstractTemplate="$BASE_DIR"/TEMPLATE_ABSTRACT
# replace template names with argument names
sed "s/\[MIMEType]/$MT/; s/\[MIMESubtype\]/$MS/; s/\[TransformationName\]/$TN/;" < $Template > "$ClassFile"
echo "Created $ClassFile"
GenerateAbstractClass=1
if [ -n "$4" ]; then
if [ "$4" == "--generate_only_main_class" ]; then
if [ -e "$AbstractClassFile" ]; then
GenerateAbstractClass=0
fi
fi
fi
if [ $GenerateAbstractClass -eq 1 ]; then
# replace template names with argument names
sed "s/\[TransformationName\]/$TN/; s/Description of the transformation./$4/;" < $AbstractTemplate > "$AbstractClassFile"
echo "Created $AbstractClassFile"
fi

View File

@ -1,79 +0,0 @@
#!/bin/sh
# vim: expandtab sw=4 ts=4 sts=4:
export LC_ALL=C
# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
echo 'Can not invoke as CGI!'
exit 1
fi
# Exit on failure
set -e
# Generate Twig template cache in clean dir
rm -rf twig-templates/
php bin/console cache:warmup --twig-po --env development
# Update pot (template), ensure that advisor is at the end
LOCS=$(find resources/po -name '*.po' | sed 's@.*/\(.*\)\.po@\1@')
find . -name '*.php' -not -path './tests/*' -not -path './resources/po/*' -not -path './tmp/*' -not -path './release/*' -not -path './node_modules/*' -not -path './vendor/*' > twig-templates/filesList
php ./bin/match-twig-cache
sort --dictionary-order --ignore-case --output ./twig-templates/filesListTemp < ./twig-templates/filesList
mv ./twig-templates/filesListTemp ./twig-templates/filesList
php ./bin/match-twig-cache --reverse
# Allows word splitting for files list.
# shellcheck disable=SC2046
xgettext \
-d phpmyadmin \
--msgid-bugs-address=translators@phpmyadmin.net \
-o resources/po/phpmyadmin.pot \
--language=PHP \
--add-comments=l10n \
--add-location \
--debug \
--from-code=utf-8 \
--keyword=__ --keyword=_gettext --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
--copyright-holder="phpMyAdmin devel team" \
$(cat ./twig-templates/filesList)
# Fixup filenames for Twig templates
php bin/console fix-po-twig
# Remote twig templates
rm -rf twig-templates/
# Keep in sync with create-release.sh
fetchReleaseFromFile() {
php -r "define('VERSION_SUFFIX', ''); require_once('src/Version.php'); echo \PhpMyAdmin\Version::VERSION;"
}
ver="$(fetchReleaseFromFile)"
sed -i.~ '
s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
s/PACKAGE/phpMyAdmin/;
s/(C) YEAR/(C) 2003 - '"$(date +%Y)"'/;
s/VERSION/'"$ver"'/;
' resources/po/phpmyadmin.pot
# Update po files (translations)
for loc in $LOCS ; do
sed -i.~ '
s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
s/PACKAGE/phpMyAdmin/;
s/(C) YEAR/(C) 2003 - '"$(date +%Y)"'/;
s/VERSION/'"$ver"'/;
s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '"$ver"'\\n"/;
' resources/po/"$loc".po
msgmerge --previous -U resources/po/"$loc".po resources/po/phpmyadmin.pot
done
# Commit changes
git add resources/po/*.po resources/po/phpmyadmin.pot
git commit -s -m 'Update po files
[ci skip]'

62
browse_foreigners.php Normal file
View File

@ -0,0 +1,62 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* display selection for relational field values
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\BrowseForeigners;
use PhpMyAdmin\Controllers\BrowseForeignersController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
Util::checkParameters(['db', 'table', 'field'], true);
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Template $template */
$template = $containerBuilder->get('template');
/* Register BrowseForeignersController dependencies */
$containerBuilder->set(
'browse_foreigners',
new BrowseForeigners(
(int) $GLOBALS['cfg']['LimitChars'],
(int) $GLOBALS['cfg']['MaxRows'],
(int) $GLOBALS['cfg']['RepeatCells'],
(bool) $GLOBALS['cfg']['ShowAll'],
$GLOBALS['pmaThemeImage'],
$template
)
);
/** @var BrowseForeignersController $controller */
$controller = $containerBuilder->get(BrowseForeignersController::class);
$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,
]));

161
build.xml Normal file
View File

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpMyAdmin" default="build" basedir=".">
<property name="source" value="."/>
<property name="source_comma_sep" value="."/>
<property environment="env"/>
<property name="env.PHPUNIT_XML" value="phpunit.xml.dist"/>
<property name="env.PHPUNIT_XML_NOCOVERAGE" value="phpunit.xml.nocoverage"/>
<property name="env.PHPUNIT_XML_HHVM" value="phpunit.xml.hhvm"/>
<property name="env.PHPUNIT_ARGS" value="--exclude-group selenium"/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML_NOCOVERAGE} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="phpunit-hhvm" description="Run unit tests using PHPUnit with HHVM specific config">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML_HHVM} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
'--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
'--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
${source_comma_sep}" />
</exec>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec executable="phpmd">
<arg line="${source_comma_sep}
xml
codesize,design,naming,unusedcode
--exclude test,build,vendor,tmp
--reportfile '${basedir}/build/logs/pmd.xml'" />
</exec>
</target>
<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="phpcpd">
<arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
--exclude test
--exclude tmp
--exclude build
--exclude vendor
${source}" />
</exec>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg line="--log-csv '${basedir}/build/logs/phploc.csv'
--exclude test
--exclude build
--exclude vendor
--exclude tmp
${source}" />
</exec>
</target>
<target name="phpcs-config" description="PHPCS configuration tweaking">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="--config-set installed_paths ${basedir}/vendor/phpmyadmin/coding-standard" />
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="
--ignore=*/vendor/*,*/build/*,*/tmp/*
--report=checkstyle
--extensions=php
--report-file='${basedir}/build/logs/checkstyle.xml'
--standard=PhpMyAdmin
${source}" />
</exec>
</target>
<target name="phpdoc" description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg line="-d ${source} -t '${basedir}/build/api'" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg line="--log '${basedir}/build/logs'
--source '${source}'
--output '${basedir}/build/code-browser'" />
</exec>
</target>
<target name="jshint" description="Javascript checks">
<apply executable="jshint" output="${basedir}/build/logs/jshint-jslint.xml" parallel="true">
<arg line="--config ./.jshintrc --reporter=jslint" />
<fileset dir="${basedir}">
<include name="js/designer/*.js" />
<include name="js/*.js" />
<include name="setup/*.js" />
</fileset>
</apply>
</target>
<target name="jshint-checkstyle" description="Javascript checks">
<apply executable="jshint" output="${basedir}/build/logs/jshint-checkstyle.xml" parallel="true">
<arg line="--config ./.jshintrc --reporter=checkstyle" />
<fileset dir="${basedir}">
<include name="js/designer/*.js" />
<include name="js/*.js" />
<include name="setup/*.js" />
</fileset>
</apply>
</target>
<target name="locales" description="Generate locales">
<exec executable="./scripts/generate-mo" failonerror="true">
<arg line="--quiet" />
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}">
<include name="libraries/**/*.php" />
<include name="templates/**/*.phtml" />
<include name="setup/**/*.php" />
<include name="test/**/*.php" />
<include name="*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint,locales"/>
</project>

112
changelog.php Normal file
View File

@ -0,0 +1,112 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Simple script to set correct charset for changelog
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
/**
* Gets core libraries and defines some variables
*/
require ROOT_PATH . 'libraries/common.inc.php';
/** @var Template $template */
$template = $containerBuilder->get('template');
$response = Response::getInstance();
$response->disable();
$response->getHeader()->sendHttpHeaders();
$filename = CHANGELOG_FILE;
/**
* Read changelog.
*/
// 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();
readgzfile($filename);
$changelog = ob_get_contents();
ob_end_clean();
} else {
$changelog = file_get_contents($filename);
}
} else {
printf(
__(
'The %s file is not available on this system, please visit ' .
'%s for more information.'
),
$filename,
'<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
);
exit;
}
/**
* Whole changelog in variable.
*/
$changelog = htmlspecialchars($changelog);
$github_url = 'https://github.com/phpmyadmin/phpmyadmin/';
$faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html';
$replaces = [
'@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
=> '<a href="url.php?url=\\1">\\1</a>',
// mail address
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
=> '\\1 <a href="mailto:\\3">\\2</a>',
// FAQ entries
'/FAQ ([0-9]+)\.([0-9a-z]+)/i'
=> '<a href="url.php?url=' . $faq_url . '#faq\\1-\\2">FAQ \\1.\\2</a>',
// GitHub issues
'/issue\s*#?([0-9]{4,5}) /i'
=> '<a href="url.php?url=' . $github_url . 'issues/\\1">issue #\\1</a> ',
// CVE/CAN entries
'/((CAN|CVE)-[0-9]+-[0-9]+)/'
=> '<a href="url.php?url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
// PMASAentries
'/(PMASA-[0-9]+-[0-9]+)/'
=> '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',
// Highlight releases (with links)
'/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
=> '<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 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>',
// Highlight releases (not linkable)
'/( ### )(.*)/'
=> '\\1<b>\\2</b>',
// Links target and rel
'/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="',
];
header('Content-type: text/html; charset=utf-8');
echo $template->render('changelog', [
'changelog' => preg_replace(array_keys($replaces), $replaces, $changelog),
]);

47
chk_rel.php Normal file
View File

@ -0,0 +1,47 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays status of phpMyAdmin configuration storage
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Relation $relation */
$relation = $containerBuilder->get('relation');
// If request for creating the pmadb
if (isset($_POST['create_pmadb']) && $relation->createPmaDatabase()) {
$relation->fixPmaTables('phpmyadmin');
}
// If request for creating all PMA tables.
if (isset($_POST['fixall_pmadb'])) {
$relation->fixPmaTables($GLOBALS['db']);
}
$cfgRelation = $relation->getRelationsParam();
// If request for creating missing PMA tables.
if (isset($_POST['fix_pmadb'])) {
$relation->fixPmaTables($cfgRelation['db']);
}
$response->addHTML(
$relation->getRelationsParamDiagnostic($cfgRelation)
);

View File

@ -5,7 +5,6 @@
"keywords": ["phpmyadmin","mysql","web"],
"homepage": "https://www.phpmyadmin.net/",
"support": {
"security": "https://www.phpmyadmin.net/security/",
"forum": "https://www.phpmyadmin.net/support/",
"issues": "https://github.com/phpmyadmin/phpmyadmin/issues",
"wiki": "https://wiki.phpmyadmin.net/",
@ -23,21 +22,13 @@
"non-feature-branches": ["RELEASE_.*"],
"autoload": {
"psr-4": {
"PhpMyAdmin\\": "src"
},
"exclude-from-classmap": [
"/tests/",
"/vendor/tecnickcom/tcpdf/tcpdf_barcodes_*.php",
"/vendor/tecnickcom/tcpdf/tcpdf_import.php",
"/vendor/tecnickcom/tcpdf/tcpdf_parser.php",
"/vendor/tecnickcom/tcpdf/include/tcpdf_filters.php",
"/vendor/tecnickcom/tcpdf/include/barcodes"
]
"PhpMyAdmin\\": "libraries/classes"
}
},
"autoload-dev": {
"psr-4": {
"PhpMyAdmin\\Tests\\": "tests/unit",
"PhpMyAdmin\\Tests\\Selenium\\": "tests/end-to-end/"
"PhpMyAdmin\\Tests\\": "test/classes",
"PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/"
}
},
"repositories": [
@ -47,47 +38,37 @@
}
],
"require": {
"php": "^8.2",
"php": "^7.1.3",
"ext-hash": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-mysqli": "*",
"ext-openssl": "*",
"ext-pcre": "*",
"ext-sodium": "*",
"ext-xml": "*",
"composer/ca-bundle": "^1.2",
"fig/http-message-util": "^1.1",
"google/recaptcha": "^1.3",
"laminas/laminas-httphandlerrunner": "^2.6",
"nikic/fast-route": "^1.3",
"phpmyadmin/motranslator": "^6.0",
"phpmyadmin/shapefile": "^4.0",
"phpmyadmin/sql-parser": "^6.0",
"psr/clock": "^1.0",
"psr/container": "^2.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^2",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"slim/psr7": "^1.6.1",
"symfony/config": "^7.1",
"symfony/dependency-injection": "^7.1",
"symfony/expression-language": "^7.1",
"symfony/polyfill-ctype": "^1.24",
"symfony/polyfill-iconv": "^1.33",
"symfony/polyfill-mbstring": "^1.24",
"symfony/polyfill-php84": "^1.33",
"twig/twig": "^3.21",
"webmozart/assert": "^1.10",
"google/recaptcha": "^1.1",
"phpmyadmin/motranslator": "^4.0",
"phpmyadmin/shapefile": "^2.0",
"phpmyadmin/sql-parser": "^5.0",
"phpmyadmin/twig-i18n-extension": "^2.0 || ^3.0",
"phpseclib/phpseclib": "^2.0",
"symfony/config": "^4.2.8",
"symfony/dependency-injection": "^4.2.8",
"symfony/expression-language": "^4.2",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3",
"symfony/yaml": "^4.2.8",
"twig/twig": "^2.9 || ^3",
"williamdes/mariadb-mysql-kbs": "^1.2"
},
"conflict": {
"bacon/bacon-qr-code": "<2.0",
"pragmarx/google2fa-qrcode": "<2.1",
"tecnickcom/tcpdf": "<6.4.4"
"phpseclib/phpseclib": "2.0.8",
"tecnickcom/tcpdf": "<6.2",
"pragmarx/google2fa": ">=6.1",
"pragmarx/google2fa-qrcode": "<1.0.1",
"samyoul/u2f-php-server": "<1.1"
},
"suggest": {
"ext-openssl": "Cookie encryption",
"ext-curl": "Updates checking",
"ext-opcache": "Better performance",
"ext-zlib": "For gz import and export",
@ -96,67 +77,36 @@
"ext-gd2": "For image transformations",
"ext-mbstring": "For best performance",
"tecnickcom/tcpdf": "For PDF support",
"pragmarx/google2fa-qrcode": "^2.1 or ^3.0 - For 2FA authentication",
"bacon/bacon-qr-code": "^3.0 - For 2FA authentication",
"code-lts/u2f-php-server": "For FIDO U2F authentication",
"web-auth/webauthn-lib": "For better WebAuthn/FIDO2 authentication support"
"pragmarx/google2fa-qrcode": "For 2FA authentication",
"samyoul/u2f-php-server": "For FIDO U2F authentication"
},
"require-dev": {
"bacon/bacon-qr-code": "^3.0",
"code-lts/u2f-php-server": "^1.2",
"guzzlehttp/psr7": "^2.5",
"httpsoft/http-message": "^1.1",
"laminas/laminas-diactoros": "^3.0",
"nyholm/psr7": "^1.8",
"php-webdriver/webdriver": "^1.14",
"phpmyadmin/coding-standard": "^4.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^11.5",
"pragmarx/google2fa-qrcode": "^3.0",
"psalm/plugin-phpunit": "^0.19",
"symfony/console": "^7.1",
"tecnickcom/tcpdf": "^6.4.4",
"vimeo/psalm": "^6.0",
"web-auth/webauthn-lib": "^4.9"
"php-webdriver/webdriver": "^1.7.1",
"phpmyadmin/coding-standard": "^1.0",
"phpstan/phpstan": "^0.11.5",
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
"pragmarx/google2fa-qrcode": "^1.0.1",
"samyoul/u2f-php-server": "^1.1",
"squizlabs/php_codesniffer": "^3.0",
"tecnickcom/tcpdf": "^6.3"
},
"extra": {
"branch-alias": {
"dev-master": "6.0.x-dev"
"dev-master": "5.0.x-dev"
}
},
"scripts": {
"phpcbf": "@php phpcbf",
"phpcs": "@php phpcs",
"phpstan": "@php phpstan analyse",
"psalm": "@php psalm --no-diff",
"phpunit": "@php phpunit --color=always",
"phpcbf": "phpcbf",
"phpcs": "phpcs",
"phpstan": "phpstan analyse",
"phpunit": "phpunit",
"test": [
"@phpcs",
"@phpstan",
"@psalm",
"@phpunit"
],
"update:baselines": [
"@php phpstan analyse --generate-baseline",
"@php psalm --no-cache --threads=max --set-baseline=psalm-baseline.xml"
],
"twig-lint": "@php bin/console lint:twig --ansi --show-deprecations"
]
},
"config":{
"sort-packages": true,
"discard-changes": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"composer/package-versions-deprecated": true
},
"platform": {
"php": "8.2.99"
}
"sort-packages": true
}
}

8949
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,19 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the docs/ folder
* All directives are explained in documentation in the doc/ folder
* or at <https://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
/**
* This is needed for cookie based authentication to encrypt the cookie.
* Needs to be a 32-bytes long string of random bytes. See FAQ 2.10.
* This is needed for cookie based authentication to encrypt password in
* cookie. Needs to be 32 chars long.
*/
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
@ -108,7 +110,7 @@ $cfg['SaveDir'] = '';
/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the 'resources/locale' folder)
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
@ -147,14 +149,7 @@ $cfg['SaveDir'] = '';
*/
//$cfg['SendErrorReports'] = 'always';
/**
* 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string.
* 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string.
*/
//$cfg['URLQueryEncryption'] = true;
//$cfg['URLQueryEncryptionSecretKey'] = '';
/**
* You can find more configuration options in the documentation
* in the docs/ folder or at <https://docs.phpmyadmin.net/>.
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
*/

138
db_central_columns.php Normal file
View File

@ -0,0 +1,138 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Central Columns view/edit
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
use PhpMyAdmin\CentralColumns;
use PhpMyAdmin\Controllers\Database\CentralColumnsController;
use PhpMyAdmin\Core;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var CentralColumns $centralColumns */
$centralColumns = $containerBuilder->get('central_columns');
/** @var CentralColumnsController $controller */
$controller = $containerBuilder->get(CentralColumnsController::class);
/** @var string $db */
$db = $containerBuilder->getParameter('db');
if (isset($_POST['edit_save'])) {
echo $controller->editSave([
'col_name' => $_POST['col_name'] ?? null,
'orig_col_name' => $_POST['orig_col_name'] ?? null,
'col_default' => $_POST['col_default'] ?? null,
'col_default_sel' => $_POST['col_default_sel'] ?? null,
'col_extra' => $_POST['col_extra'] ?? null,
'col_isNull' => $_POST['col_isNull'] ?? null,
'col_length' => $_POST['col_length'] ?? null,
'col_attribute' => $_POST['col_attribute'] ?? null,
'col_type' => $_POST['col_type'] ?? null,
'collation' => $_POST['collation'] ?? null,
]);
exit;
} elseif (isset($_POST['add_new_column'])) {
$tmp_msg = $controller->addNewColumn([
'col_name' => $_POST['col_name'] ?? null,
'col_default' => $_POST['col_default'] ?? null,
'col_default_sel' => $_POST['col_default_sel'] ?? null,
'col_extra' => $_POST['col_extra'] ?? null,
'col_isNull' => $_POST['col_isNull'] ?? null,
'col_length' => $_POST['col_length'] ?? null,
'col_attribute' => $_POST['col_attribute'] ?? null,
'col_type' => $_POST['col_type'] ?? null,
'collation' => $_POST['collation'] ?? null,
]);
}
if (isset($_POST['populateColumns'])) {
$response->addHTML($controller->populateColumns([
'selectedTable' => $_POST['selectedTable'],
]));
exit;
}
if (isset($_POST['getColumnList'])) {
$response->addJSON('message', $controller->getColumnList([
'cur_table' => $_POST['cur_table'] ?? null,
]));
exit;
}
if (isset($_POST['add_column'])) {
$tmp_msg = $controller->addColumn([
'table-select' => $_POST['table-select'] ?? null,
'column-select' => $_POST['column-select'] ?? null,
]);
}
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
$scripts->addFile('vendor/jquery/jquery.tablesorter.js');
$scripts->addFile('database/central_columns.js');
if (isset($_POST['edit_central_columns_page'])) {
$response->addHTML($controller->editPage([
'selected_fld' => $_POST['selected_fld'] ?? null,
'db' => $_POST['db'] ?? null,
]));
exit;
}
if (isset($_POST['multi_edit_central_column_save'])) {
$message = $controller->updateMultipleColumn([
'db' => $_POST['db'] ?? null,
'orig_col_name' => $_POST['orig_col_name'] ?? null,
'field_name' => $_POST['field_name'] ?? null,
'field_default_type' => $_POST['field_default_type'] ?? null,
'field_default_value' => $_POST['field_default_value'] ?? null,
'field_length' => $_POST['field_length'] ?? null,
'field_attribute' => $_POST['field_attribute'] ?? null,
'field_type' => $_POST['field_type'] ?? null,
'field_collation' => $_POST['field_collation'] ?? null,
'field_null' => $_POST['field_null'] ?? null,
'col_extra' => $_POST['col_extra'] ?? null,
]);
if (! is_bool($message)) {
$response->setRequestStatus(false);
$response->addJSON('message', $message);
}
}
if (isset($_POST['delete_save'])) {
$tmp_msg = $controller->deleteSave([
'db' => $_POST['db'] ?? null,
'col_name' => $_POST['col_name'] ?? null,
]);
}
$response->addHTML($controller->index([
'pos' => $_POST['pos'] ?? null,
'total_rows' => $_POST['total_rows'] ?? null,
]));
$pos = 0;
if (Core::isValid($_POST['pos'], 'integer')) {
$pos = (int) $_POST['pos'];
}
$num_cols = $centralColumns->getColumnsCount(
$db,
$pos,
(int) $GLOBALS['cfg']['MaxRows']
);
$message = Message::success(
sprintf(__('Showing rows %1$s - %2$s.'), $pos + 1, $pos + $num_cols)
);
if (isset($tmp_msg) && $tmp_msg !== true) {
$message = $tmp_msg;
}

31
db_datadict.php Normal file
View File

@ -0,0 +1,31 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Renders data dictionary
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\DataDictionaryController;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
Util::checkParameters(['db']);
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DataDictionaryController $controller */
$controller = $containerBuilder->get(DataDictionaryController::class);
$header = $response->getHeader();
$header->enablePrintView();
$response->addHTML($controller->index());

236
db_designer.php Normal file
View File

@ -0,0 +1,236 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin designer general code
*
* @package PhpMyAdmin-Designer
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Designer;
use PhpMyAdmin\Database\Designer\Common;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Designer $databaseDesigner */
$databaseDesigner = $containerBuilder->get('designer');
/** @var Common $designerCommon */
$designerCommon = $containerBuilder->get('designer_common');
if (isset($_POST['dialog'])) {
if ($_POST['dialog'] == 'edit') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($_POST['db'], 'editPage');
} elseif ($_POST['dialog'] == 'delete') {
$html = $databaseDesigner->getHtmlForEditOrDeletePages($_POST['db'], 'deletePage');
} elseif ($_POST['dialog'] == 'save_as') {
$html = $databaseDesigner->getHtmlForPageSaveAs($_POST['db']);
} elseif ($_POST['dialog'] == 'export') {
$html = $databaseDesigner->getHtmlForSchemaExport(
$_POST['db'],
$_POST['selected_page']
);
} elseif ($_POST['dialog'] == 'add_table') {
// Pass the db and table to the getTablesInfo so we only have the table we asked for
$script_display_field = $designerCommon->getTablesInfo($_POST['db'], $_POST['table']);
$tab_column = $designerCommon->getColumnsInfo($script_display_field);
$tables_all_keys = $designerCommon->getAllKeys($script_display_field);
$tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys($script_display_field);
$html = $databaseDesigner->getDatabaseTables(
$_POST['db'],
$script_display_field,
[],
-1,
$tab_column,
$tables_all_keys,
$tables_pk_or_unique_keys
);
}
if (! empty($html)) {
$response->addHTML($html);
}
return;
}
if (isset($_POST['operation'])) {
if ($_POST['operation'] == 'deletePage') {
$success = $designerCommon->deletePage($_POST['selected_page']);
$response->setRequestStatus($success);
} elseif ($_POST['operation'] == 'savePage') {
if ($_POST['save_page'] == 'same') {
$page = $_POST['selected_page'];
} else { // new
if ($designerCommon->getPageExists($_POST['selected_value'])) {
$response->addJSON(
'message',
/* l10n: The user tries to save a page with an existing name in Designer */
__(
sprintf(
"There already exists a page named \"%s\" please rename it to something else.",
htmlspecialchars($_POST['selected_value'])
)
)
);
$response->setRequestStatus(false);
return;
} else {
$page = $designerCommon->createNewPage($_POST['selected_value'], $_POST['db']);
$response->addJSON('id', $page);
}
}
$success = $designerCommon->saveTablePositions($page);
$response->setRequestStatus($success);
} elseif ($_POST['operation'] == 'setDisplayField') {
[
$success,
$message,
] = $designerCommon->saveDisplayField(
$_POST['db'],
$_POST['table'],
$_POST['field']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_POST['operation'] == 'addNewRelation') {
list($success, $message) = $designerCommon->addNewRelation(
$_POST['db'],
$_POST['T1'],
$_POST['F1'],
$_POST['T2'],
$_POST['F2'],
$_POST['on_delete'],
$_POST['on_update'],
$_POST['DB1'],
$_POST['DB2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_POST['operation'] == 'removeRelation') {
list($success, $message) = $designerCommon->removeRelation(
$_POST['T1'],
$_POST['F1'],
$_POST['T2'],
$_POST['F2']
);
$response->setRequestStatus($success);
$response->addJSON('message', $message);
} elseif ($_POST['operation'] == 'save_setting_value') {
$success = $designerCommon->saveSetting($_POST['index'], $_POST['value']);
$response->setRequestStatus($success);
}
return;
}
require ROOT_PATH . 'libraries/db_common.inc.php';
$script_display_field = $designerCommon->getTablesInfo();
$display_page = -1;
$selected_page = null;
if (isset($_GET['query'])) {
$display_page = $designerCommon->getDefaultPage($_GET['db']);
} elseif (! empty($_GET['page'])) {
$display_page = $_GET['page'];
} else {
$display_page = $designerCommon->getLoadingPage($_GET['db']);
}
if ($display_page != -1) {
$selected_page = $designerCommon->getPageName($display_page);
}
$tab_pos = $designerCommon->getTablePositions($display_page);
$fullTableNames = [];
foreach ($script_display_field as $designerTable) {
$fullTableNames[] = $designerTable->getDbTableString();
}
foreach ($tab_pos as $position) {
if (! in_array($position['dbName'] . '.' . $position['tableName'], $fullTableNames)) {
foreach ($designerCommon->getTablesInfo($position['dbName'], $position['tableName']) as $designerTable) {
$script_display_field[] = $designerTable;
}
}
}
$tab_column = $designerCommon->getColumnsInfo($script_display_field);
$script_tables = $designerCommon->getScriptTabs($script_display_field);
$tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys($script_display_field);
$tables_all_keys = $designerCommon->getAllKeys($script_display_field);
$classes_side_menu = $databaseDesigner->returnClassNamesFromMenuButtons();
$script_contr = $designerCommon->getScriptContr($script_display_field);
$params = ['lang' => $GLOBALS['lang']];
if (isset($_GET['db'])) {
$params['db'] = $_GET['db'];
}
$response = Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('designer_body');
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.fullscreen.js');
$scripts->addFile('designer/database.js');
$scripts->addFile('designer/objects.js');
$scripts->addFile('designer/page.js');
$scripts->addFile('designer/history.js');
$scripts->addFile('designer/move.js');
$scripts->addFile('designer/init.js');
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
// Embed some data into HTML, later it will be read
// by designer/init.js and converted to JS variables.
$response->addHTML(
$databaseDesigner->getHtmlForMain(
$db,
$_GET['db'],
$script_display_field,
$script_tables,
$script_contr,
$script_display_field,
$display_page,
isset($_GET['query']),
$selected_page,
$classes_side_menu,
$tab_pos,
$tab_column,
$tables_all_keys,
$tables_pk_or_unique_keys
)
);
$response->addHTML('<div id="PMA_disable_floating_menubar"></div>');

80
db_events.php Normal file
View File

@ -0,0 +1,80 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Events management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\EventsController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
$_PMA_RTE = 'EVN';
/** @var EventsController $controller */
$controller = $containerBuilder->get(EventsController::class);
/** @var string $db */
$db = $containerBuilder->getParameter('db');
/** @var string $table */
$table = $containerBuilder->getParameter('table');
if (! $response->isAjax()) {
/**
* Displays the header and tabs
*/
if (! empty($table) && in_array($table, $dbi->getTables($db))) {
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
} else {
$table = '';
include_once ROOT_PATH . 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}
} else {
/**
* Since we did not include some libraries, we need
* to manually select the required database and
* create the missing $url_query variable
*/
if (strlen($db) > 0) {
$dbi->selectDb($db);
if (! isset($url_query)) {
$url_query = Url::getCommon(
[
'db' => $db,
'table' => $table,
]
);
}
}
}
$controller->index();

173
db_export.php Normal file
View File

@ -0,0 +1,173 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* dumps a database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Display\Export as DisplayExport;
use PhpMyAdmin\Export;
use PhpMyAdmin\Message;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db, $table, $url_query, $containerBuilder;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
PageSettings::showGroup('Export');
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export.js');
/** @var Export $export */
$export = $containerBuilder->get('export');
// $sub_part is used in Util::getDbInfo() to see if we are coming from
// db_export.php, in which case we don't obey $cfg['MaxTableList']
$sub_part = '_export';
require_once ROOT_PATH . 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_export.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, $sub_part === null ? '' : $sub_part);
/**
* Displays the form
*/
$export_page_title = __('View dump (schema) of database');
// exit if no tables in db found
if ($num_tables < 1) {
$response->addHTML(
Message::error(__('No tables found in database.'))->getDisplay()
);
exit;
} // end if
$multi_values = '<div class="export_table_list_container">';
if (isset($_POST['structure_or_data_forced'])) {
$force_val = htmlspecialchars($_POST['structure_or_data_forced']);
} else {
$force_val = 0;
}
$multi_values .= '<input type="hidden" name="structure_or_data_forced" value="'
. $force_val . '">';
$multi_values .= '<table class="export_table_select">'
. '<thead><tr><th></th>'
. '<th>' . __('Tables') . '</th>'
. '<th class="export_structure">' . __('Structure') . '</th>'
. '<th class="export_data">' . __('Data') . '</th>'
. '</tr><tr>'
. '<td></td>'
. '<td class="export_table_name all">' . __('Select all') . '</td>'
. '<td class="export_structure all">'
. '<input type="checkbox" id="table_structure_all"></td>'
. '<td class="export_data all"><input type="checkbox" id="table_data_all">'
. '</td>'
. '</tr></thead>'
. '<tbody>';
$multi_values .= "\n";
// when called by libraries/mult_submits.inc.php
if (! empty($_POST['selected_tbl']) && empty($table_select)) {
$table_select = $_POST['selected_tbl'];
}
foreach ($tables as $each_table) {
if (isset($_POST['table_select']) && is_array($_POST['table_select'])) {
$is_checked = $export->getCheckedClause(
$each_table['Name'],
$_POST['table_select']
);
} elseif (isset($table_select)) {
$is_checked = $export->getCheckedClause(
$each_table['Name'],
$table_select
);
} else {
$is_checked = ' checked="checked"';
}
if (isset($_POST['table_structure']) && is_array($_POST['table_structure'])) {
$structure_checked = $export->getCheckedClause(
$each_table['Name'],
$_POST['table_structure']
);
} else {
$structure_checked = $is_checked;
}
if (isset($_POST['table_data']) && is_array($_POST['table_data'])) {
$data_checked = $export->getCheckedClause(
$each_table['Name'],
$_POST['table_data']
);
} else {
$data_checked = $is_checked;
}
$table_html = htmlspecialchars($each_table['Name']);
$multi_values .= '<tr class="marked">';
$multi_values .= '<td><input type="checkbox" name="table_select[]"'
. ' value="' . $table_html . '"' . $is_checked . ' class="checkall"></td>';
$multi_values .= '<td class="export_table_name">'
. str_replace(' ', '&nbsp;', $table_html) . '</td>';
$multi_values .= '<td class="export_structure">'
. '<input type="checkbox" name="table_structure[]"'
. ' value="' . $table_html . '"' . $structure_checked . '></td>';
$multi_values .= '<td class="export_data">'
. '<input type="checkbox" name="table_data[]"'
. ' value="' . $table_html . '"' . $data_checked . '></td>';
$multi_values .= '</tr>';
} // end for
$multi_values .= "\n";
$multi_values .= '</tbody></table></div>';
if (! isset($sql_query)) {
$sql_query = '';
}
if (! isset($num_tables)) {
$num_tables = 0;
}
if (! isset($unlim_num_rows)) {
$unlim_num_rows = 0;
}
if ($multi_values === null) {
$multi_values = '';
}
$response = Response::getInstance();
$displayExport = new DisplayExport();
$response->addHTML(
$displayExport->getDisplay(
'database',
$db,
$table,
$sql_query,
$num_tables,
$unlim_num_rows,
$multi_values
)
);

56
db_import.php Normal file
View File

@ -0,0 +1,56 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database import page
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\Display\Import;
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db, $table;
require_once ROOT_PATH . 'libraries/common.inc.php';
PageSettings::showGroup('Import');
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('import.js');
$import = new Import();
/**
* Gets tables information and displays top links
*/
require ROOT_PATH . 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
$response = Response::getInstance();
$response->addHTML(
$import->get(
'database',
$db,
$table,
$max_upload_size
)
);

51
db_multi_table_query.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Handles database multi-table querying
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\MultiTableQueryController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var MultiTableQueryController $controller */
$controller = $containerBuilder->get(MultiTableQueryController::class);
/** @var Template $template */
$template = $containerBuilder->get('template');
if (isset($_POST['sql_query'])) {
$controller->displayResults([
'sql_query' => $_POST['sql_query'],
'db' => $_REQUEST['db'] ?? null,
]);
} elseif (isset($_GET['tables'])) {
$response->addJSON($controller->table([
'tables' => $_GET['tables'],
'db' => $_REQUEST['db'] ?? null,
]));
} else {
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.md5.js');
$scripts->addFile('database/multi_table_query.js');
$scripts->addFile('database/query_generator.js');
$response->addHTML($controller->index($template));
}

321
db_operations.php Normal file
View File

@ -0,0 +1,321 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* handles miscellaneous db operations:
* - move/rename
* - copy
* - changing collation
* - changing comment
* - adding tables
* - viewing PDF schemas
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\CheckUserPrivileges;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Display\CreateTable;
use PhpMyAdmin\Message;
use PhpMyAdmin\Operations;
use PhpMyAdmin\Plugins;
use PhpMyAdmin\Plugins\Export\ExportSql;
use PhpMyAdmin\Relation;
use PhpMyAdmin\RelationCleanup;
use PhpMyAdmin\Response;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $cfg, $db, $server, $url_query;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
$checkUserPrivileges = new CheckUserPrivileges($dbi);
$checkUserPrivileges->getPrivileges();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('database/operations.js');
$sql_query = '';
/** @var Relation $relation */
$relation = $containerBuilder->get('relation');
$operations = new Operations($dbi, $relation);
$relationCleanup = new RelationCleanup($dbi, $relation);
/**
* Rename/move or copy database
*/
if (strlen($db) > 0
&& (! empty($_POST['db_rename']) || ! empty($_POST['db_copy']))
) {
if (! empty($_POST['db_rename'])) {
$move = true;
} else {
$move = false;
}
if (! isset($_POST['newname']) || strlen($_POST['newname']) === 0) {
$message = Message::error(__('The database name is empty!'));
} else {
// lower_case_table_names=1 `DB` becomes `db`
if ($dbi->getLowerCaseNames() === '1') {
$_POST['newname'] = mb_strtolower(
$_POST['newname']
);
}
if ($_POST['newname'] === $_REQUEST['db']) {
$message = Message::error(
__('Cannot copy database to the same name. Change the name and try again.')
);
} else {
$_error = false;
if ($move || ! empty($_POST['create_database_before_copying'])) {
$operations->createDbBeforeCopy();
}
// here I don't use DELIMITER because it's not part of the
// language; I have to send each statement one by one
// to avoid selecting alternatively the current and new db
// we would need to modify the CREATE definitions to qualify
// the db name
$operations->runProcedureAndFunctionDefinitions($db);
// go back to current db, just in case
$dbi->selectDb($db);
$tables_full = $dbi->getTablesFull($db);
// remove all foreign key constraints, otherwise we can get errors
/** @var ExportSql $export_sql_plugin */
$export_sql_plugin = Plugins::getPlugin(
"export",
"sql",
'libraries/classes/Plugins/Export/',
[
'single_table' => isset($single_table),
'export_type' => 'database',
]
);
// create stand-in tables for views
$views = $operations->getViewsAndCreateSqlViewStandIn(
$tables_full,
$export_sql_plugin,
$db
);
// copy tables
$sqlConstratints = $operations->copyTables(
$tables_full,
$move,
$db
);
// handle the views
if (! $_error) {
$operations->handleTheViews($views, $move, $db);
}
unset($views);
// now that all tables exist, create all the accumulated constraints
if (! $_error && count($sqlConstratints) > 0) {
$operations->createAllAccumulatedConstraints($sqlConstratints);
}
unset($sqlConstratints);
if ($dbi->getVersion() >= 50100) {
// here DELIMITER is not used because it's not part of the
// language; each statement is sent one by one
$operations->runEventDefinitionsForDb($db);
}
// go back to current db, just in case
$dbi->selectDb($db);
// Duplicate the bookmarks for this db (done once for each db)
$operations->duplicateBookmarks($_error, $db);
if (! $_error && $move) {
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
$operations->adjustPrivilegesMoveDb($db, $_POST['newname']);
}
/**
* cleanup pmadb stuff for this db
*/
$relationCleanup->database($db);
// if someday the RENAME DATABASE reappears, do not DROP
$local_query = 'DROP DATABASE '
. Util::backquote($db) . ';';
$sql_query .= "\n" . $local_query;
$dbi->query($local_query);
$message = Message::success(
__('Database %1$s has been renamed to %2$s.')
);
$message->addParam($db);
$message->addParam($_POST['newname']);
} elseif (! $_error) {
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
$operations->adjustPrivilegesCopyDb($db, $_POST['newname']);
}
$message = Message::success(
__('Database %1$s has been copied to %2$s.')
);
$message->addParam($db);
$message->addParam($_POST['newname']);
} else {
$message = Message::error();
}
$reload = true;
/* Change database to be used */
if (! $_error && $move) {
$db = $_POST['newname'];
} elseif (! $_error) {
if (isset($_POST['switch_to_new'])
&& $_POST['switch_to_new'] == 'true'
) {
$_SESSION['pma_switch_to_new'] = true;
$db = $_POST['newname'];
} else {
$_SESSION['pma_switch_to_new'] = false;
}
}
}
}
/**
* Database has been successfully renamed/moved. If in an Ajax request,
* generate the output with {@link PhpMyAdmin\Response} and exit
*/
if ($response->isAjax()) {
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('newname', $_POST['newname']);
$response->addJSON(
'sql_query',
Util::getMessage(null, $sql_query)
);
$response->addJSON('db', $db);
exit;
}
}
/**
* Settings for relations stuff
*/
$cfgRelation = $relation->getRelationsParam();
/**
* Check if comments were updated
* (must be done before displaying the menu tabs)
*/
if (isset($_POST['comment'])) {
$relation->setDbComment($db, $_POST['comment']);
}
require ROOT_PATH . 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_operations.php';
// Gets the database structure
$sub_part = '_structure';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, $sub_part === null ? '' : $sub_part);
echo "\n";
if (isset($message)) {
echo Util::getMessage($message, $sql_query);
unset($message);
}
$db_collation = $dbi->getDbCollation($db);
$is_information_schema = $dbi->isSystemSchema($db);
if (! $is_information_schema) {
if ($cfgRelation['commwork']) {
/**
* database comment
*/
$response->addHTML($operations->getHtmlForDatabaseComment($db));
}
$response->addHTML('<div>');
$response->addHTML(CreateTable::getHtml($db));
$response->addHTML('</div>');
/**
* rename database
*/
if ($db != 'mysql') {
$response->addHTML($operations->getHtmlForRenameDatabase($db, $db_collation));
}
// Drop link if allowed
// Don't even try to drop information_schema.
// You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($dbi->isSuperuser() || $cfg['AllowUserDropDatabase'])
&& ! $db_is_system_schema
&& $db != 'mysql'
) {
$response->addHTML($operations->getHtmlForDropDatabaseLink($db));
}
/**
* Copy database
*/
$response->addHTML($operations->getHtmlForCopyDatabase($db, $db_collation));
/**
* Change database charset
*/
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($db, $db_collation));
if (! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
) {
$message = Message::notice(
__(
'The phpMyAdmin configuration storage has been deactivated. ' .
'%sFind out why%s.'
)
);
$message->addParamHtml('<a href="./chk_rel.php" data-post="' . $url_query . '">');
$message->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
if (! empty($cfg['Servers'][$server]['pmadb'])) {
$message->isError(true);
}
} // end if
} // end if (!$is_information_schema)

192
db_qbe.php Normal file
View File

@ -0,0 +1,192 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* query by example the whole database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Qbe;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Message;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\SavedSearches;
use PhpMyAdmin\Sql;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db, $pmaThemeImage, $url_query;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Relation $relation */
$relation = $containerBuilder->get('relation');
/** @var Template $template */
$template = $containerBuilder->get('template');
// Gets the relation settings
$cfgRelation = $relation->getRelationsParam();
$savedSearchList = [];
$savedSearch = null;
$currentSearchId = null;
if ($cfgRelation['savedsearcheswork']) {
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('database/qbe.js');
//Get saved search list.
$savedSearch = new SavedSearches($GLOBALS, $relation);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($db);
if (! empty($_POST['searchId'])) {
$savedSearch->setId($_POST['searchId']);
}
//Action field is sent.
if (isset($_POST['action'])) {
$savedSearch->setSearchName($_POST['searchName']);
if ('create' === $_POST['action']) {
$saveResult = $savedSearch->setId(null)
->setCriterias($_POST)
->save();
} elseif ('update' === $_POST['action']) {
$saveResult = $savedSearch->setCriterias($_POST)
->save();
} elseif ('delete' === $_POST['action']) {
$deleteResult = $savedSearch->delete();
//After deletion, reset search.
$savedSearch = new SavedSearches($GLOBALS, $relation);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($db);
$_POST = [];
} elseif ('load' === $_POST['action']) {
if (empty($_POST['searchId'])) {
//when not loading a search, reset the object.
$savedSearch = new SavedSearches($GLOBALS, $relation);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($db);
$_POST = [];
} else {
$loadResult = $savedSearch->load();
}
}
//Else, it's an "update query"
}
$savedSearchList = $savedSearch->getList();
$currentSearchId = $savedSearch->getId();
}
/**
* A query has been submitted -> (maybe) execute it
*/
$message_to_display = false;
if (isset($_POST['submit_sql']) && ! empty($sql_query)) {
if (0 !== stripos($sql_query, "SELECT")) {
$message_to_display = true;
} else {
$goto = 'db_sql.php';
$sql = new Sql();
$sql->executeQueryAndSendQueryResponse(
null, // analyzed_sql_results
false, // is_gotofile
$_POST['db'], // db
null, // table
false, // find_real_end
null, // sql_query_for_bookmark
null, // extra_data
null, // message_to_show
null, // message
null, // sql_data
$goto, // goto
$pmaThemeImage, // pmaThemeImage
null, // disp_query
null, // disp_message
null, // query_type
$sql_query, // sql_query
null, // selectedTables
null // complete_query
);
}
}
$sub_part = '_qbe';
require ROOT_PATH . 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=db_qbe.php';
$url_params['goto'] = 'db_qbe.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, $sub_part === null ? '' : $sub_part);
if ($message_to_display) {
Message::error(
__('You have to choose at least one column to display!')
)
->display();
}
unset($message_to_display);
// create new qbe search instance
$db_qbe = new Qbe($relation, $template, $dbi, $db, $savedSearchList, $savedSearch);
$secondaryTabs = [
'multi' => [
'link' => 'db_multi_table_query.php',
'text' => __('Multi-table query'),
],
'qbe' => [
'link' => 'db_qbe.php',
'text' => __('Query by example'),
],
];
$response->addHTML(
$template->render('secondary_tabs', [
'url_params' => $url_params,
'sub_tabs' => $secondaryTabs,
])
);
$url = 'db_designer.php' . Url::getCommon(
array_merge(
$url_params,
['query' => 1]
)
);
$response->addHTML(
Message::notice(
sprintf(
__('Switch to %svisual builder%s'),
'<a href="' . $url . '">',
'</a>'
)
)
);
/**
* Displays the Query by example form
*/
$response->addHTML($db_qbe->getSelectionForm());

87
db_routines.php Normal file
View File

@ -0,0 +1,87 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Routines management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\CheckUserPrivileges;
use PhpMyAdmin\Controllers\Database\RoutinesController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var string $db */
$db = $containerBuilder->getParameter('db');
/** @var string $table */
$table = $containerBuilder->getParameter('table');
/** @var CheckUserPrivileges $checkUserPrivileges */
$checkUserPrivileges = $containerBuilder->get('check_user_privileges');
$checkUserPrivileges->getPrivileges();
$_PMA_RTE = 'RTN';
/** @var RoutinesController $controller */
$controller = $containerBuilder->get(RoutinesController::class);
if (! $response->isAjax()) {
/**
* Displays the header and tabs
*/
if (! empty($table) && in_array($table, $dbi->getTables($db))) {
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
} else {
$table = '';
include_once ROOT_PATH . 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}
} else {
/**
* Since we did not include some libraries, we need
* to manually select the required database and
* create the missing $url_query variable
*/
if (strlen($db) > 0) {
$dbi->selectDb($db);
if (! isset($url_query)) {
$url_query = Url::getCommon(
[
'db' => $db,
'table' => $table,
]
);
}
}
}
$controller->index([
'type' => $_REQUEST['type'] ?? null,
]);

85
db_search.php Normal file
View File

@ -0,0 +1,85 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* searches the entire database
*
* @todo make use of UNION when searching multiple tables
* @todo display executed query, optional?
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Database\Search;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db, $url_query;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var Template $template */
$template = $containerBuilder->get('template');
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('database/search.js');
$scripts->addFile('vendor/stickyfill.min.js');
$scripts->addFile('sql.js');
$scripts->addFile('makegrid.js');
require ROOT_PATH . 'libraries/db_common.inc.php';
// If config variable $GLOBALS['cfg']['UseDbSearch'] is on false : exit.
if (! $GLOBALS['cfg']['UseDbSearch']) {
Util::mysqlDie(
__('Access denied!'),
'',
false,
$err_url
);
} // end if
$url_query .= '&amp;goto=db_search.php';
$url_params['goto'] = 'db_search.php';
// Create a database search instance
$db_search = new Search($dbi, $db, $template);
// Display top links if we are not in an Ajax request
if (! $response->isAjax()) {
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}
// Main search form has been submitted, get results
if (isset($_POST['submit_search'])) {
$response->addHTML($db_search->getSearchResults());
}
// If we are in an Ajax request, we need to exit after displaying all the HTML
if ($response->isAjax() && empty($_REQUEST['ajax_page_request'])) {
exit;
}
// Display the search form
$response->addHTML($db_search->getMainHtml());

49
db_sql.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database SQL executor
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\SqlController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\SqlQueryForm;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $containerBuilder;
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var SqlController $controller */
$controller = $containerBuilder->get(SqlController::class);
/** @var SqlQueryForm $sqlQueryForm */
$sqlQueryForm = $containerBuilder->get('sql_query_form');
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('makegrid.js');
$scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
$scripts->addFile('vendor/stickyfill.min.js');
$scripts->addFile('sql.js');
$response->addHTML(
$controller->index(
[
'delimiter' => $_POST['delimiter'] ?? null,
],
$sqlQueryForm
)
);

41
db_sql_autocomplete.php Normal file
View File

@ -0,0 +1,41 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Table/Column autocomplete in SQL editors
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) {
$db = isset($_POST['db']) ? $_POST['db'] : $GLOBALS['db'];
$sql_autocomplete = [];
if ($db) {
$tableNames = $dbi->getTables($db);
foreach ($tableNames as $tableName) {
$sql_autocomplete[$tableName] = $dbi->getColumns(
$db,
$tableName
);
}
}
} else {
$sql_autocomplete = true;
}
$response->addJSON("tables", json_encode($sql_autocomplete));

27
db_sql_format.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Format SQL for SQL editors
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
/**
* Loading common files. Used to check for authorization, localization and to
* load the parsing library.
*/
require_once ROOT_PATH . 'libraries/common.inc.php';
$query = ! empty($_POST['sql']) ? $_POST['sql'] : '';
$query = PhpMyAdmin\SqlParser\Utils\Formatter::format($query);
$response = Response::getInstance();
$response->addJSON("sql", $query);

62
db_structure.php Normal file
View File

@ -0,0 +1,62 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database structure manipulation
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\StructureController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
require_once ROOT_PATH . 'libraries/db_common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
/** @var StructureController $controller */
$controller = $containerBuilder->get(StructureController::class);
if ($response->isAjax() && ! empty($_REQUEST['favorite_table'])) {
$json = $controller->addRemoveFavoriteTablesAction([
'favorite_table' => $_REQUEST['favorite_table'],
'favoriteTables' => $_REQUEST['favoriteTables'] ?? null,
'sync_favorite_tables' => $_REQUEST['sync_favorite_tables'] ?? null,
'add_favorite' => $_REQUEST['add_favorite'] ?? null,
'remove_favorite' => $_REQUEST['remove_favorite'] ?? null,
]);
if ($json !== null) {
$response->addJSON($json);
}
} elseif ($response->isAjax()
&& isset($_REQUEST['real_row_count'])
&& (bool) $_REQUEST['real_row_count'] === true
) {
$response->addJSON($controller->handleRealRowCountRequestAction([
'real_row_count_all' => $_REQUEST['real_row_count_all'] ?? null,
'table' => $_REQUEST['table'] ?? null,
]));
} else {
$response->getHeader()->getScripts()->addFiles([
'database/structure.js',
'table/change.js',
]);
$response->addHTML($controller->index([
'submit_mult' => $_POST['submit_mult'] ?? null,
'selected_tbl' => $_POST['selected_tbl'] ?? null,
'mult_btn' => $_POST['mult_btn'] ?? null,
'sort' => $_REQUEST['sort'] ?? null,
'sort_order' => $_REQUEST['sort_order'] ?? null,
]));
}

129
db_tracking.php Normal file
View File

@ -0,0 +1,129 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Tracking configuration for database
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Display\CreateTable;
use PhpMyAdmin\Message;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Tracker;
use PhpMyAdmin\Tracking;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $db, $pmaThemeImage, $text_dir, $url_query;
require_once ROOT_PATH . 'libraries/common.inc.php';
//Get some js files needed for Ajax requests
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/jquery/jquery.tablesorter.js');
$scripts->addFile('database/tracking.js');
/** @var Tracking $tracking */
$tracking = $containerBuilder->get('tracking');
/**
* If we are not in an Ajax request, then do the common work and show the links etc.
*/
require ROOT_PATH . 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
$url_params['goto'] = 'tbl_tracking.php';
$url_params['back'] = 'db_tracking.php';
// Get the database structure
$sub_part = '_structure';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, $sub_part === null ? '' : $sub_part);
if (isset($_POST['delete_tracking']) && isset($_POST['table'])) {
Tracker::deleteTracking($db, $_POST['table']);
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif (isset($_POST['submit_create_version'])) {
$tracking->createTrackingForMultipleTables($_POST['selected']);
Message::success(
sprintf(
__(
'Version %1$s was created for selected tables,'
. ' tracking is active for them.'
),
htmlspecialchars($_POST['version'])
)
)->display();
} elseif (isset($_POST['submit_mult'])) {
if (! empty($_POST['selected_tbl'])) {
if ($_POST['submit_mult'] == 'delete_tracking') {
foreach ($_POST['selected_tbl'] as $table) {
Tracker::deleteTracking($db, $table);
}
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif ($_POST['submit_mult'] == 'track') {
echo $tracking->getHtmlForDataDefinitionAndManipulationStatements(
'db_tracking.php' . $url_query,
0,
$db,
$_POST['selected_tbl']
);
exit;
}
} else {
Message::notice(
__('No tables selected.')
)->display();
}
}
// Get tracked data about the database
$data = Tracker::getTrackedData($db, '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) === 0) {
echo '<p>' , __('No tables found in database.') , '</p>' , "\n";
if (empty($db_is_system_schema)) {
echo CreateTable::getHtml($db);
}
exit;
}
// ---------------------------------------------------------------------------
echo $tracking->getHtmlForDbTrackingTables(
$db,
$url_query,
$pmaThemeImage,
$text_dir
);
// If available print out database log
if (count($data['ddlog']) > 0) {
$log = '';
foreach ($data['ddlog'] as $entry) {
$log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n"
. $entry['statement'] . "\n";
}
echo Util::getMessage(__('Database Log'), $log);
}

80
db_triggers.php Normal file
View File

@ -0,0 +1,80 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Triggers management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\TriggersController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'libraries/common.inc.php';
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
$_PMA_RTE = 'TRI';
/** @var TriggersController $controller */
$controller = $containerBuilder->get(TriggersController::class);
/** @var string $db */
$db = $containerBuilder->getParameter('db');
/** @var string $table */
$table = $containerBuilder->getParameter('table');
if (! $response->isAjax()) {
/**
* Displays the header and tabs
*/
if (! empty($table) && in_array($table, $dbi->getTables($db))) {
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
} else {
$table = '';
include_once ROOT_PATH . 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}
} else {
/**
* Since we did not include some libraries, we need
* to manually select the required database and
* create the missing $url_query variable
*/
if (strlen($db) > 0) {
$dbi->selectDb($db);
if (! isset($url_query)) {
$url_query = Url::getCommon(
[
'db' => $db,
'table' => $table,
]
);
}
}
}
$controller->index();

6
doc/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
*.swp
/_build
/doctrees
/html
/locale
*.pyc

View File

@ -9,7 +9,7 @@ BUILDDIR = .
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://www.sphinx-doc.org/)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.

View File

@ -24,7 +24,7 @@ A window layer "Display chart" is shown in which you can customize the chart wit
Chart implementation
--------------------
Charts in phpMyAdmin are drawn using the `Chart.js <https://www.chartjs.org/>`_ library.
Charts in phpMyAdmin are drawn using `jqPlot <http://www.jqplot.com/>`_ jQuery library.
Examples
--------

View File

@ -44,14 +44,14 @@ master_doc = 'index'
# General information about the project.
project = u'phpMyAdmin'
copyright = u'2012 - 2026, The phpMyAdmin devel team'
copyright = u'2012 - 2020, The phpMyAdmin devel team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '6.0.0-dev'
version = '5.0.5-dev'
# The full version, including alpha/beta/rc tags.
release = version
@ -100,12 +100,6 @@ pygments_style = 'sphinx'
# a list of builtin themes.
html_theme = 'default'
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
except:
print('WARNING: The python module sphinx_rtd_theme was not found, using the default theme. Debian package: python3-sphinx-rtd-theme')
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
@ -321,4 +315,8 @@ linkcheck_ignore = [
r'https://authy.com/.*',
# Site often changes links and reverts changes (9362bde02d0535a2f8cb74a18797249cb734c4b0)
r'https://www.yubico.com/.*',
# 500 Server Error: Internal Server Error
r'http://www.scriptalicious.com/.*',
# Some timeouts and SSL issues: https://github.com/sektioneins/suhosin/issues/119
r'https://suhosin.org/.*',
]

File diff suppressed because it is too large Load Diff

View File

@ -34,9 +34,9 @@ Third party licenses
phpMyAdmin includes several third-party libraries which come under their
respective licenses.
jQuery's license, which is where we got the files under public/js/vendor/jquery/ is
jQuery's license, which is where we got the files under js/vendor/jquery/ is
(MIT|GPL), a copy of each license is available in this repository (GPL
is available as LICENSE, MIT as public/js/vendor/jquery/MIT-LICENSE.txt).
is available as LICENSE, MIT as js/vendor/jquery/MIT-LICENSE.txt).
The download kit additionally includes several composer libraries. See their
licensing information in the vendor/ directory.

View File

@ -178,7 +178,7 @@ Credits, in chronological order
* Maxime Delorme <delorme.maxime\_at\_free.fr>
* :term:`PDF` schema output, thanks also to
Olivier Plathey for the "FPDF" library (see <https://www.fpdf.org/>), Steven
Olivier Plathey for the "FPDF" library (see <http://www.fpdf.org/>), Steven
Wittens for the "UFPDF" library and
Nicola Asuni for the "TCPDF" library (see <https://tcpdf.org/>).
@ -825,7 +825,6 @@ Following people have contributed to translation of phpMyAdmin:
* Spanish
* Daniel Hinostroza, MD <phpmyadmin\_at\_cerebroperiferico.com>
* Luis García Sevillano <floss.dev\_at\_gmail.com>
* Franco <fulanodetal.github1\_at\_openaliasbox.org>
* Luis Ruiz <luisan00\_at\_hotmail.com>

View File

@ -63,7 +63,7 @@ Please use instead the cookie authentication mode.
This seems to be a PWS bug. Filippo Simoncini found a workaround (at
this time there is no better fix): remove or comment the ``DOCTYPE``
declarations (2 lines) from the scripts :file:`src/Header.php`
declarations (2 lines) from the scripts :file:`libraries/classes/Header.php`
and :file:`index.php`.
.. _faq1_7:
@ -244,8 +244,8 @@ phpMyAdmin tried to load the extension but failed. Usually, the
problem is solved by installing a software package called "PHP-MySQL"
or something similar.
There was two interfaces PHP provided as MySQL extensions - ``mysql``
and ``mysqli``. The ``mysql`` interface was removed in PHP 7.0.
There are currently two interfaces PHP provides as MySQL extensions - ``mysql``
and ``mysqli``. The ``mysqli`` is tried first, because it's the best one.
This problem can be also caused by wrong paths in the :file:`php.ini` or using
wrong :file:`php.ini`.
@ -268,9 +268,10 @@ can tell it to use specific path for this file using ``PHPIniDir`` directive:
.. code-block:: apache
LoadModule php7_module "C:/php7/php7apache2_4.dll"
<IfModule php7_module>
PHPIniDir "C:/php7"
LoadFile "C:/php/php5ts.dll"
LoadModule php5_module "C:/php/php5apache2_2.dll"
<IfModule php5_module>
PHPIniDir "C:/PHP"
<Location>
AddType text/html .php
AddHandler application/x-httpd-php .php
@ -354,7 +355,7 @@ PHP scripts. Of course you have to restart Apache.
This is a permission problem. Right-click on the phpmyadmin folder and
choose properties. Under the tab Security, click on "Add" and select
the user "IUSR\_machine" from the list. Now set their permissions and it
the user "IUSR\_machine" from the list. Now set his permissions and it
should work.
.. _faq1_27:
@ -435,8 +436,6 @@ PHP 7.2 is supported since 4.7.4.
HHVM is supported up to phpMyAdmin 4.8.
Since release 5.0, phpMyAdmin supports only PHP 7.1 and newer.
Since release 5.2, phpMyAdmin supports only PHP 7.2 and newer.
Since release 6.0, phpMyAdmin supports only PHP 8.2 and newer.
.. _faq1_32:
@ -494,11 +493,6 @@ forget to change directory name inside of it):
.. seealso:: :ref:`faq4_8`
.. versionchanged:: 5.1.0
Support for using the ``target`` parameter was removed in phpMyAdmin 5.1.0.
Use the ``route`` parameter instead.
.. _faq1_35:
1.35 Can I use HTTP authentication with Apache CGI?
@ -532,8 +526,65 @@ extension which works fine in this case.
.. _faq1_38:
1.38 (withdrawn).
-----------------
1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled?
------------------------------------------------------------------
Yes but the default configuration values of Suhosin are known to cause
problems with some operations, for example editing a table with many
columns and no :term:`primary key` or with textual :term:`primary key`.
Suhosin configuration might lead to malfunction in some cases and it
can not be fully avoided as phpMyAdmin is kind of application which
needs to transfer big amounts of columns in single HTTP request, what
is something what Suhosin tries to prevent. Generally all
``suhosin.request.*``, ``suhosin.post.*`` and ``suhosin.get.*``
directives can have negative effect on phpMyAdmin usability. You can
always find in your error logs which limit did cause dropping of
variable, so you can diagnose the problem and adjust matching
configuration variable.
The default values for most Suhosin configuration options will work in
most scenarios, however you might want to adjust at least following
parameters:
* `suhosin.request.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-request-max-vars>`_ should
be increased (eg. 2048)
* `suhosin.post.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-post-max-vars>`_ should be
increased (eg. 2048)
* `suhosin.request.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.post.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.request.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-totalname-length>`_
should be increased (eg. 8192)
* `suhosin.post.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-totalname-length>`_ should be
increased (eg. 8192)
* `suhosin.get.max\_value\_length <https://suhosin.org/stories/configuration.html#suhosin-get-max-value-length>`_
should be increased (eg. 1024)
* `suhosin.sql.bailout\_on\_error <https://suhosin.org/stories/configuration.html#suhosin-sql-bailout-on-error>`_
needs to be disabled (the default)
* `suhosin.log.\* <https://suhosin.org/stories/configuration.html#logging-configuration>`_ should not
include :term:`SQL`, otherwise you get big
slowdown
* `suhosin.sql.union <https://suhosin.org/stories/configuration.html#suhosin-
sql-union>`_ must be disabled (which is the default).
* `suhosin.sql.multiselect <https://suhosin.org/stories/configuration.html#
suhosin-sql-multiselect>`_ must be disabled (which is the default).
* `suhosin.sql.comment <https://suhosin.org/stories/configuration.html#suhosin-
sql-comment>`_ must be disabled (which is the default).
To further improve security, we also recommend these modifications:
* `suhosin.executor.include.max\_traversal <https://suhosin.org/stories/
configuration.html#suhosin-executor-include-max-traversal>`_ should be
enabled as a mitigation against local file inclusion attacks. We suggest
setting this to 2 as ``../`` is used with the ReCaptcha library.
* `suhosin.cookie.encrypt <https://suhosin.org/stories/configuration.html#
suhosin-cookie-encrypt>`_ should be enabled.
* `suhosin.executor.disable_emodifier <https://suhosin.org/stories/config
uration.html#suhosin-executor-disable-emodifier>`_ should be enabled.
You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`.
.. _faq1_39:
@ -630,19 +681,16 @@ Some users have requested to be able to reduce the size of the phpMyAdmin instal
This is not recommended and could lead to confusion over missing features, but can be done.
A list of files and corresponding functionality which degrade gracefully when removed include:
* :file:`./resources/locale/` folder, or unused subfolders (interface translations)
* Any unused themes in :file:`./public/themes/` except the default theme `pmahomme`.
* :file:`./app/language_stats.inc.php` (translation statistics)
* :file:`./docs/` (documentation)
* :file:`./vendor/tecnickcom/tcpdf` folder (exporting to PDF)
* :file:`./locale/` folder, or unused subfolders (interface translations)
* Any unused themes in :file:`./themes/`
* :file:`./js/vendor/jquery/src/` (included for licensing reasons)
* :file:`./js/line_counts.php` (removed in phpMyAdmin 4.8)
* :file:`./doc/` (documentation)
* :file:`./setup/` (setup script)
* :file:`./examples/` (configuration examples)
* :file:`./resources/sql/` (SQL scripts to configure advanced functionalities)
* :file:`./resources/js/` (Source files to re-build `./public/js/`)
* Run `rm -rv vendor/tecnickcom/tcpdf && composer dump-autoload --no-interaction --optimize --dev` (exporting to PDF)
* Run `rm -rv vendor/williamdes/mariadb-mysql-kbs && composer dump-autoload --no-interaction --optimize --dev` (external links to MariaDB and MySQL documentations)
* Run `rm -rv vendor/code-lts/u2f-php-server && composer dump-autoload --no-interaction --optimize --dev` (U2F second factor authentication)
* Run `rm -rv vendor/pragmarx/* && composer dump-autoload --no-interaction --optimize --dev` (2FA second factor authentication)
* Run `rm -rv vendor/bacon/bacon-qr-code && composer dump-autoload --no-interaction --optimize --dev` (QRcode generation for 2FA second factor authentication)
* :file:`./examples/`
* :file:`./sql/` (SQL scripts to configure advanced functionality)
* :file:`./js/vendor/openlayers/` (GIS visualization)
.. _faq1_45:
@ -668,27 +716,6 @@ can be set to use the older authentication with a command such as
.. seealso:: <https://github.com/phpmyadmin/phpmyadmin/issues/14220>, <https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0>, <https://bugs.php.net/bug.php?id=76243>
.. _faq1_46:
1.46 Missing ``HTTP_HOST`` variable when using nginx with HTTP/3
-----------------------------------------------------------------------------------------------------------
When using phpMyAdmin with nginx and HTTP/3 enabled, the ``HTTP_HOST`` variable may be missing due to a known issue with nginx's HTTP/3 implementation, which can cause several issues:
- Two-factor authentication won't work
- Exported settings have no hostname in the filename (e.g., ``phpMyAdmin-config-.json``)
- The hostname is missing from the page title (empty ``@HTTP_HOST@``)
To fix this issue, add the following line to your nginx configuration:
.. code-block:: nginx
fastcgi_param HTTP_HOST $host;
This line should be placed in the server block of your nginx configuration where the PHP-FPM settings are defined.
.. seealso:: <https://github.com/php/php-src/issues/13021>, <https://github.com/nginx/nginx/issues/455>, <https://trac.nginx.org/nginx/ticket/2281>, <https://mailman.nginx.org/pipermail/nginx-devel/2024-January/3CQEHII5QU2BTQ7L7DAVCBWK3OQS3GU6.html>
.. _faqconfig:
Configuration
@ -814,6 +841,8 @@ Here are a few points to check:
Dorninger for the hint).
* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";"
will cause this error. Replace it with "&;".
* If you are using `Suhosin <https://suhosin.org/stories/index.html>`_, you
might want to increase `request limits <https://suhosin.org/stories/faq.html>`_.
* The directory specified in the :file:`php.ini` directive
``session.save_path`` does not exist or is read-only (this can be caused
by `bug in the PHP installer <https://bugs.php.net/bug.php?id=39842>`_).
@ -824,43 +853,15 @@ Here are a few points to check:
---------------------------------
To be able to see a progress bar during your uploads, your server must
have the `uploadprogress <https://pecl.php.net/package/uploadprogress>`_ extension enabled.
have the `uploadprogress <https://pecl.php.net/package/uploadprogress>`_ extension, and
you must be running PHP 5.4.0 or higher. Moreover, the JSON extension
has to be enabled in your PHP.
You must set ``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`.
However, starting from phpMyAdmin version 4.0.4, session-based upload progress has
If using PHP 5.4.0 or higher, you must set
``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`. However,
starting from phpMyAdmin version 4.0.4, session-based upload progress has
been temporarily deactivated due to its problematic behavior.
.. _faq2_10:
2.10 How to generate a string of random bytes
---------------------------------------------
One way to generate a string of random bytes suitable for cryptographic use is using the
`random_bytes <https://www.php.net/random_bytes>`_ :term:`PHP` function. Since this function returns a binary string,
the returned value should be converted to printable format before being able to copy it.
For example, the :config:option:`$cfg['blowfish_secret']` configuration directive requires a 32-bytes long string. The
following command can be used to generate a hexadecimal representation of this string.
.. code-block:: sh
php -r 'echo bin2hex(random_bytes(32)) . PHP_EOL;'
The above example will output something similar to:
.. code-block:: sh
f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851
And then this hexadecimal value can be used in the configuration file.
.. code-block:: php
$cfg['blowfish_secret'] = sodium_hex2bin('f16ce59f45714194371b48fe362072dc3b019da7861558cd4ad29e4d6fb13851');
The `sodium_hex2bin <https://www.php.net/sodium_hex2bin>`_ function is used here to convert the hexadecimal value back to the
binary format.
.. _faqlimitations:
Known limitations
@ -1146,7 +1147,7 @@ Starting with 2.2.5, in the user management page, you can enter a
wildcard database name for a user (for example "joe%"), and put the
privileges you want. For example, adding ``SELECT, INSERT, UPDATE,
DELETE, CREATE, DROP, INDEX, ALTER`` would let a user create/manage
their database(s).
his/her database(s).
.. _faq4_6:
@ -1168,13 +1169,13 @@ network :term:`IP` blocks.
//block root from logging in except from the private networks
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny root from all',
'allow root from localhost',
'allow root from 10.0.0.0/8',
'allow root from 192.168.0.0/16',
'allow root from 172.16.0.0/12',
];
);
.. _faq4_7:
@ -1305,7 +1306,7 @@ by the recent versions of the most browsers.
5.12 Mac OS X Safari browser changes special characters to "?".
---------------------------------------------------------------
This issue has been reported by a :term:`macOS` user, who adds that Chimera,
This issue has been reported by a :term:`Mac OS X` user, who adds that Chimera,
Netscape and Mozilla do not have this problem.
.. _faq5_13:
@ -1403,7 +1404,7 @@ This is usually caused by web application firewall doing requests filtering. It
tries to prevent SQL injection, however phpMyAdmin is tool designed to execute
SQL queries, thus it makes it unusable.
Please allow phpMyAdmin scripts from the web application firewall settings
Please whitelist phpMyAdmin scripts from the web application firewall settings
or disable it completely for phpMyAdmin path.
Programs known to cause these kind of errors:
@ -1526,7 +1527,7 @@ create the example tables:
To setup appropriate links and display information:
* on table "REL\_persons" click Structure, then Relation view
* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "town\_code"
* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "code"
for foreign database, table and column respectively
* for "country\_code", choose from dropdowns, "mydb", "REL\_countries",
"country\_code" for foreign database, table and column respectively
@ -1565,15 +1566,33 @@ enables: drop-down list of possible values.
--------------------------------------------------
First the configuration variables "relation", "table\_coords" and
"pdf\_pages" have to be filled in.
"pdf\_pages" have to be filled in. Then you need to think about your
schema layout. Which tables will go on which pages?
* Select your database in the navigation panel.
* Choose ":guilabel:`Designer`" in the navigation bar at the top.
* Move the tables the way you want them.
* Choose ":guilabel:`Export schema`" in the left menu.
* The export modal will open.
* Select the type of export to :term:`PDF`, you may adjust the other settings.
* Submit the form and the file will start downloading.
* Choose "Operations" in the navigation bar at the top.
* Choose "Edit :term:`PDF` Pages" near the
bottom of the page.
* Enter a name for the first :term:`PDF` page
and click Go. If you like, you can use the "automatic layout," which
will put all your linked tables onto the new page.
* Select the name of the new page (making sure the Edit radio button is
selected) and click Go.
* Select a table from the list, enter its coordinates and click Save.
Coordinates are relative; your diagram will be automatically scaled to
fit the page. When initially placing tables on the page, just pick any
coordinates -- say, 50x50. After clicking Save, you can then use the
:ref:`wysiwyg` to position the element correctly.
* When you'd like to look at your :term:`PDF`, first be sure to click the Save
button beneath the list of tables and coordinates, to save any changes you
made there. Then scroll all the way down, select the :term:`PDF` options you
want, and click Go.
* Internet Explorer for Windows may suggest an incorrect filename when
you try to save a generated :term:`PDF`.
When saving a generated :term:`PDF`, be
sure that the filename ends in ".pdf", for example "schema.pdf".
Browsers on other operating systems, and other browsers on Windows, do
not have this problem.
.. seealso::
@ -1623,7 +1642,7 @@ It means "average".
any) will be included in backup.
* "Enclose table and column names with backquotes" ensures that column
and table names formed with special characters are protected.
* "Add into comments" includes column comments, relations, and media
* "Add into comments" includes column comments, relations, and media (MIME)
types set in the pmadb in the dump as :term:`SQL` comments
(*/\* xxx \*/*).
@ -1689,7 +1708,7 @@ user-input situation. Instead you have to initialize mimetypes using
functions or empty mimetype definitions.
Plus, you have a whole overview of available mimetypes. Who knows all those
mimetypes by heart so they can enter it at will?
mimetypes by heart so he/she can enter it at will?
.. _faqbookmark:
@ -1818,10 +1837,31 @@ name), but the following variables can be used:
``@PHPMYADMIN@``
phpMyAdmin with version
.. _faq6_28:
.. _wysiwyg:
6.28 (withdrawn).
-----------------
6.28 How can I easily edit relational schema for export?
--------------------------------------------------------
By clicking on the button 'toggle scratchboard' on the page where you
edit x/y coordinates of those elements you can activate a scratchboard
where all your elements are placed. By clicking on an element, you can
move them around in the pre-defined area and the x/y coordinates will
get updated dynamically. Likewise, when entering a new position
directly into the input field, the new position in the scratchboard
changes after your cursor leaves the input field.
You have to click on the 'OK'-button below the tables to save the new
positions. If you want to place a new element, first add it to the
table of elements and then you can drag the new element around.
By changing the paper size and the orientation you can change the size
of the scratchboard as well. You can do so by just changing the
dropdown field below, and the scratchboard will resize automatically,
without interfering with the current placement of the elements.
If ever an element gets out of range you can either enlarge the paper
size or click on the 'reset' button to place all elements below each
other.
.. _faq6_29:
@ -1899,7 +1939,7 @@ to plot' field. Once you have decided over your criteria, click 'Go'
to display the plot.
After the plot is generated, you can use the
mouse wheel to zoom in and out of the plot. In addition, panning
mousewheel to zoom in and out of the plot. In addition, panning
feature is enabled to navigate through the plot. You can zoom-in to a
certain level of detail and use panning to locate your area of
interest. Clicking on a point opens a dialogue box, displaying field
@ -2190,13 +2230,12 @@ authentication to the Apache environment and it can be used in Apache
logs. Currently there are two variables available:
``userID``
User name of currently active user (they do not have to be logged in).
User name of currently active user (he does not have to be logged in).
``userStatus``
Status of currently active user, one of ``ok`` (user is logged in),
``server-denied`` (database server denied user login), ``allow-denied`` (user denied
``mysql-denied`` (MySQL denied user login), ``allow-denied`` (user denied
by allow/deny rules), ``root-denied`` (root is denied in configuration),
``empty-denied`` (empty password is denied),
``no-activity`` (automatically logged out due to inactivity).
``empty-denied`` (empty password is denied).
``LogFormat`` directive for Apache can look like following:
@ -2228,7 +2267,7 @@ differentiate between a desired text output and a formula that should be escaped
definitions should not be interpreted anyway. We have discussed this at length and feel it is the responsibility of the
spreadsheet program to properly parse and sanitize such data on input instead.
Google also has a `similar view <https://bughunters.google.com/learn/invalid-reports/google-products/4965108570390528/csv-formula-injection>`_.
Google also has a `similar view <https://sites.google.com/site/bughunteruniversity/nonvuln/csv-excel-formula-injection>`_.
.. _faqsynchronization:

422
doc/glossary.rst Normal file
View File

@ -0,0 +1,422 @@
.. _glossary:
Glossary
========
From Wikipedia, the free encyclopedia
.. glossary::
.htaccess
the default name of Apache's directory-level configuration file.
.. seealso:: <https://en.wikipedia.org/wiki/.htaccess>
ACL
Access Control List
Blowfish
a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier.
.. seealso:: <https://en.wikipedia.org/wiki/Blowfish_(cipher)>
Browser
a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/Web_browser>
bzip2
a free software/open-source data compression algorithm and program developed by Julian Seward.
.. seealso:: <https://en.wikipedia.org/wiki/Bzip2>
CGI
Common Gateway Interface is an important World Wide Web technology that
enables a client web browser to request data from a program executed on
the Web server.
.. seealso:: <https://en.wikipedia.org/wiki/Common_Gateway_Interface>
Changelog
a log or record of changes made to a project.
.. seealso:: <https://en.wikipedia.org/wiki/Changelog>
Client
a computer system that accesses a (remote) service on another computer by some kind of network.
.. seealso:: <https://en.wikipedia.org/wiki/Client_(computing)>
column
a set of data values of a particularly simple type, one for each row of the table.
.. seealso:: <https://en.wikipedia.org/wiki/Column_(database)>
Cookie
a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server.
.. seealso:: <https://en.wikipedia.org/wiki/HTTP_cookie>
CSV
Comma-separated values
.. seealso:: <https://en.wikipedia.org/wiki/Comma-separated_values>
DB
look at :term:`database`
database
an organized collection of data.
.. seealso:: <https://en.wikipedia.org/wiki/Database>
Engine
look at :term:`Storage Engines`
extension
a PHP module that extends PHP with additional functionality.
.. seealso:: <https://en.wikipedia.org/wiki/Software_extension>
FAQ
Frequently Asked Questions is a list of commonly asked question and there
answers.
.. seealso:: <https://en.wikipedia.org/wiki/FAQ>
Field
one part of divided data/columns.
.. seealso:: <https://en.wikipedia.org/wiki/Field_(computer_science)>
foreign key
a column or group of columns in a database row that points to a key column
or group of columns forming a key of another database row in some
(usually different) table.
.. seealso:: <https://en.wikipedia.org/wiki/Foreign_key>
GD
Graphics Library by Thomas Boutell and others for dynamically manipulating images.
.. seealso:: <https://en.wikipedia.org/wiki/GD_Graphics_Library>
GD2
look at :term:`GD`
GZip
gzip is short for GNU zip, a GNU free software file compression program.
.. seealso:: <https://en.wikipedia.org/wiki/Gzip>
host
any machine connected to a computer network, a node that has a hostname.
.. seealso:: <https://en.wikipedia.org/wiki/Host>
hostname
the unique name by which a network-attached device is known on a network.
.. seealso:: <https://en.wikipedia.org/wiki/Hostname>
HTTP
HyperText Transfer Protocol is the primary method used to transfer or
convey information on the World Wide Web.
.. seealso:: <https://en.wikipedia.org/wiki/HyperText_Transfer_Protocol>
https
a :term:`HTTP`-connection with additional security measures.
.. seealso:: <https://en.wikipedia.org/wiki/Https:_URI_scheme>
IEC
International Electrotechnical Commission
IIS
Internet Information Services is a set of Internet-based services for
servers using Microsoft Windows.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Information_Services>
Index
a feature that allows quick access to the rows in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Index_(database)>
IP
Internet Protocol is a data-oriented protocol used by source and
destination hosts for communicating data across a packet-switched
internetwork.
.. seealso:: <https://en.wikipedia.org/wiki/Internet_Protocol>
IP Address
a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard.
.. seealso:: <https://en.wikipedia.org/wiki/IP_Address>
IPv6
IPv6 (Internet Protocol version 6) is the latest revision of the
Internet Protocol (:term:`IP`), designed to deal with the
long-anticipated problem of its predecessor IPv4 running out of addresses.
.. seealso:: <https://en.wikipedia.org/wiki/IPv6>
ISAPI
Internet Server Application Programming Interface is the API of Internet Information Services (IIS).
.. seealso:: <https://en.wikipedia.org/wiki/ISAPI>
ISP
An Internet service provider is a business or organization that offers users
access to the Internet and related services.
.. seealso:: <https://en.wikipedia.org/wiki/ISP>
ISO
International Standards Organization
JPEG
a most commonly used standard method of lossy compression for photographic images.
.. seealso:: <https://en.wikipedia.org/wiki/JPEG>
JPG
look at :term:`JPEG`
Key
look at :term:`Index`
LATEX
a document preparation system for the TEX typesetting program.
.. seealso:: <https://en.wikipedia.org/wiki/LaTeX>
Mac
Apple Macintosh is a line of personal computers is designed, developed, manufactured, and marketed by Apple Computer.
.. seealso:: <https://en.wikipedia.org/wiki/Mac>
Mac OS X
the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets.
.. seealso:: <https://en.wikipedia.org/wiki/Mac_OS_X>
mbstring
The PHP `mbstring` functions provide support for languages represented by multi-byte character sets, most notably UTF-8.
If you have troubles installing this extension, please follow :ref:`faqmysql`, it provides useful hints.
.. seealso:: <https://www.php.net/manual/en/book.mbstring.php>
Media type
A media type (formerly known as MIME type) is a two-part identifier
for file formats and format contents transmitted on the Internet.
.. seealso:: <https://en.wikipedia.org/wiki/Media_type>
MIME
Multipurpose Internet Mail Extensions is
an Internet Standard for the format of e-mail.
.. seealso:: <https://en.wikipedia.org/wiki/MIME>
module
some sort of extension for the Apache Webserver.
.. seealso:: <https://en.wikipedia.org/wiki/Apache_HTTP_Server>
mod_proxy_fcgi
an Apache module implementing a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or
directly as an Apache module.
MySQL
a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS).
.. seealso:: <https://en.wikipedia.org/wiki/MySQL>
mysqli
the improved MySQL client PHP extension.
.. seealso:: <https://www.php.net/manual/en/book.mysqli.php>
mysql
the MySQL client PHP extension.
.. seealso:: <https://www.php.net/manual/en/book.mysql.php>
OpenDocument
an open standard for office documents.
.. seealso:: <https://en.wikipedia.org/wiki/OpenDocument>
OS X
look at :term:`Mac OS X`.
.. seealso:: <https://en.wikipedia.org/wiki/OS_X>
PDF
Portable Document Format is a file format developed by Adobe Systems for
representing two-dimensional documents in a device-independent and
resolution-independent format.
.. seealso:: <https://en.wikipedia.org/wiki/Portable_Document_Format>
PEAR
the PHP Extension and Application Repository.
.. seealso:: <https://pear.php.net/>
PCRE
Perl Compatible Regular Expressions is the perl-compatible regular
expression functions for PHP
.. seealso:: <https://www.php.net/pcre>
PHP
short for "PHP: Hypertext Preprocessor", is an open-source, reflective
programming language used mainly for developing server-side applications
and dynamic web content, and more recently, a broader range of software
applications.
.. seealso:: <https://en.wikipedia.org/wiki/PHP>
port
a connection through which data is sent and received.
.. seealso:: <https://en.wikipedia.org/wiki/Port_(computing)>
primary key
A primary key is an index over one or more fields in a table with
unique values for every single row in this table. Every table should have
a primary key for easier accessing/identifying data in this table. There
can only be one primary key per table and it is named always **PRIMARY**.
In fact, a primary key is just an :term:`unique key` with the name
**PRIMARY**. If no primary key is defined MySQL will use first *unique
key* as primary key if there is one.
You can create the primary key when creating the table (in phpMyAdmin
just check the primary key radio buttons for each field you wish to be
part of the primary key).
You can also add a primary key to an existing table with `ALTER` `TABLE`
or `CREATE` `INDEX` (in phpMyAdmin you can just click on 'add index' on
the table structure page below the listed fields).
RFC
Request for Comments (RFC) documents are a series of memoranda
encompassing new research, innovations, and methodologies applicable to
Internet technologies.
.. seealso:: <https://en.wikipedia.org/wiki/Request_for_Comments>
RFC 1952
GZIP file format specification version 4.3
.. seealso:: :rfc:`1952`
Row (record, tuple)
represents a single, implicitly structured data item in a table.
.. seealso:: <https://en.wikipedia.org/wiki/Row_(database)>
Server
a computer system that provides services to other computing systems over a network.
.. seealso:: <https://en.wikipedia.org/wiki/Server_(computing)>
Storage Engines
MySQL can use several different formats for storing data on disk, these
are called storage engines or table types. phpMyAdmin allows a user to
change their storage engine for a particular table through the operations
tab.
Common table types are InnoDB and MyISAM, though many others exist and
may be desirable in some situations.
.. seealso:: <https://dev.mysql.com/doc/refman/5.7/en/storage-engines.html>
socket
a form of inter-process communication.
.. seealso:: <https://en.wikipedia.org/wiki/Unix_domain_socket>
SSL
Secure Sockets Layer is a cryptographic protocol which provides secure
communication on the Internet.
.. seealso:: <https://en.wikipedia.org/wiki/Secure_Sockets_Layer>
Stored procedure
a subroutine available to applications accessing a relational database system
.. seealso:: <https://en.wikipedia.org/wiki/Stored_procedure>
SQL
Structured Query Language
.. seealso:: <https://en.wikipedia.org/wiki/SQL>
table
a set of data elements (cells) that is organized, defined and stored as
horizontal rows and vertical columns where each item can be uniquely
identified by a label or key or by it's position in relation to other
items.
.. seealso:: <https://en.wikipedia.org/wiki/Table_(database)>
tar
a type of archive file format: the Tape ARchive format.
.. seealso:: <https://en.wikipedia.org/wiki/Tar_(file_format)>
TCP
Transmission Control Protocol is one of the core protocols of the
Internet protocol suite.
.. seealso:: <https://en.wikipedia.org/wiki/TCP>
TCPDF
PHP library to generate PDF files.
.. seealso:: <https://tcpdf.org/>
trigger
a procedural code that is automatically executed in response to certain events on a particular table or view in a database
.. seealso:: <https://en.wikipedia.org/wiki/Database_trigger>
unique key
A unique key is an index over one or more fields in a table which has a
unique value for each row. The first unique key will be treated as
:term:`primary key` if there is no *primary key* defined.
URL
Uniform Resource Locator is a sequence of characters, conforming to a
standardized format, that is used for referring to resources, such as
documents and images on the Internet, by their location.
.. seealso:: <https://en.wikipedia.org/wiki/URL>
Webserver
A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages.
.. seealso:: <https://en.wikipedia.org/wiki/Webserver>
XML
Extensible Markup Language is a W3C-recommended general-purpose markup
language for creating special-purpose markup languages, capable of
describing many different kinds of data.
.. seealso:: <https://en.wikipedia.org/wiki/XML>
ZIP
a popular data compression and archival format.
.. seealso:: <https://en.wikipedia.org/wiki/ZIP_(file_format)>
Zlib
an open-source, cross-platform data compression library by Jean-loup Gailly and Mark Adler.
.. seealso:: <https://en.wikipedia.org/wiki/Zlib>

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More