diff --git a/CREDITS b/CREDITS deleted file mode 100644 index 71cc78dca..000000000 --- a/CREDITS +++ /dev/null @@ -1,8 +0,0 @@ -phpMyAdmin - Credits -==================== - - Please have a look to the Documentation.txt or - Documentation.html files, or visit - http://www.phpmyadmin.net/home_page/team.php and - http://www.phpmyadmin.net/home_page/about.php - diff --git a/INSTALL b/INSTALL deleted file mode 100644 index bcc496548..000000000 --- a/INSTALL +++ /dev/null @@ -1,6 +0,0 @@ -phpMyAdmin - Installation -========================= - -Please have a look to the Documentation.txt or Documentation.html files. - - diff --git a/README b/README index 33d529a98..19dee4ddd 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ phpMyAdmin - Readme =================== -Version 3.4.11.1 +Retro Edition 😎 A set of PHP-scripts to manage MySQL over the web. diff --git a/README.VENDOR b/README.VENDOR deleted file mode 100644 index d6f510cb3..000000000 --- a/README.VENDOR +++ /dev/null @@ -1,37 +0,0 @@ -phpMyAdmin - hints for distributing phpMyAdmin -============================================== - -This document is intended to give advices to people who want to -redistribute phpMyAdmin inside other software package such as Linux -distribution or some all in one package including web server and MySQL -server. - -Generally you can customize some basic aspects (paths to some files and -behavior) in libraries/vendor_config.php. - -For example if you want setup script to generate config file in var, -change SETUP_CONFIG_FILE to /var/lib/phpmyadmin/config.inc.php and you -will also probably want to skip directory writable check, so set -SETUP_DIR_WRITABLE to false. - -External libraries ------------------- - -phpMyAdmin includes several external libraries, you might want to -replace them with system ones if they are available, but please note -that you should test whether version you provide is compatible with the -one we ship. - -Currently known list of external libraries: - -js/jquery - jQuery js framework -js/colorpicker - jQuery based color picker - -libraries/php-gettext - php-gettext library -libraries/tcpdf - tcpdf library, modified for our needs! - -# vim: et ts=4 sw=4 sts=4 tw=72 spell spelllang=en_us diff --git a/TODO b/TODO deleted file mode 100644 index 7e9652761..000000000 --- a/TODO +++ /dev/null @@ -1,8 +0,0 @@ -phpMyAdmin - Todo -================= - -We are currently using the Sourceforge Tracker as Todo list: - - http://sourceforge.net/tracker/?atid=377411&group_id=23067&func=browse - --- swix/20010704 diff --git a/contrib/README b/contrib/README deleted file mode 100644 index ac8ef6c8a..000000000 --- a/contrib/README +++ /dev/null @@ -1,20 +0,0 @@ -phpMyAdmin Third Party Contributions -==================================== - -This directory contains various stuff contributed by users that might be -useful to other. There is no guarantee it will work for you. - -Current content of this directory: - -packaging - Contains files needed for creating packages for various - distributions. Please prefer official packages from your vendor if - possible. - -swekey.sample.conf - SweKey authentication configuration example. - -htaccess - Sample Apache configuration for limit access for bots. - -# vim: expandtab ts=4 sw=4 sts=4 tw=78 diff --git a/contrib/htaccess b/contrib/htaccess deleted file mode 100644 index 6eebe0101..000000000 --- a/contrib/htaccess +++ /dev/null @@ -1,19 +0,0 @@ -RewriteEngine on - -# Allow only GET and POST verbs -RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] - -# Ban Typical Vulnerability Scanners and others -# Kick out Script Kiddies -RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] -RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] -RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] - -# Ban Search Engines, Crawlers to your administrative panel -# No reasons to access from bots -# Ultimately Better than the useless robots.txt -# Did google respect robots.txt? -# Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled" -RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|crawleradmin.t-info@telekom.de|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC] -RewriteRule .* - [F] - diff --git a/contrib/swekey.sample.conf b/contrib/swekey.sample.conf deleted file mode 100644 index ebf1aedf0..000000000 --- a/contrib/swekey.sample.conf +++ /dev/null @@ -1,44 +0,0 @@ -# This is a typical file used to enable Swekey hardware authentication. -# -# To activate the Swekey authentication add the following line to your config.inc.php file. -# $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; -# Then rename this file "swekey-pma.conf" and copy it to the /etc directory. -# Add all the Swekey ids you want to grant access to in the file. -# After each Swekey id put the corresponding user name. -# -# If you don't know the id of a Swekey just visit http://www.swekey.com?sel=support -# while your Swekey is connected. -# -# If you need to purchase a Swekey please visit http://phpmyadmin.net/auth_key -# since this link provides funding to PhpMyAdmin. -# - -0000000000000000000000000000763A:root -000000000000000000000000000089E4:steve -0000000000000000000000000000231E:scott - -# -# It is recommended to include the following lines to contact the -# authentication servers in SSL mode. -# - -SERVER_CHECK=https://auth-check-ssl.musbe.net -SERVER_RNDTOKEN=https://auth-rnd-gen-ssl.musbe.net -SERVER_STATUS=https://auth-status-ssl.musbe.net - -# -# The path of the root certificate file used to ensure a secure -# communication with the authentication servers in SSL mode. -# If not specified, will use musbe-ca.crt found in your -# phpMyAdmin/libraries/auth/swekey. -# - -#CA_FILE=/var/http-root/phpmyadmin/libraries/auth/swekey/musbe-ca.crt - -# -# If your server receives many login requests, you can enable the random -# token caching to accelerate the authentication process. -# Token caching is enabled by default. -# - -#ENABLE_TOKEN_CACHE=0 diff --git a/scripts/compress-js b/scripts/compress-js deleted file mode 100755 index ea43782ea..000000000 --- a/scripts/compress-js +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -for file in `find js -name '*.js' -not -name '*min.js'` ; do - mkdir -p sources/`dirname $file` - mv $file sources/$file - java -jar ./scripts/google-javascript-compiler/compiler.jar --js sources/$file --js_output_file $file -done diff --git a/scripts/convertcfg.pl b/scripts/convertcfg.pl deleted file mode 100755 index 69010fde0..000000000 --- a/scripts/convertcfg.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -# -# -# Configuration converter -# Converts from old-style (Pre-2.3) configuration files to new format found in PMA-2.3 -# -# Takes input from STDIN, sends output to STDOUT -# - -while(<>) -{ s/\$cfg(\w+)/\$cfg\[\'$1\'\]/g; - print; - } - - diff --git a/scripts/create-release.sh b/scripts/create-release.sh deleted file mode 100755 index cd91e9945..000000000 --- a/scripts/create-release.sh +++ /dev/null @@ -1,308 +0,0 @@ -#!/bin/sh -# -# vim: expandtab sw=4 ts=4 sts=4: -# - -# More documentation about making a release is available at: -# http://wiki.phpmyadmin.net/pma/Releasing - -# Fail on undefined variables -set -u -# Fail on failure -set -e - -KITS="all-languages english" -COMPRESSIONS="zip-7z tbz txz tgz 7z" - -if [ $# -lt 2 ] -then - echo "Usages:" - echo " create-release.sh [--tag]" - echo "" - echo "If --tag is specified, relase tag is automatically created" - echo "" - echo "Examples:" - echo " create-release.sh 2.9.0-rc1 QA_2_9" - echo " create-release.sh 2.9.0 MAINT_2_9_0 --tag" - exit 65 -fi - - -# 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/TESTING 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 -} - -# Read required parameters -version=$1 -shift -branch=$1 -shift - -cat <set( 'PMA_VERSION', '$version' ); " - - in Documentation.html the 2 lines - " phpMyAdmin $version - Documentation " - "

phpMyAdmin $version Documentation

" - - in README - -Continue (y/n)? -END -read do_release - -if [ "$do_release" != 'y' ]; then - exit 100 -fi - -# Ensure we have tracking branch -ensure_local_branch $branch - -# Create working copy -mkdir -p release -workdir=release/phpMyAdmin-$version -if [ -d $workdir ] ; then - echo "Working directory '$workdir' already exists, please move it out of way" - exit 1 -fi -git clone --local . $workdir -cd $workdir - -# Checkout branch -ensure_local_branch $branch -git checkout $branch - -# Check release version -if ! grep -q "'PMA_VERSION', '$version'" libraries/Config.class.php ; then - echo "There seems to be wrong version in libraries/Config.class.php!" - exit 2 -fi -if ! grep -q "phpMyAdmin $version - Documentation" Documentation.html ; then - echo "There seems to be wrong version in Documentation.html" - exit 2 -fi -if ! grep -q "Version $version\$" README ; then - echo "There seems to be wrong version in README" - exit 2 -fi - -# Cleanup release dir -LC_ALL=C date -u > RELEASE-DATE-${version} - -# Building Documentation.txt -echo "* Generating Documentation.txt" -LC_ALL=C w3m -dump Documentation.html > Documentation.txt - -# Check for gettext support -if [ -d po ] ; then - GETTEXT=1 -else - GETTEXT=0 -fi - -# Generate mo files -if [ $GETTEXT -eq 1 ] ; then - echo "* Generating mo files" - ./scripts/generate-mo - if [ -f ./scripts/remove-incomplete-mo ] ; then - echo "* Removing incomplete translations" - ./scripts/remove-incomplete-mo - fi - echo "* Removing gettext source files" - rm -rf po -fi - -if [ -f ./scripts/compress-js ] ; then - echo "* Compressing javascript files" - ./scripts/compress-js - rm -rf sources -fi - -echo "* Removing unneeded files" - -# Remove test directory from package to avoid Path disclosure messages -# if someone runs /test/wui.php and there are test failures -rm -rf test - -# Remove javascript compiler, no need to ship it -rm -rf scripts/google-javascript-compiler/ - -# Remove scripts which are not useful for user -for s in compress-js create-release.sh generate-mo mergepo.py php2gettext.sh remove_control_m.sh update-po upload-release pending-po pendingpo.py ; do - rm -f scripts/$s -done - -# Remove git metadata -rm -rf .git -find . -name .gitignore -print0 | xargs -0 -r rm -f - -cd .. - -# Prepare all kits -for kit in $KITS ; do - # Copy all files - name=phpMyAdmin-$version-$kit - cp -r phpMyAdmin-$version $name - - # Cleanup translations - cd phpMyAdmin-$version-$kit - scripts/lang-cleanup.sh $kit - rm -f scripts/lang-cleanup.sh - 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 cf $name.tar $name - fi - if [ $comp = tbz ] ; then - echo "* Creating $name.tar.bz2" - bzip2 -9k $name.tar - fi - if [ $comp = txz ] ; then - echo "* Creating $name.tar.xz" - xz -9k $name.tar - fi - if [ $comp = tgz ] ; then - echo "* Creating $name.tar.gz" - gzip -9c $name.tar > $name.tar.gz - fi - ;; - zip) - echo "* Creating $name.zip" - zip -q -9 -r $name.zip $name - ;; - zip-7z) - echo "* Creating $name.zip" - 7za a -bd -tzip $name.zip $name > /dev/null - ;; - 7z) - echo "* Creating $name.7z" - 7za a -bd $name.7z $name > /dev/null - ;; - *) - echo "WARNING: ignoring compression '$comp', not known!" - ;; - esac - - # Cleanup - rm -f $name.tar - done - - # Remove directory with current dist set - rm -rf $name -done - -# Cleanup -rm -rf phpMyAdmin-${version} - - -echo "" -echo "" -echo "" -echo "Files:" -echo "------" - -ls -la *.gz *.zip *.bz2 *.7z - -cd .. - - -if [ $# -gt 0 ] ; then - echo - echo "Additional tasks:" - while [ $# -gt 0 ] ; do - param=$1 - case $1 in - --tag) - tagname=RELEASE_`echo $version | tr . _ | tr '[:lower:]' '[:upper:]' | tr -d -` - echo "* Tagging release as $tagname" - git tag -a -m "Released $version" $tagname $branch - if echo $version | grep -q '^2\.11\.' ; then - echo '* 2.11 branch, no STABLE/TESTING update' - else - if echo $version | grep '[a-z_-]' ; then - mark_as_release $branch TESTING - else - # We update both branches here - # As it does not make sense to have older testing than stable - if echo $version | grep -q '^3\.3\.' ; then - echo '* 3.3 branch, no TESTING update' - else - mark_as_release $branch TESTING - fi - mark_as_release $branch STABLE - fi - git checkout master - fi - echo " Dont forget to push tags using: git push --tags" - ;; - *) - echo "Unknown parameter: $1!" - exit 1 - esac - shift - done - echo -fi - -cat <set( 'PMA_VERSION', '2.7.1-dev' ); " - - in Documentation.html the 2 lines - " phpMyAdmin 2.2.2-rc1 - Documentation " - "

phpMyAdmin 2.2.2-rc1 Documentation

" - - 8. add a group for bug tracking this new version, at - https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1 - - 9. the end :-) - -END diff --git a/scripts/create_tables.sql b/scripts/create_tables.sql deleted file mode 100644 index 1efdaadfd..000000000 --- a/scripts/create_tables.sql +++ /dev/null @@ -1,208 +0,0 @@ --- -------------------------------------------------------- --- SQL Commands to set up the pmadb as described in Documentation.html. --- --- This file is meant for use with MySQL 5 and above! --- --- This script expects the user pma to already be existing. If we would put a --- line here to create him too many users might just use this script and end --- up with having the same password for the controluser. --- --- This user "pma" must be defined in config.inc.php (controluser/controlpass) --- --- Please don't forget to set up the tablenames in config.inc.php --- - --- -------------------------------------------------------- - --- --- Database : `phpmyadmin` --- -CREATE DATABASE IF NOT EXISTS `phpmyadmin` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; -USE phpmyadmin; - --- -------------------------------------------------------- - --- --- Privileges --- --- (activate this statement if necessary) --- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO --- 'pma'@localhost; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_bookmark` --- - -CREATE TABLE IF NOT EXISTS `pma_bookmark` ( - `id` int(11) NOT NULL auto_increment, - `dbase` varchar(255) NOT NULL default '', - `user` varchar(255) NOT NULL default '', - `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '', - `query` text NOT NULL, - PRIMARY KEY (`id`) -) - ENGINE=MyISAM COMMENT='Bookmarks' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_column_info` --- - -CREATE TABLE IF NOT EXISTS `pma_column_info` ( - `id` int(5) unsigned NOT NULL auto_increment, - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `column_name` varchar(64) NOT NULL default '', - `comment` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '', - `mimetype` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '', - `transformation` varchar(255) NOT NULL default '', - `transformation_options` varchar(255) NOT NULL default '', - PRIMARY KEY (`id`), - UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`) -) - ENGINE=MyISAM COMMENT='Column information for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_history` --- - -CREATE TABLE IF NOT EXISTS `pma_history` ( - `id` bigint(20) unsigned NOT NULL auto_increment, - `username` varchar(64) NOT NULL default '', - `db` varchar(64) NOT NULL default '', - `table` varchar(64) NOT NULL default '', - `timevalue` timestamp NOT NULL, - `sqlquery` text NOT NULL, - PRIMARY KEY (`id`), - KEY `username` (`username`,`db`,`table`,`timevalue`) -) - ENGINE=MyISAM COMMENT='SQL history for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_pdf_pages` --- - -CREATE TABLE IF NOT EXISTS `pma_pdf_pages` ( - `db_name` varchar(64) NOT NULL default '', - `page_nr` int(10) unsigned NOT NULL auto_increment, - `page_descr` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '', - PRIMARY KEY (`page_nr`), - KEY `db_name` (`db_name`) -) - ENGINE=MyISAM COMMENT='PDF relation pages for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_relation` --- - -CREATE TABLE IF NOT EXISTS `pma_relation` ( - `master_db` varchar(64) NOT NULL default '', - `master_table` varchar(64) NOT NULL default '', - `master_field` varchar(64) NOT NULL default '', - `foreign_db` varchar(64) NOT NULL default '', - `foreign_table` varchar(64) NOT NULL default '', - `foreign_field` varchar(64) NOT NULL default '', - PRIMARY KEY (`master_db`,`master_table`,`master_field`), - KEY `foreign_field` (`foreign_db`,`foreign_table`) -) - ENGINE=MyISAM COMMENT='Relation table' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_table_coords` --- - -CREATE TABLE IF NOT EXISTS `pma_table_coords` ( - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `pdf_page_number` int(11) NOT NULL default '0', - `x` float unsigned NOT NULL default '0', - `y` float unsigned NOT NULL default '0', - PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`) -) - ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_table_info` --- - -CREATE TABLE IF NOT EXISTS `pma_table_info` ( - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `display_field` varchar(64) NOT NULL default '', - PRIMARY KEY (`db_name`,`table_name`) -) - ENGINE=MyISAM COMMENT='Table information for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_designer_coords` --- - -CREATE TABLE IF NOT EXISTS `pma_designer_coords` ( - `db_name` varchar(64) NOT NULL default '', - `table_name` varchar(64) NOT NULL default '', - `x` INT, - `y` INT, - `v` TINYINT, - `h` TINYINT, - PRIMARY KEY (`db_name`,`table_name`) -) - ENGINE=MyISAM COMMENT='Table coordinates for Designer' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_tracking` --- - -CREATE TABLE IF NOT EXISTS `pma_tracking` ( - `db_name` varchar(64) collate utf8_bin NOT NULL, - `table_name` varchar(64) collate utf8_bin NOT NULL, - `version` int(10) unsigned NOT NULL, - `date_created` datetime NOT NULL, - `date_updated` datetime NOT NULL, - `schema_snapshot` text collate utf8_bin NOT NULL, - `schema_sql` text collate utf8_bin, - `data_sql` longtext collate utf8_bin, - `tracking` set('UPDATE','REPLACE','INSERT','DELETE','TRUNCATE','CREATE DATABASE','ALTER DATABASE','DROP DATABASE','CREATE TABLE','ALTER TABLE','RENAME TABLE','DROP TABLE','CREATE INDEX','DROP INDEX','CREATE VIEW','ALTER VIEW','DROP VIEW') collate utf8_bin default NULL, - `tracking_active` int(1) unsigned NOT NULL default '1', - PRIMARY KEY (`db_name`,`table_name`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_userconfig` --- - -CREATE TABLE IF NOT EXISTS `pma_userconfig` ( - `username` varchar(64) NOT NULL, - `timevalue` timestamp NOT NULL, - `config_data` text NOT NULL, - PRIMARY KEY (`username`) -) - ENGINE=MyISAM COMMENT='User preferences storage for phpMyAdmin' - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; diff --git a/scripts/decode_bug.php b/scripts/decode_bug.php deleted file mode 100644 index f935a7706..000000000 --- a/scripts/decode_bug.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * @package phpMyAdmin-debug - */ - -/** - * Displays the form - */ -?> - - - - - - - - phpMyAdmin - Parser BUG decoder - - - - - -

Parser BUG decoder

-
- -
- - Encoded bug report:
- -

- -
-
- - decodes the bug report - */ - -/** - * Display the decoded bug report in ASCII format - * - * @param string the text data - * - * @return string the text enclosed by "
...
" tags - * - * @access public - */ -function PMA_printDecodedBug($textdata) -{ - return '
' . htmlspecialchars($textdata) . '

'; -} // end of the "PMA_printDecodedBug()" function - - -if (!empty($_POST) && isset($_POST['bug_encoded'])) { - $bug_encoded = $_POST['bug_encoded']; -} - -if (!empty($bug_encoded) && is_string($bug_encoded)) { - if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { - $bug_encoded = stripslashes($bug_encoded); - } - - $bug_encoded = preg_replace('/[[:space:]]/', '', $bug_encoded); - $bug_decoded = base64_decode($bug_encoded); - if (substr($bug_encoded, 0, 2) == 'eN') { - if (function_exists('gzuncompress')) { - $result = PMA_printDecodedBug(gzuncompress($bug_decoded)); - } else { - $result = 'Error: "gzuncompress()" is unavailable!' . "\n"; - } - } else { - $result = PMA_printDecodedBug($bug_decoded); - } // end if... else... - - echo '

Decoded:

' . "\n" - . $result . "\n"; -} // end if -?> - - - diff --git a/scripts/generate-mo b/scripts/generate-mo deleted file mode 100755 index d8c8ab224..000000000 --- a/scripts/generate-mo +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -if [ x$1 = x--quiet ] ; then - stats="" - shift -else - stats="--statistics" -fi - -compile() { - lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'` - if [ ! -z "$stats" ] ; then - echo -n "$lang: " - fi - mkdir -p locale/$lang/LC_MESSAGES - msgfmt $stats --check -o locale/$lang/LC_MESSAGES/phpmyadmin.mo $1 -} - -if [ ! -z "$1" ] ; then - compile po/$1.po - exit 0 -fi - -for x in po/*.po ; do - compile $x -done diff --git a/scripts/google-javascript-compiler/COPYING b/scripts/google-javascript-compiler/COPYING deleted file mode 100644 index d64569567..000000000 --- a/scripts/google-javascript-compiler/COPYING +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/scripts/google-javascript-compiler/README b/scripts/google-javascript-compiler/README deleted file mode 100644 index 8718f5b57..000000000 --- a/scripts/google-javascript-compiler/README +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// -// Contents -// - -The Closure Compiler performs checking, instrumentation, and -optimizations on JavaScript code. The purpose of this README is to -explain how to build and run the Closure Compiler. - -The Closure Compiler requires Java 6 or higher. -http://www.java.com/ - - -// -// Building The Closure Compiler -// - -There are three ways to get a Closure Compiler executable. - -1) Use one we built for you. - -Pre-built Closure binaries can be found at -http://code.google.com/p/closure-compiler/downloads/list - - -2) Check out the source and build it with Apache Ant. - -First, check out the full source tree of the Closure Compiler. There -are instructions on how to do this at the project site. -http://code.google.com/p/closure-compiler/source/checkout - -Apache Ant is a cross-platform build tool. -http://ant.apache.org/ - -At the root of the source tree, there is an Ant file named -build.xml. To use it, navigate to the same directory and type the -command - -ant jar - -This will produce a jar file called "build/compiler.jar". - - -3) Check out the source and build it with Eclipse. - -Eclipse is a cross-platform IDE. -http://www.eclipse.org/ - -Under Eclipse's File menu, click "New > Project ..." and create a -"Java Project." You will see an options screen. Give the project a -name, select "Create project from existing source," and choose the -root of the checked-out source tree as the existing directory. Verify -that you are using JRE version 6 or higher. - -Eclipse can use the build.xml file to discover rules. When you -navigate to the build.xml file, you will see all the build rules in -the "Outline" pane. Run the "jar" rule to build the compiler in -build/compiler.jar. - - -// -// Running The Closure Compiler -// - -Once you have the jar binary, running the Closure Compiler is straightforward. - -On the command line, type - -java -jar compiler.jar - -This starts the compiler in interactive mode. Type - -var x = 17 + 25; - -then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux) -and "Enter" again. The Compiler will respond: - -var x=42; - -The Closure Compiler has many options for reading input from a file, -writing output to a file, checking your code, and running -optimizations. To learn more, type - -java -jar compiler.jar --help - -You can read more detailed documentation about the many flags at -http://code.google.com/closure/compiler/docs/gettingstarted_app.html - - -// -// Compiling Multiple Scripts -// - -If you have multiple scripts, you should compile them all together with -one compile command. - -java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js - -The Closure Compiler will concatenate the files in the order they're -passed at the command line. - -If you need to compile many, many scripts together, you may start to -run into problems with managing dependencies between scripts. You -should check out the Closure Library. It contains functions for -enforcing dependencies between scripts, and a tool called calcdeps.py -that knows how to give scripts to the Closure Compiler in the right -order. - -http://code.google.com/p/closure-library/ - -// -// Licensing -// - -Unless otherwise stated, all source files are licensed under -the Apache License, Version 2.0. - - ------ -Code under: -src/com/google/javascript/rhino -test/com/google/javascript/rhino - -URL: http://www.mozilla.org/rhino -Version: 1.5R3, with heavy modifications -License: Netscape Public License and MPL / GPL dual license - -Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an -implementation of JavaScript for the JVM. The JavaScript parser and -the parse tree data structures were extracted and modified -significantly for use by Google's JavaScript compiler. - -Local Modifications: The packages have been renamespaced. All code not -relavant to parsing has been removed. A JSDoc parser and static typing -system have been added. - - ------ -Code in: -lib/libtrunk_rhino_parser_jarjared.jar - -Rhino -URL: http://www.mozilla.org/rhino -Version: Trunk -License: Netscape Public License and MPL / GPL dual license - -Description: Mozilla Rhino is an implementation of JavaScript for the JVM. - -Local Modifications: None. We've used JarJar to renamespace the code -post-compilation. See: -http://code.google.com/p/jarjar/ - - ------ -Code in: -lib/args4j_deploy.jar - -Args4j -URL: https://args4j.dev.java.net/ -Version: 2.0.9 -License: MIT - -Description: -args4j is a small Java class library that makes it easy to parse command line -options/arguments in your CUI application. - -Local Modifications: None. - - ------ -Code in: -lib/google_common_deploy.jar - -Guava Libraries -URL: http://code.google.com/p/guava-libraries/ -Version: Trunk -License: Apache License 2.0 - -Description: Google's core Java libraries. - -Local Modifications: None. - - ------ -Code in: -lib/hamcrest-core-1.1.jar - -Hamcrest -URL: http://code.google.com/p/hamcrest -License: BSD -License File: LICENSE - -Description: -Provides a library of matcher objects (also known as constraints or -predicates) allowing 'match' rules to be defined declaratively, to be used in -other frameworks. Typical scenarios include testing frameworks, mocking -libraries and UI validation rules. - -Local modifications: -The original jars contained both source code and compiled classes. - -hamcrest-core-1.1.jar just contains the compiled classes. - - ----- -Code in: -lib/junit.jar - -JUnit -URL: http://sourceforge.net/projects/junit/ -Version: 4.5 -License: Common Public License 1.0 - -Description: A framework for writing and running automated tests in Java. - -Local Modifications: None. - - ---- -Code in: -lib/protobuf_deploy.jar - -Protocol Buffers -URL: http://code.google.com/p/protobuf/ -Version: 2.2.0a -License: New BSD License - -Description: Supporting libraries for protocol buffers, -an encoding of structured data. - -Local Modifications: None - - ---- -Code in: -lib/ant_deploy.jar - -URL: http://ant.apache.org/bindownload.cgi -Version: 1.6.5 -License: Apache License 2.0 -Description: - Ant is a Java based build tool. In theory it is kind of like "make" - without make's wrinkles and with the full portability of pure java code. - -Local Modifications: - Modified apache-ant-1.6.5/bin/ant to look in the ant.runfiles directory diff --git a/scripts/google-javascript-compiler/compiler.jar b/scripts/google-javascript-compiler/compiler.jar deleted file mode 100644 index 4dfa5ad0b..000000000 Binary files a/scripts/google-javascript-compiler/compiler.jar and /dev/null differ diff --git a/scripts/lang-cleanup.sh b/scripts/lang-cleanup.sh deleted file mode 100755 index c783ca2c9..000000000 --- a/scripts/lang-cleanup.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# -# vim: expandtab sw=4 ts=4 sts=4: -# -# Script for removing language selection from phpMyAdmin - -if [ $# -lt 1 ] ; then - echo "Usage: lang-cleanup.sh type" - echo "Type can be one of:" - echo " all-languages - nothing will be done" - echo " english - no translations will be kept" - echo " langcode - keeps language" - echo - echo "Languages can be scpecified multiple times" - exit 1 -fi - -# Expression for find -match="" -for type in "$@" ; do - case $type in - all-languages) - exit 0 - ;; - english) - rm -rf po - rm -rf locale - exit 0 - ;; - *) - match="$match -and -not -name $type.po -and -not -path locale/$type/LC_MESSAGES/phpmyadmin.mo" - ;; - esac -done - -# Delete unvanted languages -find po locale -type f $match -print0 | xargs -0r rm - -# Delete empty directories -rmdir --ignore-fail-on-non-empty locale/*/* -rmdir --ignore-fail-on-non-empty locale/* diff --git a/scripts/mergepo.py b/scripts/mergepo.py deleted file mode 100755 index 70db6bde4..000000000 --- a/scripts/mergepo.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python - -import polib -import sys - -po = polib.pofile(sys.argv[1]) -poupdate = polib.pofile(sys.argv[2]) - -for origentry in po.fuzzy_entries(): - for updateentry in poupdate.translated_entries(): - if origentry.msgctxt is None and origentry.msgid == updateentry.msgid: - origentry.msgstr = updateentry.msgstr - origentry.flags.remove('fuzzy') - break - if origentry.msgctxt == updateentry.msgctxt and origentry.msgid == updateentry.msgid: - origentry.msgstr = updateentry.msgstr - origentry.flags.remove('fuzzy') - break -for origentry in po.untranslated_entries(): - for updateentry in poupdate.translated_entries(): - if origentry.msgctxt is None and origentry.msgid == updateentry.msgid: - origentry.msgstr = updateentry.msgstr - break - if origentry.msgctxt == updateentry.msgctxt and origentry.msgid == updateentry.msgid: - origentry.msgstr = updateentry.msgstr - break - -po.save() - diff --git a/scripts/openid.php b/scripts/openid.php deleted file mode 100644 index e5c1be160..000000000 --- a/scripts/openid.php +++ /dev/null @@ -1,152 +0,0 @@ - array( - 'user' => 'root', - 'password' => '', - ), - ); - -/** - * Simple function to show HTML page with given content. - */ -function show_page($contents) { - header('Content-Type: text/html; charset=utf-8'); - echo '' . "\n"; - ?> - - - - - - phpMyAdmin OpenID signon example - - -' . $_SESSION['PMA_single_signon_message'] . '

'; - unset($_SESSION['PMA_single_signon_message']); -} -echo $contents; -?> - - - -OpenID:
- - - -'; - show_page($content); - exit; -} - -/* Grab identifier */ -if (isset($_POST['identifier'])) { - $identifier = $_POST['identifier']; -} else if (isset($_SESSION['identifier'])) { - $identifier = $_SESSION['identifier']; -} else { - $identifier = null; -} - -/* Create OpenID object */ -try { - $o = new OpenID_RelyingParty($returnTo, $realm, $identifier); -} catch (OpenID_Exception $e) { - $contents = "
\n"; - $contents .= "
" . $e->getMessage() . "
\n"; - $contents .= "
"; - show_page($contents); - exit; -} - -/* Redirect to OpenID provider */ -if (isset($_POST['start'])) { - try { - $authRequest = $o->prepare(); - } catch (OpenID_Exception $e) { - $contents = "
\n"; - $contents .= "
" . $e->getMessage() . "
\n"; - $contents .= "
"; - show_page($contents); - exit; - } - - $url = $authRequest->getAuthorizeURL(); - - header("Location: $url"); - exit; -} else { - /* Grab query string */ - if (!count($_POST)) { - list(, $queryString) = explode('?', $_SERVER['REQUEST_URI']); - } else { - // I hate php sometimes - $queryString = file_get_contents('php://input'); - } - - /* Check reply */ - $message = new OpenID_Message($queryString, OpenID_Message::FORMAT_HTTP); - - $id = $message->get('openid.claimed_id'); - - if (!empty($id) && isset($AUTH_MAP[$id])) { - $_SESSION['PMA_single_signon_user'] = $AUTH_MAP[$id]['user']; - $_SESSION['PMA_single_signon_password'] = $AUTH_MAP[$id]['password']; - session_write_close(); - /* Redirect to phpMyAdmin (should use absolute URL here!) */ - header('Location: ../index.php'); - } else { - show_page('

User not allowed!

'); - exit; - } -} diff --git a/scripts/pending-po b/scripts/pending-po deleted file mode 100755 index aec3a8a58..000000000 --- a/scripts/pending-po +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# vim: expandtab sw=4 ts=4 sts=4: - -LOCS=`ls po/*.po.pending | sed 's@.*/\(.*\)\.po\.pending@\1@'` -for loc in $LOCS ; do - ./scripts/pendingpo.py po/$loc.po po/$loc.po.pending -done diff --git a/scripts/pendingpo.py b/scripts/pendingpo.py deleted file mode 100755 index 307f212da..000000000 --- a/scripts/pendingpo.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python -''' -Script to automatically merge pending translations from Pootle into po files. - -It only accepts those, which are not translated or fuzzy. -''' - -import polib -import sys - -po = polib.pofile(sys.argv[1]) -poupdate = polib.pofile(sys.argv[2]) - -for updateentry in poupdate: - msgid = updateentry.msgid.split('\n', 1)[1] - if msgid == updateentry.msgstr: - continue - origentry = po.find(msgid) - if origentry is None: - continue - if origentry.msgstr == '' or 'fuzzy' in origentry.flags: - origentry.msgstr = updateentry.msgstr - try: - origentry.msgstr_plural = updateentry.msgstr_plural - except AttributeError: - pass - if 'fuzzy' in origentry.flags: - origentry.flags.remove('fuzzy') - -po.save() - diff --git a/scripts/php2gettext.sh b/scripts/php2gettext.sh deleted file mode 100755 index c4df85030..000000000 --- a/scripts/php2gettext.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh - -set -e - -mkdir -p po - - -sed " - s/' ;/';/; - /to translate/D; - /\$allow_recoding/D; - s/\$byteUnits = array('\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)');/\$str_B = '\1';\n\$str_KiB = '\2';\n\$str_MiB = '\3';\n\$str_GiB = '\4';\n\$str_TiB = '\5';\n\$str_PiB = '\6';\n\$str_EiB = '\7';/; - s/\$day_of_week = array('\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)');/\$str_Sun = '\1';\n\$str_Mon = '\2';\n\$str_Tue = '\3';\n\$str_Wed = '\4';\n\$str_Thu = '\5';\n\$str_Fri = '\6';\n\$str_Sat = '\7';\n/; - s/\(\$month = array('.*', '.*', '.*', '.*', '.*', '.*',\) '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)');/\1\n\$str_Jul = '\2';\n\$str_Aug = '\3';\n\$str_Sep = '\4';\n\$str_Oct = '\5';\n\$str_Nov = '\6';\n\$str_Dec = '\7';\n/; - s/\$month = array('\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)', '\(.*\)',/\$str_Jan = '\1';\n\$str_Feb = '\2';\n\$str_Mar = '\3';\n\$str_Apr = '\4';\n\$str_May = '\5';\n\$str_Jun = '\6';\n/; - " < lang/english-utf-8.inc.php > po/english.php - -for lang in lang/*.inc.php ; do - loc=`basename $lang | sed 's/-utf-8.inc.php//'` - # Unfold arrays, delete not translated strings - sed " - s/' ;/';/; - /to translate/D; - /^\/\//D; - /\$allow_recoding/D; - s/\$byteUnits *= *array('\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)');/\$str_B = '\1';\n\$str_KiB = '\2';\n\$str_MiB = '\3';\n\$str_GiB = '\4';\n\$str_TiB = '\5';\n\$str_PiB = '\6';\n\$str_EiB = '\7';/; - s/\$day_of_week *= *array('\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)');/\$str_Sun = '\1';\n\$str_Mon = '\2';\n\$str_Tue = '\3';\n\$str_Wed = '\4';\n\$str_Thu = '\5';\n\$str_Fri = '\6';\n\$str_Sat = '\7';\n/; - s/\(\$month *= *array('.*', *'.*', *'.*', *'.*', *'.*', *'.*',\) '\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)');/\1\n\$str_Jul = '\2';\n\$str_Aug = '\3';\n\$str_Sep = '\4';\n\$str_Oct = '\5';\n\$str_Nov = '\6';\n\$str_Dec = '\7';\n/; - s/\$month *= *array('\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)', *'\(.*\)',/\$str_Jan = '\1';\n\$str_Feb = '\2';\n\$str_Mar = '\3';\n\$str_Apr = '\4';\n\$str_May = '\5';\n\$str_Jun = '\6';\n/; - " < $lang > po/$loc.php - - case $loc in - afrikaans) langcode='af';; - arabic) langcode='ar';; - azerbaijani) langcode='az';; - bangla) langcode='bn';; - belarusian_cyrillic) langcode='be';; - belarusian_latin) langcode='be@latin';; - bulgarian) langcode='bg';; - bosnian) langcode='bs';; - catalan) langcode='ca';; - czech) langcode='cs';; - danish) langcode='da';; - german) langcode='de';; - greek) langcode='el';; - english) langcode='en';; - english-gb) langcode='en_GB';; - spanish) langcode='es';; - estonian) langcode='et';; - basque) langcode='eu';; - persian) langcode='fa';; - finnish) langcode='fi';; - french) langcode='fr';; - galician) langcode='gl';; - hebrew) langcode='he';; - hindi) langcode='hi';; - croatian) langcode='hr';; - hungarian) langcode='hu';; - indonesian) langcode='id';; - italian) langcode='it';; - japanese) langcode='ja';; - korean) langcode='ko';; - georgian) langcode='ka';; - lithuanian) langcode='lt';; - latvian) langcode='lv';; - macedonian_cyrillic) langcode='mk';; - mongolian) langcode='mn';; - malay) langcode='ms';; - dutch) langcode='nl';; - norwegian) langcode='nb';; - polish) langcode='pl';; - brazilian_portuguese) langcode='pt_BR';; - portuguese) langcode='pt';; - romanian) langcode='ro';; - russian) langcode='ru';; - sinhala) langcode='si';; - slovak) langcode='sk';; - slovenian) langcode='sl';; - albanian) langcode='sq';; - serbian_latin) langcode='sr@latin';; - serbian_cyrillic) langcode='sr';; - swedish) langcode='sv';; - thai) langcode='th';; - turkish) langcode='tr';; - tatarish) langcode='tt';; - ukrainian) langcode='uk';; - chinese_traditional) langcode='zh_TW';; - chinese_simplified) langcode='zh_CN';; - uzbek_cyrillic) langcode='uz';; - uzbek_latin) langcode='uz@latin';; - *) echo "Wrong loc: $loc"; exit 1;; - esac - - echo "$loc -> $langcode" - if [ $langcode = en ] ; then - php2po -i po/english.php -o po/phpmyadmin-update.pot -P - sed -i ' - s/PACKAGE VERSION/phpMyAdmin 3.4/; - s/Report-Msgid-Bugs-To: .*\\n/Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\\n/; - ' po/phpmyadmin-update.pot - else - php2po -t po/english.php -i po/$loc.php -o po/$langcode-update.po - sed -i " - s/PACKAGE VERSION/phpMyAdmin 3.4/; - /, fuzzy/D; - s/LANGUAGE /$loc <$langcode@li.org>/; - s/YEAR-MO-DA HO:MI+ZONE/`date +'%Y-%m-%d %H:%M%z'`/; - s/FULL NAME /Automatically generated/; - s/Report-Msgid-Bugs-To: .*\\\\n/Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\\\\n/; - " po/$langcode-update.po - ./scripts/mergepo.py po/$langcode.po po/$langcode-update.po - msgmerge -U -C po/$langcode-update.po po/$langcode.po po/phpmyadmin.pot - rm po/$langcode-update.po po/$loc.php - fi -done -rm po/english.php po/phpmyadmin-update.pot diff --git a/scripts/remove-incomplete-mo b/scripts/remove-incomplete-mo deleted file mode 100755 index ec7d3b3dd..000000000 --- a/scripts/remove-incomplete-mo +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# Removes mo files for incomplete translations -# - -set -e - -# -# How many percent needs to be translated -# -THRESHOLD=40 - -# -# Generated output file -# -TMPOUTPUTFILE=libraries/language_stats.inc.php.tmp -OUTPUTFILE=libraries/language_stats.inc.php - -if [ ! -z "$1" ] ; then - THRESHOLD=$1 -fi - -echo ' $TMPOUTPUTFILE -echo '/* Automatically generated file, do not edit! */' >> $TMPOUTPUTFILE -echo '/* Generated by scripts/remove-incomplete-mo */' >> $TMPOUTPUTFILE -echo '' >> $TMPOUTPUTFILE -echo '$GLOBALS["language_stats"] = array (' >> $TMPOUTPUTFILE - -check() { - TMPOUTPUTFILE=$2 - lang=`echo $1 | sed 's@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=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true` - echo " '$lang' => $PERCENT," >> $TMPOUTPUTFILE - - if [ $PERCENT -lt $THRESHOLD ] ; then - echo "Removing $lang, only $PERCENT%" - rm -f locale/$lang/LC_MESSAGES/phpmyadmin.mo - rmdir locale/$lang/LC_MESSAGES - rmdir locale/$lang - fi -} - -for x in po/*.po ; do - check $x $TMPOUTPUTFILE -done - -echo ');' >> $TMPOUTPUTFILE -echo '?>' >> $TMPOUTPUTFILE - -mv $TMPOUTPUTFILE $OUTPUTFILE diff --git a/scripts/remove_control_m.sh b/scripts/remove_control_m.sh deleted file mode 100755 index 697b2d24a..000000000 --- a/scripts/remove_control_m.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# -# Script to remove ^M from files for DOS <-> UNIX conversions -# - -if [ $# != 1 ] -then - echo "Usage: remove_control_m.sh " - echo "" - echo "Example: remove_control_m.sh php3" - exit -fi - -for i in `find . -name "*.$1"` - do - echo $i - tr -d '\015' < $i > ${i}.new - rm $i - mv ${i}.new $i - done; - diff --git a/scripts/signon.php b/scripts/signon.php deleted file mode 100644 index b592895a0..000000000 --- a/scripts/signon.php +++ /dev/null @@ -1,64 +0,0 @@ - 'Signon test'); - $id = session_id(); - /* Close that session */ - session_write_close(); - /* Redirect to phpMyAdmin (should use absolute URL here!) */ - header('Location: ../index.php'); -} else { - /* Show simple form */ - header('Content-Type: text/html; charset=utf-8'); - echo '' . "\n"; - ?> - - - - - - phpMyAdmin single signon example - - -' . $_SESSION['PMA_single_signon_error_message'] . '

'; -} -?> -
-Username:
-Password:
-Host: (will use the one from config.inc.php by default)
-Port: (will use the one from config.inc.php by default)
- -
- - - diff --git a/scripts/update-po b/scripts/update-po deleted file mode 100755 index f29346744..000000000 --- a/scripts/update-po +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# vim: expandtab sw=4 ts=4 sts=4: -export LC_COLLATE=C -LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'` -xgettext \ - -d phpmyadmin \ - --msgid-bugs-address=phpmyadmin-devel@lists.sourceforge.net \ - -o po/phpmyadmin.pot \ - --language=PHP \ - --add-comments=l10n \ - --add-location \ - --debug \ - --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \ - --copyright-holder="phpMyAdmin devel team" \ - `find . -name '*.php' | sort` - -ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.class.php` - -sed -i ' - s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/; - s/PACKAGE/phpMyAdmin/; - s/(C) YEAR/(C) 2003 - '`date +%Y`'/; - s/VERSION/'$ver'/; - ' po/phpmyadmin.pot - -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"/; - ' po/$loc.po - if [ -f ../localized_docs/po/$loc.po ] ; then - msgmerge --previous -C ../localized_docs/po/$loc.po -U po/$loc.po po/phpmyadmin.pot - else - msgmerge --previous -U po/$loc.po po/phpmyadmin.pot - fi -done diff --git a/scripts/update-po-foreign b/scripts/update-po-foreign deleted file mode 100755 index 831fa0c6c..000000000 --- a/scripts/update-po-foreign +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# vim: expandtab sw=4 ts=4 sts=4: - -if [ ! -d "$1" ] ; then - echo 'Usage: update-po-foreign DIR' - echo 'Updates po files based on po files in DIR' - exit 1 -fi - -export LC_COLLATE=C -LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'` - -ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.class.php` - -for loc in $LOCS ; do - if [ ! -f "$1/$loc.po" ] ; then - continue - fi - 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"/; - ' po/$loc.po - msgmerge --previous -C "$1/$loc.po" -U po/$loc.po po/phpmyadmin.pot -done diff --git a/scripts/upgrade.pl b/scripts/upgrade.pl deleted file mode 100755 index 7f142940b..000000000 --- a/scripts/upgrade.pl +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/perl -# -# -# upgrade.pl - automatic phpmyadmin upgrader -# -# -# 2005-05-08, swix@users.sourceforge.net: -# - created script -# -# 2005-10-29 swix@users.sourceforge.net: -# - some fixes & improvements -# - -use strict; -my $source_url = "http://phpmyadmin.net/home_page/version.php"; - - -# -# usage -# - -if (!$ARGV[0] || (($ARGV[0] eq "--force") && !$ARGV[1])) { - print "\n"; - print "usage: $0 [--force] \n\n"; - print " The location specified by will be backed up and replaced\n"; - print " by the latest stable version of phpMyAdmin.\n"; - print " Your config.inc.php file will be preserved.\n\n"; - exit(0); -} - -my $forced; -my $targetdirectory; - -if ($ARGV[0] eq "--force") { - $forced = 1; - $targetdirectory = $ARGV[1]; -} else { - $forced = 0; - $targetdirectory = $ARGV[0]; -} - -if ($targetdirectory =~ /^(.*)\/$/) { - # remove trailing slash, if any - $targetdirectory = $1; -} - -if (!-d $targetdirectory) { - print "error: target directory ($targetdirectory) does not exists\n"; - exit(0); -} - -if (!-f "$targetdirectory/config.inc.php") { - print "error: target directory doesn't seem to contain phpMyAdmin\n"; - exit(0); -} - - -# -# get current release information -# - -my $version; -my $filename; -my $directory; -my $releasedate; -my @urls; -my @today; -my $installedversion; - -if (open(LATEST, "wget -o /dev/null -O - $source_url|")) { - - $version = ; chomp($version); - $releasedate = ; chomp($releasedate); - $filename = "phpMyAdmin-" . $version . "-all-languages.tar.gz"; - $directory = "phpMyAdmin-" . $version . "-all-languages"; - - my $i = 0; - - while (my $line = ) { - chomp($line); - if ($line =~ /http/) { - $urls[$i++] = $line; - } - } - - close(LATEST); - -} else { - - print "error: open of $source_url failed.\n"; - exit(0); - -} - - -if (-d $directory) { - print "error: target directory ($directory) already exists, exiting\n"; - exit(0); -} - -# -# check the installed version -# - -if (open(DEFINES, $targetdirectory .'/libraries/Config.class.php')) { - my $versionStatus = 0; - $installedversion = "unknownversion"; - - while (my $line = ) { - - next unless $line =~ /'PMA_VERSION',\ '(.*)?'\);$/; - $installedversion = $1; - - # take care of "pl", "rc" and "dev": dev < rc < pl - - my $converted_installedversion = $installedversion; - $converted_installedversion =~ s/dev/aaa/g; - $converted_installedversion =~ s/rc/bbb/g; - $converted_installedversion =~ s/pl/ccc/g; - - my $converted_version = $version; - $converted_version =~ s/dev/aaa/g; - $converted_version =~ s/rc/bbb/g; - $converted_version =~ s/pl/ccc/g; - - if ($converted_installedversion gt $converted_version && !$forced) { - print "Local version ($installedversion) newer than latest stable release ($version), not updating. (use \"--force\")\n"; - exit(0); - - } elsif ($installedversion eq $version && !$forced) { - print "Local version ($version) already up to date, not updating (you can use \"--force\")\n"; - exit(0); - - } else { - $versionStatus = 1; - } - } - if (!$versionStatus && !$forced) { - print "Old version could not be identified, not updating (use \"--force\" if you are sure) \n"; - exit(0); - } -} - -# -# ask for confirmation -# - -print "\n"; -print "phpMyAdmin upgrade summary:\n"; -print "---------------------------\n"; -print " phpMyAdmin Path: $targetdirectory\n"; -print " Installed version: $installedversion\n"; -print " Upgraded version: $version\n\n"; -print "Proceed with upgrade? [Y/n] "; -my $kbdinput = ; chomp($kbdinput); -if (lc(substr($kbdinput,0,1)) ne "y" && length($kbdinput) >= 1) { - print "Aborting.\n"; - exit(0); -} else { - print "Proceeding...\n\n"; -} - - -# -# get file -# - -if (!-f $filename) { - - print "getting phpMyAdmin $version\n"; - foreach my $url (@urls) { - - print "trying $url...\n"; - system("wget -o /dev/null $url"); - if (-f $filename) { - print "-> ok\n"; - last; - } - } -} else { - print "already got $filename, not downloading\n"; -} - - -if (!-f $filename) { - print "error: $filename download failed\n"; - exit(0); -} - - - -# -# setup -# - -print "installing...\n"; - -system("tar xzf $filename"); -if (!$directory) { - print "error: $directory still not exists after untar...\n"; - exit(0); -} - -@today = localtime(time); $today[4]++; $today[5]+=1900; -my $timestamp = sprintf("%04d%02d%02d%02d%02d", $today[5], $today[4], $today[3], $today[2], $today[1]); - -my $backupdir = $targetdirectory . "-" . $timestamp . "-" . $installedversion; -print "- backup directory: $backupdir\n"; - -system("cp $directory/config.inc.php $directory/config.inc-dist.php"); -print "- original distribution config.inc.php renamed to config.inc-dist.php\n"; - -system("cp $targetdirectory/config.inc.php $directory/config.inc.php"); -print "- previous config.inc.php copied to the new setup\n"; - -system("mv $targetdirectory $backupdir"); -system("mv $directory $targetdirectory"); -system("rm $filename"); - -print "\ndone! phpMyAdmin $version installed in $targetdirectory\n"; -print "backup of your old installation in $backupdir\n"; -print "Enjoy! :-)\n\n"; diff --git a/scripts/upgrade_tables_mysql_4_1_2+.sql b/scripts/upgrade_tables_mysql_4_1_2+.sql deleted file mode 100644 index 905bd68f4..000000000 --- a/scripts/upgrade_tables_mysql_4_1_2+.sql +++ /dev/null @@ -1,144 +0,0 @@ --- ------------------------------------------------------------- --- SQL Commands to upgrade pmadb for normal phpMyAdmin operation --- with MySQL 4.1.2 and above. --- --- This file is meant for use with MySQL 4.1.2 and above! --- For older MySQL releases, please use create_tables.sql --- --- If you are running one MySQL 4.1.0 or 4.1.1, please create the tables using --- create_tables.sql, then use this script. --- --- Please don't forget to set up the tablenames in config.inc.php --- - --- -------------------------------------------------------- - --- --- Database : `phpmyadmin` --- -ALTER DATABASE `phpmyadmin` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; -USE phpmyadmin; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_bookmark` --- -ALTER TABLE `pma_bookmark` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_bookmark` - CHANGE `dbase` `dbase` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_bookmark` - CHANGE `user` `user` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_bookmark` - CHANGE `label` `label` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma_bookmark` - CHANGE `query` `query` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_column_info` --- - -ALTER TABLE `pma_column_info` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_column_info` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `column_name` `column_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `comment` `comment` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `mimetype` `mimetype` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `transformation` `transformation` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_column_info` - CHANGE `transformation_options` `transformation_options` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_history` --- -ALTER TABLE `pma_history` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_history` - CHANGE `username` `username` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_history` - CHANGE `db` `db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_history` - CHANGE `table` `table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_history` - CHANGE `sqlquery` `sqlquery` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_pdf_pages` --- - -ALTER TABLE `pma_pdf_pages` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_pdf_pages` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_pdf_pages` - CHANGE `page_descr` `page_descr` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_relation` --- -ALTER TABLE `pma_relation` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_relation` - CHANGE `master_db` `master_db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_relation` - CHANGE `master_table` `master_table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_relation` - CHANGE `master_field` `master_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_relation` - CHANGE `foreign_db` `foreign_db` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_relation` - CHANGE `foreign_table` `foreign_table` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_relation` - CHANGE `foreign_field` `foreign_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_table_coords` --- - -ALTER TABLE `pma_table_coords` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_table_coords` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_table_coords` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; - --- -------------------------------------------------------- - --- --- Table structure for table `pma_table_info` --- - -ALTER TABLE `pma_table_info` - DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; - -ALTER TABLE `pma_table_info` - CHANGE `db_name` `db_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_table_info` - CHANGE `table_name` `table_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; -ALTER TABLE `pma_table_info` - CHANGE `display_field` `display_field` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT ''; diff --git a/scripts/upload-release b/scripts/upload-release deleted file mode 100755 index 243281f4e..000000000 --- a/scripts/upload-release +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -set -e -set -u - -if [ $# -lt 2 ] ; then - echo 'Usage: upload-release USERNAME VERSION [DIR]' - echo 'Must be called in directory with binaries or with path' - exit 1 -fi -USER=$1 -REL=$2 - -if [ $# -gt 2 ] ; then - cd "$3" -fi - -sftp $USER,phpmyadmin@frs.sourceforge.net <addTestSuite('PmaSeleniumLoginTest'); - $suite->addTestSuite('PmaSeleniumXssTest'); - $suite->addTestSuite('PmaSeleniumPrivilegesTest'); - return $suite; - } -} -?> diff --git a/test/AllTests.php b/test/AllTests.php deleted file mode 100644 index 338f83d58..000000000 --- a/test/AllTests.php +++ /dev/null @@ -1,97 +0,0 @@ -addTestSuite('FailTest'); - $suite->addTestSuite('Environment_test'); - $suite->addTestSuite('PMA_get_real_size_test'); - $suite->addTestSuite('PMA_sanitize_test'); - $suite->addTestSuite('PMA_pow_test'); - $suite->addTestSuite('PMA_escapeJsString_test'); - $suite->addTestSuite('PMA_isValid_test'); - $suite->addTestSuite('PMA_transformation_getOptions_test'); - $suite->addTestSuite('PMA_STR_sub_test'); - $suite->addTestSuite('PMA_generate_common_url_test'); - $suite->addTestSuite('PMA_blowfish_test'); - $suite->addTestSuite('PMA_escapeMySqlWildcards_test'); - $suite->addTestSuite('PMA_showHint_test'); - $suite->addTestSuite('PMA_formatNumberByteDown_test'); - $suite->addTestSuite('PMA_localisedDateTimespan_test'); - $suite->addTestSuite('PMA_cache_test'); - $suite->addTestSuite('PMA_quoting_slashing_test'); - $suite->addTestSuite('PMA_stringOperations_test'); - $suite->addTestSuite('PMA_printableBitValue_test'); - $suite->addTestSuite('PMA_foreignKeySupported_test'); - $suite->addTestSuite('PMA_headerLocation_test'); - $suite->addTestSuite('PMA_Message_test'); - $suite->addTestSuite('PMA_whichCrlf_test'); - return $suite; - } -} -?> diff --git a/test/Environment_test.php b/test/Environment_test.php deleted file mode 100644 index f61956f36..000000000 --- a/test/Environment_test.php +++ /dev/null @@ -1,35 +0,0 @@ -assertTrue(version_compare('5.2', phpversion(), '<='), - 'phpMyAdmin requires PHP 5.2 or above'); - } - - public function testMySQL() - { - $this->markTestIncomplete(); - } - - public function testSession() - { - $this->markTestIncomplete(); - } -} -?> diff --git a/test/FailTest.php b/test/FailTest.php deleted file mode 100644 index f430bb470..000000000 --- a/test/FailTest.php +++ /dev/null @@ -1,24 +0,0 @@ -assertEquals(0, 1); - } -} -?> diff --git a/test/PMA_Message_test.php b/test/PMA_Message_test.php deleted file mode 100644 index ed7694e3d..000000000 --- a/test/PMA_Message_test.php +++ /dev/null @@ -1,388 +0,0 @@ -object = new PMA_Message; - } - - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - * - * @access protected - */ - protected function tearDown() - { - } - - /** - * to String casting test - */ - public function test__toString() - { - $this->object->setMessage('test<&>', true); - $this->assertEquals('test<&>', (string)$this->object); - } - - /** - * test success method - */ - public function testSuccess() - { - $this->object = new PMA_Message('test<&>', PMA_Message::SUCCESS); - $this->assertEquals($this->object, PMA_Message::success('test<&>')); - $this->assertEquals('Your SQL query has been executed successfully', PMA_Message::success()->getString()); - } - - /** - * test error method - */ - public function testError() - { - $this->object = new PMA_Message('test<&>', PMA_Message::ERROR); - $this->assertEquals($this->object, PMA_Message::error('test<&>')); - $this->assertEquals('Error', PMA_Message::error()->getString()); - } - - /** - * test notice method - */ - public function testNotice() - { - $this->object = new PMA_Message('test<&>', PMA_Message::NOTICE); - $this->assertEquals($this->object, PMA_Message::notice('test<&>')); - } - - /** - * test rawError method - */ - public function testRawError() - { - $this->object = new PMA_Message('', PMA_Message::ERROR); - $this->object->setMessage('test<&>'); - - $this->assertEquals($this->object, PMA_Message::rawError('test<&>')); - } - - /** - * test rawWarning method - */ - public function testRawWarning() - { - $this->object = new PMA_Message('', PMA_Message::WARNING); - $this->object->setMessage('test<&>'); - - $this->assertEquals($this->object, PMA_Message::rawWarning('test<&>')); - } - - /** - * test rawNotice method - */ - public function testRawNotice() - { - $this->object = new PMA_Message('', PMA_Message::NOTICE); - $this->object->setMessage('test<&>'); - - $this->assertEquals($this->object, PMA_Message::rawNotice('test<&>')); - } - - /** - * test rawSuccess method - */ - public function testRawSuccess() - { - $this->object = new PMA_Message('', PMA_Message::SUCCESS); - $this->object->setMessage('test<&>'); - - $this->assertEquals($this->object, PMA_Message::rawSuccess('test<&>')); - } - - /** - * testing isSuccess method - */ - public function testIsSuccess() - { - $this->assertFalse($this->object->isSuccess()); - $this->assertTrue($this->object->isSuccess(true)); - } - - /** - * testing isNotice method - */ - public function testIsNotice() - { - $this->assertTrue($this->object->isNotice()); - $this->object->isError(true); - $this->assertFalse($this->object->isNotice()); - $this->assertTrue($this->object->isNotice(true)); - } - - /** - * testing isError method - */ - public function testIsError() - { - $this->assertFalse($this->object->isError()); - $this->assertTrue($this->object->isError(true)); - } - - /** - * testign setter of message - */ - public function testSetMessage() - { - $this->object->setMessage('test&<>', false); - $this->assertEquals('test&<>', $this->object->getMessage()); - $this->object->setMessage('test&<>', true); - $this->assertEquals('test&<>', $this->object->getMessage()); - } - - /** - * testing setter of string - */ - public function testSetString() - { - $this->object->setString('test&<>', false); - $this->assertEquals('test&<>', $this->object->getString()); - $this->object->setString('test&<>', true); - $this->assertEquals('test&<>', $this->object->getString()); - } - - /** - * testing add param method - */ - public function testAddParam() - { - $this->object->addParam(PMA_Message::notice('test')); - $this->assertEquals(array(PMA_Message::notice('test')), $this->object->getParams()); - $this->object->addParam('test', true); - $this->assertEquals(array(PMA_Message::notice('test'), 'test'), $this->object->getParams()); - $this->object->addParam('test', false); - $this->assertEquals(array(PMA_Message::notice('test'), 'test', PMA_Message::notice('test')), $this->object->getParams()); - } - - /** - * testing add string method - */ - public function testAddString() - { - $this->object->addString('test', '*'); - $this->assertEquals(array('*', PMA_Message::notice('test')), $this->object->getAddedMessages()); - $this->object->addString('test', ''); - $this->assertEquals(array('*', PMA_Message::notice('test'), '', PMA_Message::notice('test')), $this->object->getAddedMessages()); - } - - /** - * testing add messages method - */ - public function testAddMessages() - { - $this->object->addMessages(array('test', PMA_Message::rawWarning('test')), '&'); - $this->assertEquals(array('&', PMA_Message::rawNotice('test'), '&', PMA_Message::rawWarning('test')), $this->object->getAddedMessages()); - } - - /** - * testing add message method - */ - public function testAddMessage() - { - $this->object->addMessage('test', ''); - $this->assertEquals(array(PMA_Message::rawNotice('test')), $this->object->getAddedMessages()); - $this->object->addMessage('test'); - $this->assertEquals(array(PMA_Message::rawNotice('test'), ' ', PMA_Message::rawNotice('test')), $this->object->getAddedMessages()); - $this->object->addMessage(PMA_Message::rawWarning('test'), '&'); - $this->assertEquals(array(PMA_Message::rawNotice('test'), ' ', PMA_Message::rawNotice('test'), '&', PMA_Message::rawWarning('test')), $this->object->getAddedMessages()); - } - - /** - * testing setter of params - */ - public function testSetParams() - { - $this->object->setParams('test&<>'); - $this->assertEquals('test&<>', $this->object->getParams()); - $this->object->setParams('test&<>', true); - $this->assertEquals('test&<>', $this->object->getParams()); - } - - /** - * testing sanitize method - */ - public function testSanitize() - { - $this->object->setString('test&string<>', false); - $this->assertEquals('test&string<>', PMA_Message::sanitize($this->object)); - $this->assertEquals(array('test&string<>', 'test&string<>'), PMA_Message::sanitize(array($this->object, $this->object))); - } - - public function decodeBBDataProvider() - { - return array( - array('[i]test[/i][i]aa[i/][em]test[/em]', 'testaa[i/]test'), - array('[b]test[/b][strong]test[/strong]', 'testtest'), - array('[tt]test[/tt][code]test[/code]', 'testtest'), - array('[kbd]test[/kbd][br][sup]test[/sup]', 'test
test') - ); - } - - /** - * testing decodeBB method - * @dataProvider decodeBBDataProvider - */ - - public function testDecodeBB($actual, $expected) - { - $this->assertEquals($expected, PMA_Message::decodeBB($actual)); - } - - /** - * testing format method - */ - public function testFormat() - { - $this->assertEquals('test string', PMA_Message::format('test string')); - $this->assertEquals('test string', PMA_Message::format('test string', 'a')); - $this->assertEquals('test string', PMA_Message::format('test string', array())); - $this->assertEquals('test string', PMA_Message::format('%s string', array('test'))); - - } - - /** - * testing getHash method - */ - public function testGetHash() - { - $this->object->setString('<&>test', false); - $this->object->setMessage('<&>test', false); - $this->assertEquals(md5(PMA_Message::NOTICE . '<&>test<&>test'), $this->object->getHash()); - } - - /** - * getMessage test - with empty message and with non-empty string - not key in globals - * additional params are defined - */ - public function testGetMessageWithoutMessageWithStringWithParams() - { - $this->object->setMessage(''); - $this->object->setString('test string %s %s'); - $this->object->addParam('test param 1'); - $this->object->addParam('test param 2'); - $this->assertEquals('test string test param 1 test param 2', $this->object->getMessage()); - } - - /** - * getMessage test - with empty message and with empty string - */ - public function testGetMessageWithoutMessageWithEmptyString() - { - $this->object->setMessage(''); - $this->object->setString(''); - $this->assertEquals('', $this->object->getMessage()); - } - - /** - * getMessage test - with empty message and with string, which is key to GLOBALS - * additional messages are defined - */ - public function testGetMessageWithoutMessageWithGlobalStringWithAddMessages() - { - $GLOBALS['key'] = 'test message'; - $this->object->setMessage(''); - $this->object->setString('key'); - $this->object->addMessage('test message 2', ' - '); - $this->object->addMessage('test message 3', '&'); - $this->assertEquals('test message - test message 2&test message 3', $this->object->getMessage()); - unset($GLOBALS['key']); - } - - /** - * getMessage test - message is defined - * message with BBCode defined - */ - public function testGetMessageWithMessageWithBBCode() - { - $this->object->setMessage('[kbd]test[/kbd] [a@./Documentation.html#cfg_Example@_blank]test[/a]'); - $this->assertEquals('test test', $this->object->getMessage()); - } - - /** - * getLevel test - */ - public function testGetLevel() - { - $this->assertEquals('notice', $this->object->getLevel()); - $this->object->setNumber(PMA_Message::SUCCESS); - $this->assertEquals('success', $this->object->getLevel()); - $this->object->setNumber(PMA_Message::ERROR); - $this->assertEquals('error', $this->object->getLevel()); - } - - /** - * testing display method (output string and _is_displayed varible) - */ - public function testDisplay() - { - $this->assertFalse($this->object->isDisplayed()); - $this->object->setMessage('Test Message'); - - $this->expectOutputString('
Test Message
'); - $this->object->display(); - - $this->assertTrue($this->object->isDisplayed()); - } - - /** - * getDisplay test - */ - public function testGetDisplay() - { - $this->object->setMessage('Test Message'); - $this->assertEquals('
Test Message
', $this->object->getDisplay()); - } - - /** - * isDisplayed test - */ - public function testIsDisplayed() - { - $this->assertFalse($this->object->isDisplayed(false)); - $this->assertTrue($this->object->isDisplayed(true)); - $this->assertTrue($this->object->isDisplayed(false)); - } -} -?> diff --git a/test/PMA_SQL_parser_data_test.php b/test/PMA_SQL_parser_data_test.php deleted file mode 100644 index 45fa07cb7..000000000 --- a/test/PMA_SQL_parser_data_test.php +++ /dev/null @@ -1,68 +0,0 @@ -assertEquals($difference, array()); - } - - private function assertParserData($name) - { - $this->assertSorted($GLOBALS[$name]); - $this->assertEquals(count($GLOBALS[$name]), $GLOBALS[$name . '_cnt']); - } - - public function testPMA_SQPdata_function_name() - { - $this->assertParserData('PMA_SQPdata_function_name'); - } - - public function testPMA_SQPdata_column_attrib() - { - $this->assertParserData('PMA_SQPdata_column_attrib'); - } - - public function testPMA_SQPdata_reserved_word() - { - $this->assertParserData('PMA_SQPdata_reserved_word'); - } - - public function testPMA_SQPdata_forbidden_word() - { - $this->assertParserData('PMA_SQPdata_forbidden_word'); - } - - public function testPMA_SQPdata_column_type() - { - $this->assertParserData('PMA_SQPdata_column_type'); - } - -} -?> diff --git a/test/PMA_SQL_parser_test.php b/test/PMA_SQL_parser_test.php deleted file mode 100644 index aa3299c52..000000000 --- a/test/PMA_SQL_parser_test.php +++ /dev/null @@ -1,263 +0,0 @@ -assertEquals(PMA_SQP_getErrorString(), $error); - $this->assertEquals($parsed_sql, $expected); - } - - public function testParse_1() - { - $this->assertParser('SELECT 1;', array ( - 'raw' => 'SELECT 1;', - 0 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'SELECT', - 'pos' => 6, - 'forbidden' => true, - ), - 1 => - array ( - 'type' => 'digit_integer', - 'data' => '1', - 'pos' => 8, - ), - 2 => - array ( - 'type' => 'punct_queryend', - 'data' => ';', - 'pos' => 0, - ), - 'len' => 3, - )); - } - - public function testParse_2() - { - $this->assertParser('SELECT * from aaa;', array ( - 'raw' => 'SELECT * from aaa;', - 0 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'SELECT', - 'pos' => 6, - 'forbidden' => true, - ), - 1 => - array ( - 'type' => 'punct', - 'data' => '*', - 'pos' => 0, - ), - 2 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'from', - 'pos' => 13, - 'forbidden' => true, - ), - 3 => - array ( - 'type' => 'alpha_identifier', - 'data' => 'aaa', - 'pos' => 17, - 'forbidden' => false, - ), - 4 => - array ( - 'type' => 'punct_queryend', - 'data' => ';', - 'pos' => 0, - ), - 'len' => 5, - )); - } - - public function testParse_3() - { - $this->assertParser('SELECT * from `aaa`;', array ( - 'raw' => 'SELECT * from `aaa`;', - 0 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'SELECT', - 'pos' => 6, - 'forbidden' => true, - ), - 1 => - array ( - 'type' => 'punct', - 'data' => '*', - 'pos' => 0, - ), - 2 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'from', - 'pos' => 13, - 'forbidden' => true, - ), - 3 => - array ( - 'type' => 'quote_backtick', - 'data' => '`aaa`', - 'pos' => 0, - ), - 4 => - array ( - 'type' => 'punct_queryend', - 'data' => ';', - 'pos' => 0, - ), - 'len' => 5, - )); - } - - public function testParse_4() - { - $this->assertParser('SELECT * from `aaa;', array ( - 'raw' => 'SELECT * from `aaa`;', - 0 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'SELECT', - 'pos' => 6, - 'forbidden' => true, - ), - 1 => - array ( - 'type' => 'punct', - 'data' => '*', - 'pos' => 0, - ), - 2 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'from', - 'pos' => 13, - 'forbidden' => true, - ), - 3 => - array ( - 'type' => 'quote_backtick', - 'data' => '`aaa`', - 'pos' => 0, - ), - 4 => - array ( - 'type' => 'punct_queryend', - 'data' => ';', - 'pos' => 0, - ), - 'len' => 5, - )); - } - - public function testParse_5() - { - $this->assertParser('SELECT * FROM `a_table` tbla INNER JOIN b_table` tblb ON tblb.id = tbla.id WHERE tblb.field1 != tbla.field1`;', array ( - 'raw' => 'SELECT * FROM `a_table` tbla INNER JOIN b_table` tblb ON tblb.id = tbla.id WHERE tblb.field1 != tbla.field1`;', - 0 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'SELECT', - 'pos' => 6, - 'forbidden' => true, - ), - 1 => - array ( - 'type' => 'punct', - 'data' => '*', - 'pos' => 0, - ), - 2 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'FROM', - 'pos' => 13, - 'forbidden' => true, - ), - 3 => - array ( - 'type' => 'quote_backtick', - 'data' => '`a_table`', - 'pos' => 0, - ), - 4 => - array ( - 'type' => 'alpha_identifier', - 'data' => 'tbla', - 'pos' => 28, - 'forbidden' => false, - ), - 5 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'INNER', - 'pos' => 34, - 'forbidden' => true, - ), - 6 => - array ( - 'type' => 'alpha_reservedWord', - 'data' => 'JOIN', - 'pos' => 39, - 'forbidden' => true, - ), - 7 => - array ( - 'type' => 'alpha_identifier', - 'data' => 'b_table', - 'pos' => 47, - 'forbidden' => false, - ), - 8 => - array ( - 'type' => 'quote_backtick', - 'data' => '` tblb ON tblb.id = tbla.id WHERE tblb.field1 != tbla.field1`', - 'pos' => 0, - ), - 9 => - array ( - 'type' => 'punct_queryend', - 'data' => ';', - 'pos' => 0, - ), - 'len' => 10, - )); - } -} -?> diff --git a/test/PMA_STR_sub_test.php b/test/PMA_STR_sub_test.php deleted file mode 100644 index 7900b9262..000000000 --- a/test/PMA_STR_sub_test.php +++ /dev/null @@ -1,51 +0,0 @@ -assertEquals('čšě', - PMA_substr('čšěčščěš', 0, 3)); - } -} -?> diff --git a/test/PMA_blowfish_test.php b/test/PMA_blowfish_test.php deleted file mode 100644 index 234339abc..000000000 --- a/test/PMA_blowfish_test.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals($string, - PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); - } - - public function testEncryptDecryptChars() - { - $secret = '$%ÄüfuDFRR'; - $string = 'abcDEF012!"§$%&/()=?`´"\',.;:-_#+*~öäüÖÄÜ^°²³'; - $this->assertEquals($string, - PMA_blowfish_decrypt(PMA_blowfish_encrypt($string, $secret), $secret)); - } - - public function testEncrypt() - { - $secret = '$%ÄüfuDFRR'; - $decrypted = '12345678'; - $encrypted = 'kO/kc4j/nyk='; - $this->assertEquals($encrypted, PMA_blowfish_encrypt($decrypted, $secret)); - } - - public function testDecrypt() - { - $secret = '$%ÄüfuDFRR'; - $encrypted = 'kO/kc4j/nyk='; - $decrypted = '12345678'; - $this->assertEquals($decrypted, PMA_blowfish_decrypt($encrypted, $secret)); - } - -} -?> diff --git a/test/PMA_cache_test.php b/test/PMA_cache_test.php deleted file mode 100644 index 34aa5f98d..000000000 --- a/test/PMA_cache_test.php +++ /dev/null @@ -1,103 +0,0 @@ -tmpGlobals = $GLOBALS; - $this->tmpSession = $_SESSION; - } - - /** - * Test if cached data is available after set - */ - public function testCacheExists() - { - $GLOBALS['server'] = 'server'; - PMA_cacheSet('test_data', 5, true); - PMA_cacheSet('test_data_2', 5, true); - - $this->assertTrue(PMA_cacheExists('test_data', true)); - $this->assertTrue(PMA_cacheExists('test_data_2', 'server')); - $this->assertFalse(PMA_cacheExists('fake_data_2', true)); - } - - /** - * Test if cacheGet does not return data for non existing caache entries - */ - public function testCacheGet() - { - $GLOBALS['server'] = 'server'; - PMA_cacheSet('test_data', 5, true); - PMA_cacheSet('test_data_2', 5, true); - - $this->assertNotNull(PMA_cacheGet('test_data', true)); - $this->assertNotNull(PMA_cacheGet('test_data_2', 'server')); - $this->assertNull(PMA_cacheGet('fake_data_2', true)); - } - - /** - * Test retrieval of cached data - */ - public function testCacheSetGet() - { - $GLOBALS['server'] = 'server'; - PMA_cacheSet('test_data', 25, true); - - PMA_cacheSet('test_data', 5, true); - $this->assertEquals(5, $_SESSION['cache']['server_server']['test_data']); - PMA_cacheSet('test_data_3', 3, true); - $this->assertEquals(3, $_SESSION['cache']['server_server']['test_data_3']); - } - - /** - * Test clearing cached values - */ - public function testCacheUnSet() - { - $GLOBALS['server'] = 'server'; - PMA_cacheSet('test_data', 25, true); - PMA_cacheSet('test_data_2', 25, true); - - PMA_cacheUnset('test_data', true); - $this->assertArrayNotHasKey('test_data', $_SESSION['cache']['server_server']); - PMA_cacheUnset('test_data_2', true); - $this->assertArrayNotHasKey('test_data_2', $_SESSION['cache']['server_server']); - } -} -?> diff --git a/test/PMA_escapeJsString_test.php b/test/PMA_escapeJsString_test.php deleted file mode 100644 index 4efd6337e..000000000 --- a/test/PMA_escapeJsString_test.php +++ /dev/null @@ -1,57 +0,0 @@ -assertEquals('\\\';', PMA_escapeJsString('\';')); - } - - public function testEscape_2() - { - $this->assertEquals('\r\n\\\'")); - } - - public function testEscape_3() - { - $this->assertEquals('\\\';[XSS]', PMA_escapeJsString('\';[XSS]')); - } - - public function testEscape_4() - { - $this->assertEquals('[HTML]', PMA_escapeJsString('[HTML]')); - } - - public function testEscape_5() - { - $this->assertEquals('"\\\'\\\\\\\'"', PMA_escapeJsString('"\'\\\'"')); - } - - public function testEscape_6() - { - $this->assertEquals("\\\\\'\'\'\'\'\'\'\'\'\'\'\'\\\\", PMA_escapeJsString("\\''''''''''''\\")); - } - -} -?> diff --git a/test/PMA_escapeMySqlWildcards_test.php b/test/PMA_escapeMySqlWildcards_test.php deleted file mode 100644 index ccdf15b97..000000000 --- a/test/PMA_escapeMySqlWildcards_test.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals($a, PMA_escape_mysql_wildcards($b)); - } - - /** - * PMA_unescape_mysql_wildcards tests - * @dataProvider escapeDataProvider - */ - - public function testUnEscape($a, $b) - { - $this->assertEquals($b, PMA_unescape_mysql_wildcards($a)); - } -} -?> diff --git a/test/PMA_foreignKeySupported_test.php b/test/PMA_foreignKeySupported_test.php deleted file mode 100644 index f00afca2c..000000000 --- a/test/PMA_foreignKeySupported_test.php +++ /dev/null @@ -1,46 +0,0 @@ -assertEquals($e, PMA_foreignkey_supported($a)); - } -} -?> diff --git a/test/PMA_formatNumberByteDown_test.php b/test/PMA_formatNumberByteDown_test.php deleted file mode 100644 index 1bc3d063e..000000000 --- a/test/PMA_formatNumberByteDown_test.php +++ /dev/null @@ -1,112 +0,0 @@ -tmpGlobals = $GLOBALS; - $this->tmpSession = $_SESSION; - - } - - /** - * recovering globals and session - */ - public function tearDown() { - - $GLOBALS = $this->tmpGlobals; - $_SESSION = $this->tmpSession; - - } - - /** - * format number data provider - */ - - public function formatNumberDataProvider() { - return array( - array(10, 2, 2, '10,00 '), - array(100, 2, 0, '100 '), - array(100, 2, 2, '0,10 k'), - array(-1000.454, 4, 2, '-1 000,45 '), - array(0.00003, 3, 2, '0,03 m'), - array(0.003, 3, 3, '0,003 '), - array(-0.003, 6, 0, '-3 m'), - array(100.98, 0, 2, '100,98') - ); - } - - /** - * format number test, globals are defined - * @dataProvider formatNumberDataProvider - */ - - public function testFormatNumber($a, $b, $c, $e) { - $this->assertEquals($e, (string)PMA_formatNumber($a, $b, $c, false)); - } - - /** - * format byte down data provider - */ - - public function formatByteDownDataProvider() { - return array( - array(10, 2, 2, array('10', 'B')), - array(100, 2, 0, array('0', 'KB')), - array(100, 3, 0, array('100', 'B')), - array(100, 2, 2, array('0,10', 'KB')), - array(1034, 3, 2, array('1,01', 'KB')), - array(100233, 3, 3, array('97,884', 'KB')), - array(2206451, 1, 2, array('2,10', 'MB')) - ); - } - - /** - * format byte test, globals are defined - * @dataProvider formatByteDownDataProvider - */ - - public function testFormatByteDown($a, $b, $c, $e) { - $result = PMA_formatByteDown($a, $b, $c); - $result[0] = trim($result[0]); - $this->assertEquals($e, $result); - } -} -?> diff --git a/test/PMA_generateCommonUrl_test.php b/test/PMA_generateCommonUrl_test.php deleted file mode 100644 index 22e948b6b..000000000 --- a/test/PMA_generateCommonUrl_test.php +++ /dev/null @@ -1,146 +0,0 @@ -assertEquals($expected, PMA_generate_common_url('db', 'table')); - } - - public function testOldStyleDbOnly() - { - $GLOBALS['server'] = 'x'; - $GLOBALS['lang'] = 'x'; - $GLOBALS['collation_connection'] = 'x'; - $_SESSION[' PMA_token '] = 'x'; - $GLOBALS['cfg']['ServerDefault'] = 'y'; - - $separator = PMA_get_arg_separator(); - $expected = 'server=x' . htmlentities($separator) - . 'lang=x' . htmlentities($separator) - . 'collation_connection=x' . htmlentities($separator) - . 'token=x' - ; - - $expected = 'db=db' - . htmlentities($separator) . $expected; - - $this->assertEquals($expected, PMA_generate_common_url('db')); - } - - public function testNewStyle() - { - $GLOBALS['server'] = 'x'; - $GLOBALS['lang'] = 'x'; - $GLOBALS['collation_connection'] = 'x'; - $_SESSION[' PMA_token '] = 'x'; - $GLOBALS['cfg']['ServerDefault'] = 'y'; - - $separator = PMA_get_arg_separator(); - $expected = 'server=x' . htmlentities($separator) - . 'lang=x' . htmlentities($separator) - . 'collation_connection=x' . htmlentities($separator) - . 'token=x' - ; - - $expected = '?db=db' - . htmlentities($separator) . 'table=table' - . htmlentities($separator) . $expected; - $params = array('db' => 'db', 'table' => 'table'); - $this->assertEquals($expected, PMA_generate_common_url($params)); - } - - public function testOldStyleWithAlternateSeparator() - { - $GLOBALS['server'] = 'x'; - $GLOBALS['lang'] = 'x'; - $GLOBALS['collation_connection'] = 'x'; - $_SESSION[' PMA_token '] = 'x'; - $GLOBALS['cfg']['ServerDefault'] = 'y'; - - $separator = PMA_get_arg_separator(); - $expected = 'server=x' . $separator - . 'lang=x' . $separator - . 'collation_connection=x' . $separator - . 'token=x' - ; - - $expected = 'db=db' . $separator . 'table=table' . $separator . $expected; - $this->assertEquals($expected, PMA_generate_common_url('db', 'table', '&')); - } - - public function testOldStyleWithAlternateSeparatorDbOnly() - { - $GLOBALS['server'] = 'x'; - $GLOBALS['lang'] = 'x'; - $GLOBALS['collation_connection'] = 'x'; - $_SESSION[' PMA_token '] = 'x'; - $GLOBALS['cfg']['ServerDefault'] = 'y'; - - $separator = PMA_get_arg_separator(); - $expected = 'server=x' . $separator - . 'lang=x' . $separator - . 'collation_connection=x' . $separator - . 'token=x' - ; - - $expected = 'db=db' . $separator . $expected; - $this->assertEquals($expected, PMA_generate_common_url('db', '', '&')); - } - - public function testDefault() - { - $GLOBALS['server'] = 'x'; - $GLOBALS['lang'] = 'x'; - $GLOBALS['collation_connection'] = 'x'; - $_SESSION[' PMA_token '] = 'x'; - $GLOBALS['cfg']['ServerDefault'] = 'y'; - - $separator = PMA_get_arg_separator(); - $expected = 'server=x' . htmlentities($separator) - . 'lang=x' . htmlentities($separator) - . 'collation_connection=x' . htmlentities($separator) - . 'token=x' - ; - $this->assertEquals($expected, PMA_generate_common_url()); - } -} -?> diff --git a/test/PMA_get_real_size_test.php b/test/PMA_get_real_size_test.php deleted file mode 100644 index 14d2a61fe..000000000 --- a/test/PMA_get_real_size_test.php +++ /dev/null @@ -1,45 +0,0 @@ -assertEquals(0, PMA_get_real_size('0')); - } - - public function testKilobyte() - { - $this->assertEquals(1024, PMA_get_real_size('1kb')); - } - - public function testKilobyte2() - { - $this->assertEquals(1024 * 1024, PMA_get_real_size('1024k')); - } - - public function testMegabyte() - { - $this->assertEquals(8 * 1024 * 1024, PMA_get_real_size('8m')); - } - - public function testGigabyte() - { - $this->assertEquals(12 * 1024 * 1024 * 1024, PMA_get_real_size('12gb')); - } -} -?> diff --git a/test/PMA_headerLocation_test.php b/test/PMA_headerLocation_test.php deleted file mode 100644 index daad6897c..000000000 --- a/test/PMA_headerLocation_test.php +++ /dev/null @@ -1,304 +0,0 @@ -rename_function('headers_sent', 'headers_sent'.str_replace(array('.', ' '),array('', ''),microtime())); - * - * @package phpMyAdmin-test - */ - -class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase -{ - - protected $oldIISvalue; - protected $oldSIDvalue; - protected $runkitExt; - protected $apdExt; - - - - public function __construct() - { - parent::__construct(); - $this->runkitExt = false; - if (function_exists("runkit_constant_redefine")) - $this->runkitExt = true; - - $this->apdExt = false; - if (function_exists("rename_function")) - $this->apdExt = true; - - - if ($this->apdExt && !$GLOBALS['test_header']) { - - // using apd extension to overriding header and headers_sent functions for test purposes - $GLOBALS['test_header'] = 1; - - // rename_function() of header and headers_sent may cause CLI error report in Windows XP - rename_function('header', 'test_header'); - rename_function('headers_sent', 'test_headers_sent'); - - // solution from: http://unixwars.com/2008/11/29/override_function-in-php/ to overriding more than one function - - $substs = array( - 'header' => 'if (isset($GLOBALS["header"])) $GLOBALS["header"] .= $a; else $GLOBALS["header"] = $a;', - 'headers_sent' => 'return false;' - ); - - $args = array( - 'header' => '$a', - 'headers_sent' => '' - ); - - foreach ($substs as $func => $ren_func) { - if (function_exists("__overridden__")) - rename_function("__overridden__", str_replace(array('.', ' '),array('', ''),microtime())); - override_function($func, $args[$func], $substs[$func]); - rename_function("__overridden__", str_replace(array('.', ' '),array('', ''),microtime())); - } - - } - } - - public function __destruct() - { - // rename_function may causes CLI error report in Windows XP, but nothing more happen - - if ($this->apdExt && $GLOBALS['test_header']) { - $GLOBALS['test_header'] = 0; - - rename_function('header', 'header'.str_replace(array('.', ' '),array('', ''),microtime())); - rename_function('headers_sent', 'headers_sent'.str_replace(array('.', ' '),array('', ''),microtime())); - - rename_function('test_header', 'header'); - rename_function('test_headers_sent', 'headers_sent'); - } - } - - public function setUp() - { - // cleaning constants - if ($this->runkitExt) { - - $this->oldIISvalue = 'non-defined'; - - if (defined('PMA_IS_IIS')) { - $this->oldIISvalue = PMA_IS_IIS; - runkit_constant_redefine('PMA_IS_IIS', NULL); - } - else { - runkit_constant_add('PMA_IS_IIS', NULL); - } - - - $this->oldSIDvalue = 'non-defined'; - - if (defined('SID')) { - $this->oldSIDvalue = SID; - runkit_constant_redefine('SID', NULL); - } - else { - runkit_constant_add('SID', NULL); - } - - } - } - - - public function tearDown() - { - // cleaning constants - if ($this->runkitExt) { - - if ($this->oldIISvalue != 'non-defined') - runkit_constant_redefine('PMA_IS_IIS', $this->oldIISvalue); - elseif (defined('PMA_IS_IIS')) { - runkit_constant_remove('PMA_IS_IIS'); - } - - if ($this->oldSIDvalue != 'non-defined') - runkit_constant_redefine('SID', $this->oldSIDvalue); - elseif (defined('SID')) { - runkit_constant_remove('SID'); - } - } - - if ($this->apdExt) - unset($GLOBALS['header']); - - } - - - public function testSendHeaderLocationWithSidUrlWithQuestionMark() - { - if ($this->runkitExt && $this->apdExt) { - - runkit_constant_redefine('SID', md5('test_hash')); - - $testUri = 'http://testurl.com/test.php?test=test'; - $separator = PMA_get_arg_separator(); - - $header = 'Location: ' . $testUri . $separator . SID; - - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); - } - - } - - public function testSendHeaderLocationWithSidUrlWithoutQuestionMark() - { - if ($this->runkitExt && $this->apdExt) { - - runkit_constant_redefine('SID', md5('test_hash')); - - $testUri = 'http://testurl.com/test.php'; - $separator = PMA_get_arg_separator(); - - $header = 'Location: ' . $testUri . '?' . SID; - - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); - } - - } - - public function testSendHeaderLocationWithoutSidWithIis() - { - if ($this->runkitExt && $this->apdExt) { - - runkit_constant_redefine('PMA_IS_IIS', true); - runkit_constant_add('PMA_COMING_FROM_COOKIE_LOGIN', true); - - $testUri = 'http://testurl.com/test.php'; - $separator = PMA_get_arg_separator(); - - $header = 'Refresh: 0; ' . $testUri; - - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - - // cleaning constant - runkit_constant_remove('PMA_COMING_FROM_COOKIE_LOGIN'); - - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); - } - - } - - public function testSendHeaderLocationWithoutSidWithoutIis() - { - if ($this->apdExt) { - - $testUri = 'http://testurl.com/test.php'; - $header = 'Location: ' . $testUri; - - PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header'] - $this->assertEquals($header, $GLOBALS['header']); - - } else { - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); - } - - } - - public function testSendHeaderLocationIisLongUri() - { - if (defined('PMA_IS_IIS') && $this->runkitExt) - runkit_constant_redefine('PMA_IS_IIS', true); - elseif (!defined('PMA_IS_IIS')) - define('PMA_IS_IIS', true); - else - $this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension'); - - - // over 600 chars - $testUri = 'http://testurl.com/test.php?testlonguri=over600chars&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test'; - $testUri_html = htmlspecialchars($testUri); - $testUri_js = PMA_escapeJsString($testUri); - - $header = "- - -\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n"; - - - $this->expectOutputString($header); - - PMA_sendHeaderLocation($testUri); - } - - /** - * other output tests - */ - - public function testWriteReloadNavigation() - { - $GLOBALS['reload'] = true; - $GLOBALS['db'] = 'test_db'; - - $url = './navigation.php?db='.$GLOBALS['db'] . '&lang=en-utf-8&convcharset=utf-8'; - $write = PHP_EOL . '' . PHP_EOL; - - $this->expectOutputString($write); - PMA_reloadNavigation(); - - $this->assertFalse(isset($GLOBALS['reload'])); - unset($GLOBALS['db']); - } -} -?> diff --git a/test/PMA_ifSetOr_test.php b/test/PMA_ifSetOr_test.php deleted file mode 100644 index fbeb80ee0..000000000 --- a/test/PMA_ifSetOr_test.php +++ /dev/null @@ -1,49 +0,0 @@ -assertEquals($in, $out); - } - public function testVarSetWrongType() - { - $default = 'foo'; - $in = 'bar'; - $out = PMA_ifSetOr($in, $default, 'boolean'); - $this->assertEquals($out, $default); - } - public function testVarNotSet() - { - $default = 'foo'; - // $in is not set! - $out = PMA_ifSetOr($in, $default); - $this->assertEquals($out, $default); - } - public function testVarNotSetNoDefault() - { - // $in is not set! - $out = PMA_ifSetOr($in); - $this->assertEquals($out, null); - } - -} -?> diff --git a/test/PMA_isValid_test.php b/test/PMA_isValid_test.php deleted file mode 100644 index ffd41a261..000000000 --- a/test/PMA_isValid_test.php +++ /dev/null @@ -1,114 +0,0 @@ -assertFalse(isset($var)); - } - public function testNotSet() - { - $this->assertFalse(PMA_isValid($var)); - } - public function testEmptyString() - { - $var = ''; - $this->assertFalse(PMA_isValid($var)); - } - public function testNotEmptyString() - { - $var = '0'; - $this->assertTrue(PMA_isValid($var)); - } - public function testZero() - { - $var = 0; - $this->assertTrue(PMA_isValid($var)); - } - public function testNullFail() - { - $var = null; - $this->assertFalse(PMA_isValid($var)); - } - public function testNotSetArray() - { - $this->assertFalse(PMA_isValid($array['x'])); - } - public function testScalarString() - { - $var = 'string'; - $this->assertTrue(PMA_isValid($var, 'scalar')); - } - public function testScalarInt() - { - $var = 1; - $this->assertTrue(PMA_isValid($var, 'scalar')); - } - public function testScalarFloat() - { - $var = 1.1; - $this->assertTrue(PMA_isValid($var, 'scalar')); - } - public function testScalarBool() - { - $var = true; - $this->assertTrue(PMA_isValid($var, 'scalar')); - } - public function testNotScalarArray() - { - $var = array('test'); - $this->assertFalse(PMA_isValid($var, 'scalar')); - } - public function testNotScalarNull() - { - $var = null; - $this->assertFalse(PMA_isValid($var, 'scalar')); - } - public function testNumericInt() - { - $var = 1; - $this->assertTrue(PMA_isValid($var, 'numeric')); - } - public function testNumericFloat() - { - $var = 1.1; - $this->assertTrue(PMA_isValid($var, 'numeric')); - } - public function testNumericZero() - { - $var = 0; - $this->assertTrue(PMA_isValid($var, 'numeric')); - } - public function testNumericString() - { - $var = '+0.1'; - $this->assertTrue(PMA_isValid($var, 'numeric')); - } - public function testValueInArray() - { - $var = 'a'; - $this->assertTrue(PMA_isValid($var, array('a', 'b', ))); - } - public function testValueNotInArray() - { - $var = 'c'; - $this->assertFalse(PMA_isValid($var, array('a', 'b', ))); - } -} -?> diff --git a/test/PMA_localisedDateTimespan_test.php b/test/PMA_localisedDateTimespan_test.php deleted file mode 100644 index e472373f7..000000000 --- a/test/PMA_localisedDateTimespan_test.php +++ /dev/null @@ -1,109 +0,0 @@ -tmpGlobals = $GLOBALS; - $this->tmpSession = $_SESSION; - $this->tmpTimezone = date_default_timezone_get(); - date_default_timezone_set('Europe/London'); - } - - /** - * recovering globals and session - */ - public function tearDown() { - - $GLOBALS = $this->tmpGlobals; - $_SESSION = $this->tmpSession; - date_default_timezone_set($this->tmpTimezone); - - } - - /** - * data provider for localised date test - */ - - public function localisedDateDataProvider() { - return array( - array(1227455558, '', 'Nov 23, 2008 at 03:52 PM'), - array(1227455558, '%Y-%m-%d %H:%M:%S %a', '2008-11-23 15:52:38 Sun') - ); - } - - /** - * localised date test, globals are defined - * @dataProvider localisedDateDataProvider - */ - - public function testLocalisedDate($a, $b, $e) { - $this->assertEquals($e, PMA_localisedDate($a, $b)); - } - - /** - * data provider for localised timestamp test - */ - - public function timespanFormatDataProvider() { - return array( - array(1258, '0 days, 0 hours, 20 minutes and 58 seconds'), - array(821958, '9 days, 12 hours, 19 minutes and 18 seconds') - ); - } - - /** - * localised timestamp test, globals are defined - * @dataProvider timespanFormatDataProvider - */ - - public function testTimespanFormat($a, $e) { - $GLOBALS['timespanfmt'] = '%s days, %s hours, %s minutes and %s seconds'; - - $this->assertEquals($e, PMA_timespanFormat($a)); - } -} -?> diff --git a/test/PMA_pow_test.php b/test/PMA_pow_test.php deleted file mode 100644 index cb62e528c..000000000 --- a/test/PMA_pow_test.php +++ /dev/null @@ -1,82 +0,0 @@ -assertEquals('1267650600228229401496703205376', - PMA_pow(2, 100)); - } - - public function testBcpow() - { - if (function_exists('bcpow')) { - $this->assertEquals('1267650600228229401496703205376', - PMA_pow(2, 100, 'bcpow')); - } else { - $this->markTestSkipped('function bcpow() does not exist'); - } - } - - public function testGmppow() - { - if (function_exists('gmp_pow')) { - $this->assertEquals('1267650600228229401496703205376', - PMA_pow(2, 100, 'gmp_pow')); - } else { - $this->markTestSkipped('function gmp_pow() does not exist'); - } - } - - public function _testNegativeExp() - { - $this->assertEquals(0.25, - PMA_pow(2, -2)); - } - - public function _testNegativeExpPow() - { - if (function_exists('pow')) { - $this->assertEquals(0.25, - PMA_pow(2, -2, 'pow')); - } else { - $this->markTestSkipped('function pow() does not exist'); - } - } - - public function _testNegativeExpBcpow() - { - if (function_exists('bcpow')) { - $this->assertEquals(0.25, - PMA_pow(2, -2, 'bcpow')); - } else { - $this->markTestSkipped('function bcpow() does not exist'); - } - } - - public function _testNegativeExpGmppow() - { - if (function_exists('gmp_pow')) { - $this->assertEquals(0.25, - PMA_pow(2, -2, 'gmp_pow')); - } else { - $this->markTestSkipped('function gmp_pow() does not exist'); - } - } -} -?> diff --git a/test/PMA_printableBitValue_test.php b/test/PMA_printableBitValue_test.php deleted file mode 100644 index 9351eb808..000000000 --- a/test/PMA_printableBitValue_test.php +++ /dev/null @@ -1,47 +0,0 @@ -assertEquals($e, PMA_printable_bit_value($a, $b)); - } -} -?> diff --git a/test/PMA_quoting_slashing_test.php b/test/PMA_quoting_slashing_test.php deleted file mode 100644 index f80102554..000000000 --- a/test/PMA_quoting_slashing_test.php +++ /dev/null @@ -1,111 +0,0 @@ -assertEquals("\\\\\\\\\'test\'\'\\\\\\\\\'\'\\\\\\\\\'\\r\\t\\n", PMA_sqlAddslashes($string, true, true, true)); - $this->assertEquals("\\\\\\\\''test''''\\\\\\\\''''\\\\\\\\''\\r\\t\\n", PMA_sqlAddslashes($string, true, true, false)); - $this->assertEquals("\\\\\\\\\'test\'\'\\\\\\\\\'\'\\\\\\\\\'\r\t\n", PMA_sqlAddslashes($string, true, false, true)); - $this->assertEquals("\\\\\\\\''test''''\\\\\\\\''''\\\\\\\\''\r\t\n", PMA_sqlAddslashes($string, true, false, false)); - $this->assertEquals("\\\\\'test\'\'\\\\\'\'\\\\\'\\r\\t\\n", PMA_sqlAddslashes($string, false, true, true)); - $this->assertEquals("\\\\''test''''\\\\''''\\\\''\\r\\t\\n", PMA_sqlAddslashes($string, false, true, false)); - $this->assertEquals("\\\\\'test\'\'\\\\\'\'\\\\\'\r\t\n", PMA_sqlAddslashes($string, false, false, true)); - $this->assertEquals("\\\\''test''''\\\\''''\\\\''\r\t\n", PMA_sqlAddslashes($string, false, false, false)); - } - - /** - * data provider for unQuote test - */ - - public function unQuoteProvider() { - return array( - array('"test\'"', "test'"), - array("'test''", "test'"), - array("`test'`", "test'"), - array("'test'test", "'test'test") - ); - } - - /** - * unQuote test - * @dataProvider unQuoteProvider - */ - - public function testUnQuote($param, $expected) { - $this->assertEquals($expected, PMA_unQuote($param)); - } - - /** - * data provider for unQuote test with chosen quote - */ - - public function unQuoteSelectedProvider() { - return array( - array('"test\'"', "test'"), - array("'test''", "'test''"), - array("`test'`", "`test'`"), - array("'test'test", "'test'test") - ); - } - - /** - * unQuote test with chosen quote - * @dataProvider unQuoteSelectedProvider - */ - - public function testUnQuoteSelectedChar($param, $expected) { - $this->assertEquals($expected, PMA_unQuote($param, '"')); - } - - /** - * data provider for backquote test - */ - - public function backquoteDataProvider() { - return array( - array('0', '`0`'), - array('test', '`test`'), - array('te`st', '`te``st`'), - array(array('test', 'te`st', '', '*'), array('`test`', '`te``st`', '', '*')) - ); - } - - /** - * backquote test with different param $do_it (true, false) - * @dataProvider backquoteDataProvider - */ - - public function testBackquote($a, $b) { - $this->assertEquals($a, PMA_backquote($a, false)); - $this->assertEquals($b, PMA_backquote($a)); - } -} -?> diff --git a/test/PMA_sanitize_test.php b/test/PMA_sanitize_test.php deleted file mode 100644 index 1400c7ede..000000000 --- a/test/PMA_sanitize_test.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals('[a@javascript:alert(\'XSS\');@target]link', - PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]')); - } - - public function testLink() - { - $this->assertEquals('link', - PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]')); - } - - public function testHtmlTags() - { - $this->assertEquals('<div onclick="">', - PMA_sanitize('
')); - } - - public function testBbcoe() - { - $this->assertEquals('strong', - PMA_sanitize('[b]strong[/b]')); - } -} -?> diff --git a/test/PMA_showHint_test.php b/test/PMA_showHint_test.php deleted file mode 100644 index 2ff37fee9..000000000 --- a/test/PMA_showHint_test.php +++ /dev/null @@ -1,176 +0,0 @@ -tmpGlobals = $GLOBALS; - $this->tmpSession = $_SESSION; - } - - /** - * recovering globals and session - */ - public function tearDown() - { - $GLOBALS = $this->tmpGlobals; - $_SESSION = $this->tmpSession; - } - - /** - * PMA_showHint with defined GLOBALS - */ - public function testShowHintReturnValue() - { - $key = md5('test'); - $nr = 1234; - $instance = 1; - - $GLOBALS['footnotes'][$key]['nr'] = $nr; - $GLOBALS['footnotes'][$key]['instance'] = $instance; - $this->assertEquals(sprintf('%d', - $nr, $instance + 1, $nr), PMA_showHint('test')); - } - - /** - * PMA_showHint with defined GLOBALS formatted as BB - */ - public function testShowHintReturnValueBbFormat() - { - $key = md5('test'); - $nr = 1234; - $instance = 1; - - $GLOBALS['footnotes'][$key]['nr'] = $nr; - $GLOBALS['footnotes'][$key]['instance'] = $instance; - $this->assertEquals(sprintf('[sup]%d[/sup]', $nr), - PMA_showHint('test', true)); - } - - /** - * PMA_showHint with not defined GLOBALS - */ - public function testShowHintSetting() - { - $key = md5('test'); - $nr = 1; - $instance = 1; - - $this->assertEquals(sprintf('%d', $nr, $instance, $nr), PMA_showHint('test', false, 'notice')); - - $expArray = array( - 'note' => 'test', - 'type' => 'notice', - 'nr' => count($GLOBALS['footnotes']), - 'instance' => 1, - ); - - $this->assertEquals($expArray, $GLOBALS['footnotes'][$key]); - } - - /** - * PMA_showHint with not defined GLOBALS formatted as BB - */ - public function testShowHintSettingBbFormat() - { - $key = md5('test'); - $nr = 1; - $instance = 1; - - $this->assertEquals(sprintf('[sup]%d[/sup]', $nr), PMA_showHint('test', true, 'notice')); - - $expArray = array( - 'note' => 'test', - 'type' => 'notice', - 'nr' => count($GLOBALS['footnotes']), - 'instance' => 1, - ); - - $this->assertEquals($expArray, $GLOBALS['footnotes'][$key]); - } - - /** - * PMA_showHint with defined GLOBALS using PMA_Message object - */ - public function testShowHintPmaMessageReturnValue() - { - $nr = 1; - $instance = 1; - - $oMock = $this->getMock('PMA_Message', - array('setMessage', 'setNumber', 'getHash', 'getLevel')); - $oMock->setMessage('test'); - $oMock->setNumber($nr); - - $key = $oMock->getHash(); - - $GLOBALS['footnotes'][$key]['nr'] = $nr; - $GLOBALS['footnotes'][$key]['instance'] = $instance; - - $this->assertEquals(sprintf('%d', - $nr, $instance + 1, $nr), PMA_showHint($oMock)); - } - - /** - * PMA_showHint with not defined GLOBALS using PMA_Message object - */ - public function testShowHintPmaMessageSetting() - { - $nr = 1; - $instance = 1; - - $oMock = $this->getMock('PMA_Message', - array('setMessage', 'setNumber', 'getHash', 'getLevel', 'getNumber')); - $oMock->setMessage('test'); - $oMock->setNumber($nr); - - $this->assertEquals(sprintf('%d', $nr, $instance, $nr), PMA_showHint($oMock, false)); - - $key = $oMock->getHash(); - - $expArray = array( - 'note' => $oMock, - 'type' => $oMock->getLevel(), - 'nr' => count($GLOBALS['footnotes']), - 'instance' => 1, - ); - - $this->assertEquals($expArray, $GLOBALS['footnotes'][$key]); - } -} -?> diff --git a/test/PMA_stringOperations_test.php b/test/PMA_stringOperations_test.php deleted file mode 100644 index 38aa26bf7..000000000 --- a/test/PMA_stringOperations_test.php +++ /dev/null @@ -1,134 +0,0 @@ -tmpGlobals = $GLOBALS; - $this->tmpSession = $_SESSION; - - } - - /** - * data provider for flipstring test - */ - - public function flipStringDataProvider() { - return array( - array('test', "t
\ne
\ns
\nt"), - array('te ;st', "t
\ne
\n 
\n;
\ns
\nt") - ); - } - - /** - * test of changing string from horizontal to vertical orientation - * @dataProvider flipStringDataProvider - */ - - public function testFlipString($a, $e) { - $this->assertEquals($e, PMA_flipstring($a)); - } - - /** - * data provider for userDir test - */ - - public function userDirDataProvider() { - return array( - array('/var/pma_tmp/%u/', "/var/pma_tmp/root/"), - array('/home/%u/pma', "/home/root/pma/") - ); - } - - /** - * test of generating user dir, globals are defined - * @dataProvider userDirDataProvider - */ - - public function testUserDirString($a, $e) { - $GLOBALS['cfg']['Server']['user'] = 'root'; - - $this->assertEquals($e, PMA_userDir($a)); - } - - /** - * data provider for replace binary content test - */ - - public function replaceBinaryContentsDataProvider() { - return array( - array("\x000", '\00'), - array("\x08\x0a\x0d\x1atest", '\b\n\r\Ztest'), - array("\ntest", '\ntest') - ); - } - - /** - * replace binary contents test - * @dataProvider replaceBinaryContentsDataProvider - */ - - public function testReplaceBinaryContents($a, $e) { - $this->assertEquals($e, PMA_replace_binary_contents($a)); - } - - /** - * data provider for duplicate first newline test - */ - - public function duplicateFirstNewlineDataProvider() { - return array( - array('test', 'test'), - array("\r\ntest", "\n\r\ntest"), - array("\ntest", "\ntest"), - array("\n\r\ntest", "\n\r\ntest") - ); - } - - /** - * duplicate first newline test - * @dataProvider duplicateFirstNewlineDataProvider - */ - - public function testDuplicateFirstNewline($a, $e) { - $this->assertEquals($e, PMA_duplicateFirstNewline($a)); - } - -} -?> diff --git a/test/PMA_transformation_getOptions_test.php b/test/PMA_transformation_getOptions_test.php deleted file mode 100644 index 126a6204c..000000000 --- a/test/PMA_transformation_getOptions_test.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals(array('option1 ', ' option2 '), - PMA_transformation_getOptions("option1 , option2 ")); - } - - public function testQuoted() - { - $this->assertEquals(array('option1', ' option2'), - PMA_transformation_getOptions("'option1' ,' option2' ")); - } - - public function testComma() - { - $this->assertEquals(array('2,3', ' ,, option ,,'), - PMA_transformation_getOptions("'2,3' ,' ,, option ,,' ")); - } - - public function testEmptyOptions() - { - $this->assertEquals(array('', '', ''), - PMA_transformation_getOptions("'',,")); - } - - public function testEmpty() - { - $this->assertEquals(array(), - PMA_transformation_getOptions('')); - } -} -?> diff --git a/test/PMA_whichCrlf_test.php b/test/PMA_whichCrlf_test.php deleted file mode 100644 index 244b548cd..000000000 --- a/test/PMA_whichCrlf_test.php +++ /dev/null @@ -1,71 +0,0 @@ -assertEquals("\r\n", PMA_whichCrlf()); - else - $this->assertEquals("\n", PMA_whichCrlf()); - - $this->markTestIncomplete('Cannot redefine constant'); - - } else { - - if ($runkit) - define('PMA_USR_OS', 'Linux'); - $this->assertEquals("\n", PMA_whichCrlf()); - - if ($runkit) - runkit_constant_redefine('PMA_USR_OS', 'Win'); - else - define('PMA_USR_OS', 'Win'); - $this->assertEquals("\r\n", PMA_whichCrlf()); - - } - - if ($runkit) { - if (isset($pma_usr_os)) - runkit_constant_redefine('PMA_USR_OS', 'Win'); - else - runkit_constant_remove('PMA_USR_OS'); - } - } - -} -?> diff --git a/test/PmaSeleniumLoginTest.php b/test/PmaSeleniumLoginTest.php deleted file mode 100644 index 9c1be97b8..000000000 --- a/test/PmaSeleniumLoginTest.php +++ /dev/null @@ -1,20 +0,0 @@ -doLogin(); - $this->assertRegExp("/phpMyAdmin .*-dev/", $this->getTitle()); - } -} -?> diff --git a/test/PmaSeleniumPrivilegesTest.php b/test/PmaSeleniumPrivilegesTest.php deleted file mode 100644 index 64ff25d10..000000000 --- a/test/PmaSeleniumPrivilegesTest.php +++ /dev/null @@ -1,47 +0,0 @@ -doLogin(); - $this->selectFrame("frame_content"); - $this->click("link=Change password"); - $this->waitForPageToLoad("30000"); - try { - $this->assertEquals("", $this->getValue("text_pma_pw")); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - array_push($this->verificationErrors, $e->toString()); - } - try { - $this->assertEquals("", $this->getValue("text_pma_pw2")); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - array_push($this->verificationErrors, $e->toString()); - } - try { - $this->assertEquals("", $this->getValue("generated_pw")); - } catch (PHPUnit_Framework_AssertionFailedError $e) { - array_push($this->verificationErrors, $e->toString()); - } - $this->click("button_generate_password"); - $this->assertNotEquals("", $this->getValue("text_pma_pw")); - $this->assertNotEquals("", $this->getValue("text_pma_pw2")); - $this->assertNotEquals("", $this->getValue("generated_pw")); - $this->type("text_pma_pw", $this->cfg['Test']['testuser']['password']); - $this->type("text_pma_pw2", $this->cfg['Test']['testuser']['password']); - $this->click("change_pw"); - $this->waitForPageToLoad("30000"); - $this->assertTrue($this->isTextPresent("")); - $this->assertTrue($this->isTextPresent("")); - } -} -?> diff --git a/test/PmaSeleniumTestCase.php b/test/PmaSeleniumTestCase.php deleted file mode 100644 index ac70594d4..000000000 --- a/test/PmaSeleniumTestCase.php +++ /dev/null @@ -1,100 +0,0 @@ - 'Firefox on Windows XP', - 'browser' => '*firefox', - 'host' => 'my.windowsxp.box', - 'port' => 4444, - 'timeout' => 30000, - ), - - array( - 'name' => 'Internet Explorer on Windows XP', - 'browser' => '*iexplore', - 'host' => 'my.windowsxp.box', - 'port' => 4444, - 'timeout' => 30000, - ), - - ); - - public function setUp() - { - global $cfg; - $this->cfg =& $cfg; - //PHPUnit_Extensions_SeleniumTestCase::$browsers = $this->cfg['Test']['broswers']; - - // Check if the test configuration is available - if ( empty($cfg['Test']['pma_host']) - || empty($cfg['Test']['pma_url']) - //|| empty($cfg['Test']['browsers']) - ) { - $this->fail("Missing Selenium configuration in config.inc.php"); // TODO add doc ref? - } - - $this->setBrowserUrl($cfg['Test']['pma_host'] . $cfg['Test']['pma_url']); - - $this->start(); - } - - public function tearDown() - { - $this->stop(); - } - - /** - * perform a login - */ - public function doLogin() - { - $this->open($this->cfg['Test']['pma_url']); - // Somehow selenium does not like the language selection on the cookie login page, forced English in the config for now. - //$this->select("lang", "label=English"); - - $this->waitForPageToLoad("30000"); - $this->type("input_username", $this->cfg['Test']['testuser']['username']); - $this->type("input_password", $this->cfg['Test']['testuser']['password']); - $this->click("input_go"); - $this->waitForPageToLoad("30001"); - } - - /* - * Just a dummy to show some example statements - * - public function mockTest() - { - // Slow down the testing speed, ideal for debugging - //$this->setSpeed(4000); -} - */ -} - -?> diff --git a/test/PmaSeleniumXssTest.php b/test/PmaSeleniumXssTest.php deleted file mode 100644 index 5099506f9..000000000 --- a/test/PmaSeleniumXssTest.php +++ /dev/null @@ -1,24 +0,0 @@ -doLogin(); - $this->selectFrame("frame_content"); - $this->click("link=SQL"); - $this->waitForPageToLoad("30000"); - $this->type("sqlquery", "'\">"); - $this->click("SQL"); - // If an alert pops up the test fails, since we don't handle an alert. - } -} -?> diff --git a/test/theme.php b/test/theme.php deleted file mode 100644 index fa6b64d78..000000000 --- a/test/theme.php +++ /dev/null @@ -1,314 +0,0 @@ - - - - - phpMyAdmin <?php echo PMA_VERSION; ?> - - <?php echo htmlspecialchars($HTTP_HOST); ?> - Theme Test - - - - - - -' - .'-' . "\n"; -$item = '' - .' ' . "\n" - .'%4$s: %3$s' . "\n"; - -echo '
' . "\n"; -printf($item, - $GLOBALS['cfg']['DefaultTabServer'], - PMA_generate_common_url(), - 'Server', - __('Server'), - 's_host.png'); - -echo $separator; -printf($item, - $GLOBALS['cfg']['DefaultTabDatabase'], - '', - 'Database', - __('Database'), - 's_db.png'); - -echo $separator; -printf($item, - $GLOBALS['cfg']['DefaultTabTable'], - '', - 'Table', - (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] - ? __('View') - : __('Table')), - (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] - ? 'b_views' - : 's_tbl') . '.png'); - -echo '' - .'"Table comment"' . "\n"; - -echo '
'; - - -/** - * Displays tab links - */ -$tabs = array(); - -$tabs['databases']['icon'] = '../../../../' . $pmaThemeImage . 's_db.png'; -$tabs['databases']['link'] = 'server_databases.php'; -$tabs['databases']['text'] = __('Databases'); - -$tabs['sql']['icon'] = '../../../../' . $pmaThemeImage . 'b_sql.png'; -$tabs['sql']['link'] = 'server_sql.php'; -$tabs['sql']['text'] = __('SQL'); - -$tabs['status']['icon'] = '../../../../' . $pmaThemeImage . 's_status.png'; -$tabs['status']['link'] = 'server_status.php'; -$tabs['status']['text'] = __('Status'); - -$tabs['vars']['icon'] = '../../../../' . $pmaThemeImage . 's_vars.png'; -$tabs['vars']['link'] = 'server_variables.php'; -$tabs['vars']['text'] = __('Variables'); - -$tabs['charset']['icon'] = '../../../../' . $pmaThemeImage . 's_asci.png'; -$tabs['charset']['link'] = 'server_collations.php'; -$tabs['charset']['text'] = __('Charsets'); - -$tabs['engine']['icon'] = '../../../../' . $pmaThemeImage . 'b_engine.png'; -$tabs['engine']['link'] = 'server_engines.php'; -$tabs['engine']['text'] = __('Engines'); - -$tabs['rights']['icon'] = '../../../../' . $pmaThemeImage . 's_rights.png'; -$tabs['rights']['link'] = 'server_privileges.php'; -$tabs['rights']['text'] = __('Privileges'); - -$tabs['binlog']['icon'] = '../../../../' . $pmaThemeImage . 's_tbl.png'; -$tabs['binlog']['link'] = 'server_binlog.php'; -$tabs['binlog']['text'] = __('Binary log'); - -$tabs['process']['icon'] = '../../../../' . $pmaThemeImage . 's_process.png'; -$tabs['process']['link'] = 'server_processlist.php'; -$tabs['process']['text'] = 'caution'; -$tabs['process']['class'] = 'caution'; - -$tabs['export']['icon'] = '../../../../' . $pmaThemeImage . 'b_export.png'; -$tabs['export']['text'] = 'disabled'; - -$tabs['export2']['icon'] = '../../../../' . $pmaThemeImage . 'b_export.png'; -$tabs['export2']['text'] = 'disabled caution'; -$tabs['export2']['class'] = 'caution'; - -$tabs['import']['icon'] = '../../../../' . $pmaThemeImage . 'b_import.png'; -$tabs['import']['link'] = 'server_import.php'; -$tabs['import']['text'] = 'active'; -$tabs['import']['class'] = 'active'; - -echo PMA_generate_html_tabs($tabs, array()); -unset($tabs); - -if (@file_exists($pmaThemeImage . 'logo_right.png')) { - ?> - phpMyAdmin - -

-phpMyAdmin ' . PMA_VERSION . ''); -?> -

- -
- -
-
- -getHtmlSelectBox(false); -?> - -
-
- -
- -

H1 Header

-

H2 Header

-

H3 Header

-

H4 Header

- -
- success message box content! -
-
-

Auccess message box header!

- success message box content! -
- -
- notice message box content! -
-
-

Notice message box header!

- notice message box content! -
-
- error message box content! -
-
-

Error message box header!

- error message box content! -
- -
- Confirmation fieldset - QUERY TO EXECUTE; -
-
- - -
- -
- -
- success message box content! -
- - -SELECT *
-FROM `test`
-LIMIT 0, 30;
-SELECT *
-FROM `test`
-LIMIT 0, 30;
-SELECT *
-FROM `test`
-LIMIT 0, 30;
-SELECT *
-FROM `test`
-LIMIT 0, 30;
-
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
table.data caption
table.data thead tr thtable.data thead tr thactiontable.data thead tr th
table.data tfoot tr thtable.data tfoot tr thactiontable.data tfoot tr th
td.valuedropdropdroptable.data tbody tr.odd td
td.valuedropdropdroptable.data tbody tr.even td
td.valuedropdropdroptable.data tbody tr.odd td
td.valuedropdropdroptable.data tbody tr.even td
- - diff --git a/test/wui.php b/test/wui.php deleted file mode 100644 index c3b459d0a..000000000 --- a/test/wui.php +++ /dev/null @@ -1,18 +0,0 @@ -'; -AllTests::main(); -echo ''; - -?>