├── .gitignore ├── images ├── help.gif ├── logo.png ├── backup.gif ├── config.gif ├── db_info.gif ├── favicon.png ├── import.gif ├── index.gif ├── login.gif ├── scheduled.gif └── sql_query.gif ├── global_conf_sql.php ├── doc ├── MULTI_USER_MODE.txt ├── SEVERAL_SERVERS.txt ├── UPGRADE.txt ├── INSTALL.txt ├── SHELL_MODE.txt ├── SCHEDULED_BACKUPS.txt ├── SYSTEM_VARIABLES.txt └── HISTORY.txt ├── global_conf.php ├── global_conf_mu.php ├── README.txt ├── get_file.php ├── stylesheets └── standard.css ├── file_info.php ├── javascripts.js ├── index.php ├── login.php ├── db_info.php ├── sys_vars.inc.php ├── big_import.php ├── language ├── czech_help.php ├── english_help.php ├── english.inc.php └── czech.inc.php ├── definitions.php ├── backup.php ├── import.php ├── sql_query.php └── scheduled.php /.gitignore: -------------------------------------------------------------------------------- 1 | /files 2 | schedule_backup.php -------------------------------------------------------------------------------- /images/help.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/help.gif -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/logo.png -------------------------------------------------------------------------------- /images/backup.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/backup.gif -------------------------------------------------------------------------------- /images/config.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/config.gif -------------------------------------------------------------------------------- /images/db_info.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/db_info.gif -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/favicon.png -------------------------------------------------------------------------------- /images/import.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/import.gif -------------------------------------------------------------------------------- /images/index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/index.gif -------------------------------------------------------------------------------- /images/login.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/login.gif -------------------------------------------------------------------------------- /images/scheduled.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/scheduled.gif -------------------------------------------------------------------------------- /images/sql_query.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreshg112/phpMyBackupPro/HEAD/images/sql_query.gif -------------------------------------------------------------------------------- /global_conf_sql.php: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /doc/MULTI_USER_MODE.txt: -------------------------------------------------------------------------------- 1 | MULTI USER MODE 2 | =============== 3 | 4 | You can use phpMyBackupPro for several users/accounts of one database. 5 | 6 | To do this you have to modify the global_conf_mu.php file and adapt the settings which 7 | are described inside this file. 8 | 9 | You will have to provide the MySQL root account data which are used by phpMyBackupPro 10 | to determine all available MySQL users. 11 | 12 | You can enter a path where the backups will be saved for each user and any user will 13 | only get access to his own backup files. 14 | 15 | The file global_conf.php will still be used to save the settings made on the 16 | configuration page by each user. Many settings can only be modified by the MySQL root. 17 | Just configure the global_conf_mu.php and try it out! 18 | 19 | Further on you can use the global_conf_mu.php to activate and deactivate features like 20 | sending backups by email, using FTP uploads or the directory backup feature. -------------------------------------------------------------------------------- /global_conf.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/SEVERAL_SERVERS.txt: -------------------------------------------------------------------------------- 1 | SEVERAL SERVERS 2 | =============== 3 | 4 | You can use one phpMyBackupPro installation to manage the MySQL backups on several servers. 5 | To do this, install phpMyBackupPro like described in INSTALL.txt first. 6 | 7 | Then move the file global_conf_sql.php to another directory. Best location is the same directory as global_conf.php. 8 | Then update line 33 in definitions.txt (See line 33 for further explanations.) 9 | 10 | Set the rights of the file global_conf_sql.php to 0777 (chmod 0777 global_conf_sql.php) 11 | 12 | Then insert all you SQL server data and login data in the file. You will find an example in the file. 13 | Don't insert the server/account data you have already entered under 'configuration' in phpMyBackupPro. 14 | This username and password will be your login data for the web interface. 15 | 16 | Ready! 17 | 18 | phpMyBackupPro will recognize the changes. You will see a new drop down box above the menu, 19 | where you can switch to the server you want to work on. 20 | 21 | phpMyBackupPro tries to create one subfolder in your export folder for each server . 22 | If this should fail, you will have to create the folders manually. You will see the error message 23 | 'Could not store database' when a backup failed because the folder does not exist. 24 | 25 | At the moment it is not possible to backup databases from several accounts with one single scheduled backup script. 26 | You have to create one script for each account. You have to update all scripts if you decrease the number of accounts or their order. 27 | 28 | Please consider donating to phpMyBackupPro. Thank you! -------------------------------------------------------------------------------- /doc/UPGRADE.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT UPGRADING INFORMATION 2 | =============================== 3 | 4 | How to upgrade? 5 | --------------- 6 | Save your export folder and delete all files of the older phpMyBackupPro installation. 7 | (Do not delete the old global_conf.php, which contains all your settings.) 8 | Then install the new version of phpMyBackupPro as explained in INSTALL.txt. 9 | 10 | 11 | If using scheduled backups 12 | -------------------------- 13 | If you are using a script for scheduled backups, do not forget to update the 14 | paths to the new pMBP directory or simply create a new script. 15 | 16 | 17 | Upgrade from version 2.3 (or earlier) 18 | ------------------------------------- 19 | If you are upgrading from version 2.3 or earlier, there may be problems with 20 | the encoding of your old backup files, as pMBP 2.4 is completely based on UTF-8. 21 | It is recommended to make new backups immediately of all important data! 22 | However, the old backups can still be imported with pMBP or phpMyAdmin but may 23 | lead to encoding problems. 24 | 25 | 26 | Upgrade from version 1.8 (or earlier) 27 | ------------------------------------- 28 | If you are upgrading from version 1.8 or earlier, your zipped backup files 29 | (zip, not gzip!) can no longer be used with pMBP 2.x. 30 | To solve this problem either unzip them or just create new backups. 31 | 32 | 33 | Upgrade from version 1.5 (or earlier) 34 | ------------------------------------- 35 | If you are using a scheduled backup script generated by version 1.5 or earlier, 36 | this will no longer work with phpmyBackupPro >= v.1.6. 37 | You can simply update it with the improved 'scheduled backup' page. 38 | (The old script should cause no error output but will no longer trigger backups.) 39 | 40 | 41 | Upgrade from version 1.2 (or earlier) 42 | ------------------------------------- 43 | If you are upgrading from version 1.2 or earlier, 44 | delete your global_conf.php file. Use the new global_conf.php file and re-enter your settings. -------------------------------------------------------------------------------- /doc/INSTALL.txt: -------------------------------------------------------------------------------- 1 | INSTALLATION 2 | ============ 3 | 4 | You need an HTTP web web server like Apache and PHP (> version 4.3) installed on this server. 5 | On your client PC you need a web browser which supports JavaScript. I recommend using Mozilla Firefox! 6 | 7 | Unzip the phpMyBackupPro zip file to your web servers public html directory (e.g. Apache: xxx/Apache/htdocs/). 8 | 9 | 10 | phpMyBackupPro will only work if you complete the following 3 steps: 11 | -------------------------------------------------------------------- 12 | 1.) For security reasons move the file global_conf.php and the directory export to another directory and maybe change the names. 13 | Best choice is a directory which is not public. (E.g. xxx/Apache/files/) 14 | Attention: 15 | On some systems phpMyBackupPro seems not to get write permissions for the export directory when it is located outside the phpMyBackupPro directory. 16 | In this case don't move the directory but move the global_conf.php file. 17 | 18 | 2.) Open the file definitions.php in an editor and change the line 28 and 29 to the paths you moved the global_conf.php and the directory export to. 19 | These paths must be relative to the file definitions.php. (E.g. ../files/global_conf.php but NOT c:/files/global_conf.php) 20 | 21 | 3.) Set the rights of the directory export and the file global_conf.php to 0777 (read, write and execute for all). 22 | (E.g. execute 'chmod 0777 global_conf.php' in a bash session or use the Windows command prompt function) 23 | 24 | Now you are (nearly) ready to use phpMyBackupPro! 25 | 26 | Load the config.php file in your browser (e.g. http://localhost/phpMyBackupPro/config.php). 27 | Insert your data (MySQL data, ...). You can get help for the individual pages by clicking on 'help'. 28 | When you start phpMyBackupPro next time you will be asked to login using your MySQL username and password. 29 | 30 | If you need more help or want to report bugs or typos, please visit http://www.phpMyBackupPro.net 31 | 32 | Please note that the development of phpMyBackupPro and the website needs plenty of time and money. 33 | If you are using phpMyBackupPro (especially in a commercial environment) please consider donating to the phpMyBackupPro project. 34 | You can donate online in only a few minutes on http://www.phpMyBackupPro.net Thank you! -------------------------------------------------------------------------------- /global_conf_mu.php: -------------------------------------------------------------------------------- 1 | 55 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | phpMyBackupPro 2 | ============== 3 | You will find the documentation of phpMyBackupPro in the folder 'doc'. 4 | The documentation includes the following files: 5 | 6 | INSTALL.txt 7 | ----------- 8 | Describes how to install phpMyBackupPro. 9 | 10 | UPGRADE.txt 11 | ----------- 12 | It is important to read this file first if you are upgrading from a phpMyBackupPro version 13 | - less than v.2.4 14 | - less than v.2.0 AND you are using ZIP backups 15 | - less than v.1.2, 16 | or if you are using scheduled backups! 17 | Continue with reading INSTALL.txt after reading this file. 18 | 19 | SCHEDULED_BACKUPS.txt 20 | --------------------- 21 | This file explains how to use phpMyBackupPro to create backups automatically. 22 | 23 | HISTORY.txt 24 | ----------- 25 | This file contains the whole version history of phpMyBackupPro. 26 | 27 | SEVERAL_SERVER.txt 28 | ------------------ 29 | Read this file, if you want to backup databases on several servers or 30 | if you want to backup several databases on one server or different accounts. 31 | 32 | SHELL_MODE.txt 33 | -------------- 34 | Describes how to use phpMyBackupPro from the command line. 35 | 36 | MULTI_USER_MODE.txt 37 | ------------------- 38 | This file describes how to set up one installation of phpMyBackupPro to be used from 39 | several MySQL users of one MySQL server (E.g. if you offer webspace with MySQL databases). 40 | 41 | SYSTEM_VARIABLES.txt 42 | -------------------- 43 | Describes the phpMyBackupPro system variables which are used to enable additional features. 44 | 45 | GNU_GPL.txt 46 | ----------- 47 | Contains the GNU General Public License under which phpMyBackupPro is licensed. 48 | 49 | 50 | More help and a FAQ can be found on http://www.phpMyBackupPro.net 51 | 52 | Please consider donating to phpMyBackupPro especially if you are using phpMyBackupPro in your company. 53 | Developing phpMyBackupPro needs a lot of time and money e.g. for the webspace. 54 | On http://www.phpMyBackupPro.net you can add a reference link to your website. 55 | 56 | | Copyright (c) 2004-2013 by Dirk Randhahn | 57 | Thanks for the icons which are derived from those on http://carlitus.deviantart.com from by Carles Carbonell. (GNU GPL) 58 | Thanks for Vincent Blavet (www.phpconcept.net) for his 'PhpConcept Library'. (GNU LGPL) 59 | Thanks for Jonny McCullagh (www.redbranchwebdesign.com) for his help with the graphic design. -------------------------------------------------------------------------------- /get_file.php: -------------------------------------------------------------------------------- 1 | "; 53 | while ($line = PMBP_getln($_GET['view'])) 54 | echo htmlspecialchars($line); 55 | PMBP_getln($_GET['view'], true); 56 | echo ""; 57 | } 58 | } 59 | } else { 60 | if (isset ($_GET['view'])) { 61 | echo $_GET['view'] . " " . F_MAIL_3 . "!"; 62 | } 63 | } 64 | ?> 65 | -------------------------------------------------------------------------------- /doc/SHELL_MODE.txt: -------------------------------------------------------------------------------- 1 | SHELL MODE 2 | ========== 3 | 4 | To use phpMyBackupPro you need to have it installed as described in INSTALL.txt. 5 | 6 | Then you can use the script like from a shell and also as a cron-job (see example below): 7 | 8 | php backup.php db1[,db2,...] [1 [0 [0 [1 [path1|[path2|... [1 [comment]]]]]] 9 | 10 | The first argument contains all databases you want to backup. They must be separated by commas. 11 | If you want to backup all databases, which are accessible, you can enter the keyword %%ALL%% 12 | The second argument specifies whether tables should be backed up (1) or not (0). 13 | The third argument specifies whether data should be backed up (1) or not (0). 14 | The fourth argument specifies whether the backup should contain 'drop table ...' (1) or not (0). 15 | The fifth argument specifies whether the backup should be gzipped (1) or not (0). 16 | (You can also enter zip for zip-backups or gzip for gzip-backups.) 17 | The sixth argument can contain the directory paths you want to backup. They must be separated by 18 | pipes (|) and surrounded by ". (FTP must be enabled on the 'configuration' tab!) 19 | The seventh arguments specifies whether the directory backup is zipped (1) or not (0) 20 | The eighth argument is the comment which is added to the backup (and also the email if configured) 21 | You should surround the comment with " like "This is the comment". 22 | 23 | All arguments but the first are optional. 24 | If you want to use for example the fifth argument, you have to specify all preceding parameters. 25 | 26 | 27 | Examples: 28 | 29 | php backup.php %%ALL%% 1 1 1 30 | This will backup all databases which can be found with data and table-structure and add the 'drop table ...' command. 31 | 32 | php backup.php db1 1 0 1 33 | Will backup the table structure of db1 and will add 'drop table ...' but will not save the data nor compress it. 34 | 35 | php backup.php db1,db2 1 1 1 1 "folder1/|../../folder2/|../folder3/folder4/" 1 36 | Will backup db1 and db2 with data and structure, will add 'drop table ...' and will gzip the backups. 37 | Also the files in the directories folder1, folder2 and folder 4 will be saved to the FTP server as ZIP file. 38 | The files in folder3 will NOT be saved, unless the "directory backup with sub-directories"-config attribute is not set. 39 | 40 | 41 | special cron-job example: 42 | You may notice that your cron jobs will be executed by another user as your webserver. Therefore it may happen, 43 | that you can't see the backup files created by the cron-job on the import tab of the pMBP web interface. To fix this, 44 | go to the config-tab and set the system-variable backup_chmod e.g. to 0700. 45 | 46 | MAILTO=john@example.com 47 | 0 2 * * * php /var/html/phpMyBackupPro/backup.php db1 1 1 1 0 "" 0 "This is a comment" 48 | 49 | This is an example, how to trigger a backup with a cron job which runs every night at 2 am. 50 | An email will be send to john@example.com with the output of the backup job (error/success messages). 51 | This will backup databases db1 with data and table-structure and add the 'drop table ...' command. The backup will 52 | not be compressed and no directories will be backed up. The comment of the backup will be "This is a comment". -------------------------------------------------------------------------------- /doc/SCHEDULED_BACKUPS.txt: -------------------------------------------------------------------------------- 1 | SCHEDULED BACKUPS 2 | ================= 3 | 4 | This file explains how to set up phpMyBackupPro to make it create MySQL 5 | backups automatically. 6 | 7 | A backup is only triggered when a visitor of your homepage indirectly 8 | (or without knowing it) calls the schedule script. You can set how often 9 | a backup is created. phpMyBackupPro takes care of the frequency you set. 10 | 11 | There are two popular ways to schedule backups: 12 | 1. by including the schedule script into an existing PHP script or 13 | 2. by using a hidden frame in a HTML frameset. 14 | 15 | In both cases you have to start with this step: 16 | 17 | 1. You have to generate a schedule script first. Open the page 18 | "scheduled script" in pMBP and select how often you want a backup to be 19 | created. Then you have to select the directory of that PHP script which 20 | will include the schedule script later (e.g. the index.php file in 21 | your root directory htdocs/). After that select the databases to backup, 22 | enter a comment and choose the settings for the backups (compression, 23 | ...). When you enabled the directory backup function you can further 24 | select directories to be backed zp. Finally press the button "show 25 | script". On the next page you will see the generated schedule script. 26 | 27 | Now you have to choose between the following two ways: 28 | 29 | 30 | Including a schedule script into an existing PHP script 31 | ------------------------------------------------------- 32 | To include the schedule script into another PHP script continue with 33 | this step: 34 | 35 | 2.) Now copy the automatically generated code and paste it at the end of 36 | a PHP script (e.g. index.php) which is placed in the directory you 37 | selected on the previous page. The line next to the ending of the 38 | generated code which looks similar to: 39 | @chdir("dirXYZ/phpMyBackupPro/"); 40 | should point to your installation of pMBP. 41 | 42 | 2a) Instead of copying the schedule script code to another PHP script 43 | you can insert an require-command and save the schedule script in an 44 | extra file. Therefore enter a filename like schedule_backup.php in the 45 | text box at the bottom of the page in pMBP and press the "Save data" 46 | button. To include the schedule file in another PHP file enter: 47 | require_once("schedule_backup.php"); 48 | at the end of the PHP file (e.g. index.php). 49 | 50 | 51 | Using a hidden frame in a HTML frameset 52 | --------------------------------------- 53 | If you have a homepage which contains a HTML frameset, you can add a 54 | single frameset as container for the schedule script. To do this 55 | continue with this step: 56 | 57 | 2.) Modify that HTML frameset which maybe looks like this: 58 | 59 | and add a invisible frame which contains the schedule script (width / 60 | height = 0) like this: 61 | 62 | This frame now runs the schedule script every time a user visizs this 63 | HTML page. 64 | 65 | 66 | Debugging 67 | --------- 68 | You can debug the backup scheduling. Go to the "configuration" page, 69 | click on "System variables" and change the value of "schedule_debug" to 70 | 1 and click "Save data". Now the schedule script prints debug 71 | informations whenever you open the PHP file in a browser. Don't forget 72 | to switch this variable back to 0 after you finished debugging! -------------------------------------------------------------------------------- /stylesheets/standard.css: -------------------------------------------------------------------------------- 1 | /* 2 | +--------------------------------------------------------------------------+ 3 | | phpMyBackupPro | 4 | +--------------------------------------------------------------------------+ 5 | | Copyright (c) 2004-2015 by Dirk Randhahn | 6 | | http://www.phpMyBackupPro.net | 7 | | Version information can be found in definitions.php. | 8 | | | 9 | | This program is free software; you can redistribute it and/or | 10 | | modify it under the terms of the GNU General Public License | 11 | | as published by the Free Software Foundation; either version 2 | 12 | | of the License, or (at your option) any later version. | 13 | | | 14 | | This program is distributed in the hope that it will be useful, | 15 | | but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 | | GNU General Public License for more details. | 18 | | | 19 | | You should have received a copy of the GNU General Public License | 20 | | along with this program; if not, write to the Free Software | 21 | | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.| 22 | +--------------------------------------------------------------------------+ 23 | */ 24 | 25 | body {font-family:Arial, Helvetica, sans-serif; font-size: 10pt; background-color:#F4F8FB;} 26 | 27 | .standard {font-size: 10pt;} 28 | .large12 {font-size: 12pt;} 29 | 30 | .bold {text-align: center; font-size: 10pt; font-weight:bold;} 31 | .bold_left {text-align: left; font-size: 10pt; font-weight:bold;} 32 | .green {text-align: center; color: #01DF00; font-weight:bold;} 33 | .green_left {text-align: left; color: #01DF00; font-weight:bold;} 34 | .red {text-align: center; color: #FF0000; font-weight:bold;} 35 | .red_left {text-align: left; color: #FF0000; font-weight:bold;} 36 | 37 | table {border-width: 0px;} 38 | th {font-size: 10pt; background-color: #FFFFFF; font-weight:bold; white-space:nowrap; border: 1px solid #B7DEFB;} 39 | .active {font-size: 10pt; background-color: #DCECF9; white-space:nowrap;} 40 | td {font-size: 10pt; text-align:left; vertical-align:middle;} 41 | .list {font-size: 10pt; background-color: #F4F8FB; border: 1px dotted #FFFFFF;} 42 | .main {height: 400px; background-color:#FFFFFF;} 43 | 44 | input {font-size: 10pt; vertical-align:middle; color: #000000; background-color: #DCECF9; border: 1px solid #B7DEFB;} 45 | select {font-size: 10pt; vertical-align:middle; color: #000000; background-color: #DCECF9; border: 1px solid #B7DEFB;} 46 | textarea {font-size: 10pt; vertical-align:middle; color: #000000; background-color: #DCECF9; border: 1px solid #B7DEFB; font-family:Arial, Helvetica, sans-serif;} 47 | .button {font-size: 10pt; font-weight: bold; vertical-align:middle; color: #000000; background-color: #DCECF9; border: 1px solid #B7DEFB; cursor:pointer;} 48 | 49 | a {color: #FFAD17; text-decoration: none; font-weight:bold;} 50 | a:hover {text-decoration: underline;} 51 | 52 | img {border-width: 0px;} 53 | 54 | /* for positioning of logo and logout and help links*/ 55 | div#logo {margin-top: 5px; margin-bottom: 5px; margin-left: 5px; float: left; height: 45px;} 56 | div#help {margin-top: 15px; margin-bottom: 5px; margin-right: 50px; float: right; height: 20px;} 57 | div#logout {margin-top: 15px; margin-bottom: 5px; margin-right: 50px; float: right; height: 20px;} 58 | -------------------------------------------------------------------------------- /file_info.php: -------------------------------------------------------------------------------- 1 | 31 | 32 | 33 | 34 | 35 | phpMyBackupPro - ".INF_INFO." 36 | 37 | 38 | \n 39 | \n"; 42 | 43 | // get and print the informations about the $_GET['file'] backup file 44 | if ($_GET['file']) { 45 | echo "\n"; 46 | echo "\n"; 47 | $size=PMBP_size_type(PMBP_file_info("size",PMBP_EXPORT_DIR.$_GET['file'])); 48 | echo "\n"; 49 | echo "\n"; 50 | echo "\n"; 51 | echo "\n"; 52 | echo "\n"; 53 | echo "\n"; 54 | echo "\n"; 55 | } else{ 56 | 57 | // return error message if no file was selected 58 | echo "\n"; 59 | } 60 | 61 | echo "
\n"; 40 | echo PMBP_image_tag("logo.png","phpMyBackupPro PMBP_WEBSITE",PMBP_WEBSITE); 41 | echo "\n


".INF_DATE.":


".strftime($CONF['date'],PMBP_file_info("time",PMBP_EXPORT_DIR.$_GET['file']))."
".INF_DB.":
".PMBP_file_info("db",PMBP_EXPORT_DIR.$_GET['file'])."
".INF_SIZE.":
".$size['value']." ".$size['type']."
".INF_COMP.":
".PMBP_file_info("comp",PMBP_EXPORT_DIR.$_GET['file'])."
".INF_DROP.":
".PMBP_file_info("drop",PMBP_EXPORT_DIR.$_GET['file'])."
".INF_TABLES.":
".PMBP_file_info("tables",PMBP_EXPORT_DIR.$_GET['file'])."
".INF_DATA.":
".PMBP_file_info("data",PMBP_EXPORT_DIR.$_GET['file'])."

".INF_COMMENT.":
".PMBP_file_info("comment",PMBP_EXPORT_DIR.$_GET['file'])."
".INF_NO_FILE."!
\n\n"; 62 | ?> 63 | -------------------------------------------------------------------------------- /javascripts.js: -------------------------------------------------------------------------------- 1 | 102 | -------------------------------------------------------------------------------- /doc/SYSTEM_VARIABLES.txt: -------------------------------------------------------------------------------- 1 | SYSTEMVARIABLES 2 | =============== 3 | 4 | This file describes the phpMyBackupPro system variables stored in $PMBP_SYS_VARS. 5 | Most of them are unimportant to know, but there are a few variables which activate 6 | some special features. You can edit them on the configuration page. 7 | 8 | $PMBP_SYS_VAR['last_login'] 9 | Contains a string showing information about the last successful login. 10 | Automatically receives the values from $PMBP_SYS_VAR['last_login'] on each login. 11 | Modifying makes no sense. 12 | 13 | $PMBP_SYS_VAR['this_login'] 14 | Contains a string showing information about the current successful login. 15 | Is updated automatically on each login. 16 | Changing makes no sense. 17 | 18 | $PMBP_SYS_VAR['security_key'] 19 | Contains a md5 hash which will never change automatically. 20 | This key must be set in the scheduled backup scripts to trigger a backup. 21 | It avoids backups triggered by someone else than your backup scripts. 22 | If you change this key, don't forget to update you backup scripts. 23 | 24 | $PMBP_SYS_VAR['dir_lists'] 25 | Controls the directory levels, listed on the 'backup' and 'schedule backup' pages. 26 | Set to "0" to list no directories, set to "1" to list only directories on level "../", 27 | set to "2" to list directories on level "../" and "../../". (including subdirectories) 28 | Try setting to "0" or "1" if you have problems loading the backup pages. 29 | 30 | $PMBP_SYS_VAR['C_disable_config'] 31 | If set to to "0", the "configuration" tab will be shown as usual 32 | If set to to "1", the "configuration" tab will be not be shown. 33 | To revert the setting, it is necessary to edit the global_conf.php file manually! 34 | 35 | $PMBP_SYS_VAR['C_disable_sqlquery'] 36 | If set to to "0", the "sql queries" tab will be shown as usual 37 | If set to to "1", the "sql queries" tab will be not be shown. 38 | 39 | $PMBP_SYS_VAR['memory_limit'] 40 | Specifies how many characters will be stored in the memory before backups are 41 | written to the disk. This value only takes effect if ini_get("memory_limit") fails. 42 | Try to increase the value to speed up backups. 43 | Try to decrease the value to fix memory limit problems. (E.g. "19000000" for 2 mb) 44 | 45 | $PMBP_SYS_VAR['scheduled_debug'] 46 | Controlls debug output in scheduled backup mode. 47 | If set to "1", scheduled backups produce HTML output for debugging. 48 | If set to "1" and NO debug output is generated, "backup.php" was not found. 49 | Do not forget to set back to "0" after debugging! 50 | 51 | $PMBP_SYS_VAR['schedule_all_dbs'] 52 | Controls which databases are backed up in scheduled backup mode. 53 | If set to "1", all available databases will be backed up. 54 | If set to "0", only the selected databases will be backed upd 55 | You can use this feature if the databases on your server change frequently. 56 | 57 | $PMBP_SYS_VAR['except_tables'] 58 | Enter a list of database table names, which should not be included in backups. 59 | E.g. if set to "test,log" the tables test and log are excluded in all backups 60 | of all databases! It is not possible to exclude tables from a single database. 61 | 62 | $PMBP_SYS_VAR['scheduled_file'] 63 | $PMBP_SYS_VAR['scheduled_dir'] 64 | Contains the values entered on the schedule backup page for the file name and 65 | directory for the scheduled-backup script. 66 | Do not change manually but use the schedule backup page. 67 | 68 | $PMBP_SYS_VAR['last_scheduled'] 69 | Contains the timestamp when the last scheduled backup was executed. 70 | Can be reset to 0 to force a backup the next time a scheduled backup script is called. 71 | 72 | $PMBP_SYS_VAR['last_scheduled_...'] 73 | Contains the timestamp when the last scheduled backup was executed for the accounts 74 | in global_conf_sql.php. The enumeration starts with 0 and the order is the same as 75 | in in global_conf_sql.php and the accounts selection in phpMyBackupPro. 76 | Can be reset to 0 to force a backup the next time a scheduled backup script is called. 77 | 78 | $PMBP_SYS_VAR['ftp_timeout'] 79 | The time in seconds how long it may need to open a connection to a FTP server. 80 | Can be set to a higher value if there are problems when connecting to a FTP server. 81 | 82 | $PMBP_SYS_VAR['dir_email_backup'] 83 | Specifies if directory backups are send by email. 84 | Set to 1 to send directory backups additional by email. If you don't want to send 85 | them also via FTP you can enter an invalid FTP server url on the configuration page. 86 | 87 | $PMBP_SYS_VAR['B_backup_chmod'] 88 | Specifies the value for the chmod which is executed on the backup files. 89 | Set this value to e.g. 0700 to make all backup files readable and writable by the 90 | owner of the file. This usually is the HTTP server. It may be necessary to change the 91 | value e.g. to 0777 when you use the shell-mode to execute a cron job. 92 | 93 | 94 | 95 | $PMBP_SYS_VAR['F_...'] 96 | All system variables beginning with F_ contain selections made on the export or the 97 | schedule backup page. 98 | Normally there is no need to edit them manually. 99 | 100 | $PMBP_SYS_VAR['EXS_...'] 101 | All system variables beginning with EXS_ contain selections made on the schedule backup 102 | page. They concern special settings for scheduled backups. 103 | Normally there is no need to edit them manually. -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 |
" . I_NAME . " " . PMBP_VERSION . "
"; 49 | printf(I_WELCOME, "" . PMBP_WEBSITE . ""); 50 | 51 | // get all system informations 52 | if (!($server = $_SERVER["SERVER_SOFTWARE"])) { 53 | $server = PMBP_I_NO_RES; 54 | } 55 | 56 | if (function_exists("phpversion")) { 57 | $tmp = phpversion(); 58 | $phpvers = $tmp[0] . $tmp[1] . $tmp[2]; 59 | if ($phpvers >= 4.3) { 60 | $php = $tmp; 61 | } else { 62 | $php = PMBP_addOutput($tmp, "red_left"); 63 | } 64 | 65 | } else { 66 | $php = PMBP_I_NO_RES; 67 | } 68 | if (!($memory_limit = ini_get("memory_limit"))) { 69 | $memory_limit = PMBP_I_NO_RES; 70 | } 71 | 72 | if (function_exists("ftp_connect")) { 73 | $ftp = F_YES; 74 | } else { 75 | $ftp = PMBP_addOutput(F_NO, "red_left"); 76 | } 77 | 78 | if (function_exists("mail")) { 79 | $mail = F_YES; 80 | } else { 81 | $mail = PMBP_addOutput(F_NO, "red_left"); 82 | } 83 | 84 | if (function_exists("gzopen")) { 85 | $gzip = F_YES; 86 | } else { 87 | $gzip = F_NO; 88 | } 89 | 90 | if (!function_exists("mysqli_get_server_info")) { 91 | $mysql_s = PMBP_I_NO_RES; 92 | } else { 93 | $con = PMBP_mysql_connect(); 94 | $mysql_s = @mysqli_get_server_info($con); 95 | } 96 | 97 | if (!function_exists("mysqli_get_client_info")) { 98 | $mysql_c = PMBP_I_NO_RES; 99 | } else { 100 | $mysql_c = @mysqli_get_client_info(); 101 | } 102 | 103 | // calculate size of all backups and last backup date 104 | $all_files = PMBP_get_backup_files(); 105 | if (is_array($all_files)) { 106 | $last_backup = 0; 107 | $size_sum = 0; 108 | foreach ($all_files as $filename) { 109 | $file = PMBP_EXPORT_DIR . $filename; 110 | $size_sum += PMBP_file_info("size", $file); 111 | if (($time = PMBP_file_info("time", $file)) > $last_backup) { 112 | $last_backup = $time; 113 | } 114 | 115 | } 116 | $size_sum = PMBP_size_type($size_sum); 117 | $size = $size_sum['value'] . " " . $size_sum['type']; 118 | $time = strftime($CONF['date'], $last_backup); 119 | } else { 120 | $size = "0 kb"; 121 | $time = "?"; 122 | } 123 | $scheduled_time = $PMBP_SYS_VAR['last_scheduled']; 124 | foreach ($PMBP_SYS_VAR as $key => $value) { 125 | if (substr($key, 0, 15) == "last_scheduled_" && $value > $scheduled_time) { 126 | $scheduled_time = $value; 127 | } 128 | 129 | } 130 | if ($scheduled_time) { 131 | $scheduled_time = strftime($CONF['date'], $scheduled_time); 132 | } else { 133 | $scheduled_time = "-"; 134 | } 135 | 136 | // print system informations 137 | echo "

" . PMBP_I_INFO . "
\n"; 138 | echo "\n\n"; 139 | echo ""; 140 | echo "\n"; 141 | echo "\n"; 142 | echo ""; 143 | echo "\n"; 144 | echo "\n"; 145 | echo ""; 146 | echo "\n"; 147 | echo "\n"; 148 | echo ""; 149 | echo "\n"; 150 | echo ""; 151 | echo "\n"; 152 | echo "\n"; 153 | echo "\n"; 154 | echo ""; 155 | echo "\n"; 156 | echo ""; 157 | echo "\n"; 158 | echo "\n"; 159 | echo ""; 160 | echo "\n"; 161 | echo "\n"; 162 | echo ""; 163 | echo "\n"; 164 | echo "\n"; 165 | echo ""; 166 | echo "\n"; 167 | echo "\n"; 168 | echo ""; 169 | echo "\n"; 170 | echo ""; 171 | echo "\n"; 172 | echo "\n"; 173 | echo ""; 174 | echo "\n"; 175 | echo "\n"; 176 | echo "
" . PMBP_I_SERVER . "
" . $server . " " . PMBP_I_TIME . ": " . strftime($CONF['date'], time()) . "
PHP
" . PMBP_I_PHP_VERS . ": " . $php . "   " . PMBP_I_MEM_LIMIT . ": " . $memory_limit . "
" . PMBP_I_GZIP . ": " . $gzip . " " . PMBP_I_MAIL . ": " . $mail . " " . PMBP_I_FTP . ": " . $ftp . "
MySQL
" . PMBP_I_SQL_SERVER . ": " . $mysql_s . " " . PMBP_I_SQL_CLIENT . ": " . $mysql_c . "
" . F_BACKUP . "
" . B_SIZE_SUM . ": " . $size . " " . B_LAST_BACKUP . ": " . $time . " " . PMBP_I_LAST_SCHEDULED . ": " . $scheduled_time . "
" . LI_LOGIN . "
" . PMBP_I_LAST_LOGIN . ": " . $PMBP_SYS_VAR['last_login'] . "
"; 177 | 178 | PMBP_print_footer(); 179 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | " . F_LOGOUT . "
"; 42 | echo LI_MSG . ": " . LI_LOGIN . ""; 43 | exit; 44 | } else if ($_SERVER['PHP_AUTH_PW'] != $CONF['sql_passwd']) { 45 | echo LI_LOGED_OUT . "
\n" . LI_MSG; 46 | echo ": " . LI_LOGIN . ""; 47 | unset($_SESSION['LOGGED_IN']); 48 | unset($_SESSION['sql_host_org']); 49 | unset($_SESSION['sql_user_org']); 50 | unset($_SESSION['sql_passwd_org']); 51 | @session_destroy(); 52 | exit; 53 | } 54 | 55 | // login with html authentification 56 | } else { 57 | 58 | // disable login functions if $CONF['no_login'] is true 59 | if ($CONF['no_login'] != "1") { 60 | if (!isset($_SESSION['LOGGED_IN'])) { 61 | $_SESSION['LOGGED_IN'] = false; 62 | } 63 | 64 | // not logged in 65 | if (!$_SESSION['LOGGED_IN']) { 66 | if (!isset($_POST['password'])) { 67 | $_POST['password'] = false; 68 | } 69 | 70 | if (!isset($_POST['username'])) { 71 | $_POST['username'] = false; 72 | } 73 | 74 | // distinguish between multi and single user mode 75 | if ($_SESSION['multi_user_mode']) { 76 | $con = @mysqli_connect($PMBP_MU_CONF['sql_host_admin'], $PMBP_MU_CONF['sql_user_admin'], $PMBP_MU_CONF['sql_passwd_admin']); 77 | mysqli_select_db($con, "mysql"); 78 | $_POST['username'] = mysqli_real_escape_string($con, $_POST['username']); 79 | $_POST['password'] = mysqli_real_escape_string($con, $_POST['password']); 80 | $res = mysqli_query($con, "select * from user where (User='" . $_POST['username'] . "' or User='') and password=password('" . $_POST['password'] . "')"); 81 | $success = mysqli_fetch_array($res); 82 | @mysqli_close($con); 83 | } else { 84 | if ($CONF['sql_user'] == $_POST['username'] && $CONF['sql_passwd'] == $_POST['password']) { 85 | $success = true; 86 | } else { 87 | $success = false; 88 | } 89 | } 90 | // was the login successful? 91 | if ($success) { 92 | // login successful - set "LOGGED_IN"-bit 93 | $_SESSION['LOGGED_IN'] = true; 94 | $_GET['login'] = true; 95 | 96 | // just make these settings for the first page after login, because definitions.php was already loaded 97 | $_SESSION['sql_user'] = $_POST['username']; 98 | $_SESSION['sql_passwd'] = $_POST['password']; 99 | $_SESSION['sql_host'] = $PMBP_MU_CONF['sql_host_admin']; 100 | $CONF['sql_user'] = $_SESSION['sql_user']; 101 | $CONF['sql_passwd'] = $_SESSION['sql_passwd']; 102 | $CONF['sql_host'] = $_SESSION['sql_host']; 103 | $CONF['sql_db'] = ""; 104 | } else { 105 | // login failed - print login form 106 | ?> 107 | 109 | > 110 | 111 | 112 | 113 | phpMyBackupPro <?php echo PMBP_VERSION; ?> 114 | 115 |
116 |
117 | 118 | 119 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
120 | 123 |
:
:
:
140 |
141 |
142 | 143 | 144 | 173 | -------------------------------------------------------------------------------- /db_info.php: -------------------------------------------------------------------------------- 1 | 68 | 69 | 70 | phpMyBackupPro - " . F_DB_INFO . " 71 | 72 | \n"; 73 | readfile(PMBP_JAVASCRIPTS); 74 | echo " 75 | 76 | \n 77 | \n"; 80 | 81 | echo "\n\n\n"; 82 | echo "\n\n\n\n\n\n"; 83 | for ($i = 0; $i < count($table_names); $i++) { 84 | echo "\n\n"; 85 | echo "\n\n\n\n"; 86 | } 87 | 88 | // show execution duration 89 | if (function_exists("microtime")) { 90 | $microtime = explode(" ", microtime()); 91 | $endtime = ($microtime[0] + $microtime[1]); 92 | } else { 93 | $endtime = time(); 94 | } 95 | echo "\n\n\n"; 96 | echo "
\n"; 78 | echo PMBP_image_tag("logo.png", "phpMyBackupPro PMBP_WEBSITE", PMBP_WEBSITE); 79 | echo " " . PMBP_VERSION . "

" . DB_TAB_TITLE . $_GET['table'] . ":

" . DB_TAB_NAME . "" . DB_TAB_COLS . "" . DB_NUM_ROWS . "" . DB_SIZE . "
" . $table_names[$i] . "" . $table_fields[$i] . "" . $table_rows[$i] . "" . $table_size[$i] . "
\n
" . F_DURATION . ": " . number_format($endtime - $starttime, 3) . " " . F_SECONDS . "
\n
\n\n"; 97 | exit; 98 | } 99 | 100 | PMBP_print_header(preg_replace("#.*/#", "", $_SERVER['SCRIPT_NAME'])); 101 | 102 | // if first use or no db-connection possible 103 | if (!$con) { 104 | echo PMBP_addOutput(I_SQL_ERROR, "red"); 105 | } 106 | //else 107 | { 108 | 109 | echo "\n"; 110 | 111 | // list all databases 112 | $all_dbs = PMBP_get_db_list(); 113 | 114 | if (count($all_dbs)) { 115 | natsort($all_dbs); 116 | 117 | echo "\n\n\n\n\n\n"; 118 | 119 | // print html table 120 | foreach ($all_dbs as $db_name) { 121 | 122 | // select the db 123 | mysqli_select_db($con, $db_name); 124 | 125 | $num_tables = $num_rows = $data_size = 0; 126 | 127 | // get number of rows and size of tables 128 | $stati = mysqli_query($con, "show table status"); 129 | while ($status = @mysqli_fetch_array($stati)) { 130 | $data_size += ($status['Data_length'] + $status['Index_length']); 131 | $num_rows += $status['Rows']; 132 | } 133 | $size = PMBP_size_type($data_size); 134 | 135 | // get number of tables 136 | $num_tables = mysqli_affected_rows($con); 137 | 138 | // first field for the db name 139 | echo ""; 140 | echo "\n\n"; 148 | echo "\n"; 149 | echo "\n"; 150 | echo "\n"; 151 | } 152 | 153 | // show execution duration 154 | if (function_exists("microtime")) { 155 | $microtime = explode(" ", microtime()); 156 | $endtime = ($microtime[0] + $microtime[1]); 157 | } else { 158 | $endtime = time(); 159 | } 160 | echo "\n\n\n"; 161 | } else { 162 | 163 | // if there are no databases 164 | echo "\n\n\n"; 165 | } 166 | 167 | echo "
" . DB_NAME . "" . DB_NUM_TABLES . "" . DB_NUM_ROWS . "" . DB_SIZE . "
\n" . $db_name; 141 | if ($num_tables > 0) { 142 | echo "" . PMBP_pop_up("db_info.php?table=" . $db_name, " [" . DB_TABLES . "]", "view") . ""; 143 | } elseif ($num_tables < 0) { 144 | $num_tables = PMBP_addOutput(C_WRONG_DB, "red"); 145 | } 146 | 147 | echo "\n" . $num_tables . "" . $num_rows . "" . $size['value'] . " " . $size['type'] . "
\n
" . F_DURATION . ": " . number_format($endtime - $starttime, 3) . " " . F_SECONDS . "
\n" . DB_DIFF . "\n
" . DB_NO_DB . ".
\n
\n"; 168 | } 169 | PMBP_print_footer(); 170 | -------------------------------------------------------------------------------- /sys_vars.inc.php: -------------------------------------------------------------------------------- 1 | 37 | 38 | 39 | 40 | 41 | phpMyBackupPro - " . INF_INFO . " 42 | 43 | 44 | \n 45 | \n"; 48 | 49 | @set_time_limit($CONF['timelimit']); 50 | 51 | // set parameters 52 | $linespersession = 10000; 53 | 54 | // set some basic values on start up 55 | $error = false; 56 | if (!isset($_GET['sn'])) { 57 | $_GET['sn'] = 0; 58 | } else { 59 | $_GET['sn']++; 60 | } 61 | 62 | if (!isset($_GET['totalqueries'])) { 63 | $_GET['totalqueries'] = 0; 64 | } 65 | 66 | if (!isset($_GET['dbn'])) { 67 | $_GET['dbn'] = " "; 68 | } 69 | 70 | if (!isset($_GET['delete'])) { 71 | $_GET['delete'] = false; 72 | } 73 | 74 | if (!isset($_GET['start']) || !isset($_GET['foffset'])) { 75 | $_GET['start'] = $_GET['foffset'] = 0; 76 | $firstSession = true; 77 | $linenumber = 0; 78 | $foffset = 0; 79 | $totalqueries = 0; 80 | } 81 | 82 | // connect to the database 83 | if (!isset($firstSession)) { 84 | $con = PMBP_mysql_connect(); 85 | if (!$con) { 86 | $error = C_WRONG_SQL; 87 | } 88 | 89 | if (!$error) { 90 | $db = @mysqli_select_db($_GET['dbn']); 91 | } 92 | 93 | if (!$db) { 94 | $error = C_WRONG_DB . " (" . $_GET['dbn'] . ")"; 95 | } 96 | 97 | } 98 | 99 | // open the file 100 | if (!$error && !isset($firstSession)) { 101 | // gzopen can be used for plain text too! 102 | 103 | // extract zip file 104 | if (PMBP_file_info("comp", $_GET["fn"]) == "zip") { 105 | include_once "pclzip.lib.php"; 106 | $pclzip = new PclZip($_GET["fn"]); 107 | $extracted_file = $pclzip->extractByIndex(0, PMBP_EXPORT_DIR, ""); 108 | if ($pclzip->error_code != 0) { 109 | $error = "plczip: " . $pclzip->error_string . "
" . BI_BROKEN_ZIP . "!"; 110 | } 111 | 112 | $_GET["fn"] = substr($_GET["fn"], 0, strlen($_GET["fn"]) - 4); 113 | unset($pclzip); 114 | } 115 | 116 | if (!$error && !$file = @gzopen($_GET["fn"], "r")) { 117 | $error = C_OPEN . " " . $_GET["fn"]; 118 | } 119 | 120 | } 121 | 122 | if (!$error) { 123 | // get start time to calculate duration 124 | if (function_exists("microtime")) { 125 | $microtime = explode(" ", microtime()); 126 | $starttime = ($microtime[0] + $microtime[1]); 127 | } else { 128 | $starttime = time(); 129 | } 130 | 131 | if (file_exists($_GET["fn"] . ".zip")) { 132 | echo "\n"; 133 | } else { 134 | echo "\n"; 135 | } 136 | 137 | echo "\n"; 138 | echo "\n"; 139 | echo "\n"; 140 | 141 | // start or continue the import process 142 | if (!isset($firstSession)) { 143 | if (gzseek($file, $_GET["foffset"]) != 0) { 144 | $error = "UNEXPECTED ERROR: Can't set gzip file pointer to offset: " . $_GET["foffset"]; 145 | } 146 | 147 | // execute sql queries 148 | if (!$error) { 149 | extract(PMBP_exec_sql($file, $con, $linespersession), EXTR_OVERWRITE); 150 | } 151 | 152 | // get the current file position 153 | if (!$error) { 154 | $foffset = gztell($file); 155 | if ($foffset === false) { 156 | $error = "UNEXPECTED ERROR: Can't read the file pointer offset"; 157 | } 158 | 159 | } 160 | } 161 | 162 | // clean up 163 | if (!isset($firstSession)) { 164 | if ($con) { 165 | @mysqli_close(); 166 | } 167 | 168 | @gzclose($file); 169 | } 170 | 171 | if (!$error || isset($firstSession)) { 172 | // calculate execution duration of this session 173 | if (function_exists("microtime")) { 174 | $microtime = explode(" ", microtime()); 175 | $endtime = ($microtime[0] + $microtime[1]); 176 | } else { 177 | $endtime = time(); 178 | } 179 | 180 | if (!isset($firstSession)) { 181 | // print information table 182 | echo "\n"; 183 | echo "\n"; 184 | echo "\n"; 185 | echo "\n"; 186 | } 187 | 188 | if ($linenumber < $_GET["start"] + $linespersession && !isset($firstSession)) { 189 | // delete extracted zip file 190 | if (file_exists($_GET["fn"] . ".zip")) { 191 | @unlink($_GET["fn"]); 192 | } 193 | 194 | // all sql queries executed 195 | echo "\n"; 196 | echo "\n"; 201 | } else { 202 | echo "
(" . BI_RESTART . "" . basename($_GET['fn']) . ")\n"; 203 | } 204 | 205 | } 206 | echo "
\n"; 46 | echo PMBP_image_tag("logo.png", "phpMyBackupPro PMBP_WEBSITE", PMBP_WEBSITE); 47 | echo "\n
" . BI_IMPORTING_FILE . ":
" . basename($_GET["fn"]) . ".zip
" . BI_IMPORTING_FILE . ":
" . basename($_GET["fn"]) . "
" . BI_INTO_DB . ":
" . $_GET["dbn"] . "
" . BI_SESSION_NO . ":
" . $_GET["sn"] . "
" . BI_STARTING_LINE . ":
" . $_GET["start"] . "
" . BI_STOPPING_LINE . ":
" . ($linenumber - 1) . "
" . BI_QUERY_NO . "
(" . BI_THIS_LAST . "):
" . $queries . "/" . $totalqueries . "
" . BI_BYTE_NO . ":
" . round($foffset / 1024) . " KB
" . BI_DURATION . ":
" . number_format($endtime - $starttime, 3) . " " . F_SECONDS . "
 
" . PMBP_addOutput(BI_END, "green_left"); 197 | // delete the temporary created file 198 | if (!$_GET['delete']) { 199 | if (file_exists($_GET["fn"] . ".zip")) { 200 | echo "
(" . BI_RESTART . "" . basename($_GET['fn']) . ".zip)
\n"; 207 | } else { 208 | // restart script to execute next queries 209 | echo " \n"; 210 | echo "" . PMBP_addOutput(BI_SCRIPT_RUNNING, "red_left") . "\n"; 211 | echo "\n"; 212 | echo "\n"; 214 | echo "\n"; 218 | } 219 | } 220 | } 221 | 222 | if ($error) { 223 | echo "" . PMBP_addOutput($error, "red_left") . ""; 224 | } 225 | 226 | echo "\n"; 227 | -------------------------------------------------------------------------------- /language/czech_help.php: -------------------------------------------------------------------------------- 1 | 31 | 32 | 33 | 34 | 35 | phpMyBackupPro - ".F_HELP." 36 | 37 | 38 | \n 39 | \n"; 42 | 43 | // choose help text 44 | switch(preg_replace("'^.*/'","",$_GET['script'])) { 45 | case 'index.php': $filename=F_START; 46 | $html="On this page you can see system informations about the server where phpMyBackupPro is running on.

47 | ".PMBP_I_SERVER.": Here you can see on what kind of server phpMyBackupPro is running on and the current server time.
48 | "."PHP".": Here you can see the version of PHP and informations about different important PHP modules und functions. 49 | You can see the PHP memory limit value, wether gzip compression is possible, 50 | and wether you are able to send emails and transfer files via FTP on this server.
51 | "."MySQL".": Here you can see your MySQL servers version and your MySQL clients version.
52 | ".F_BACKUP.": Here you cann see how much diskspace is allocated by stored backups, 53 | when the last backup was build and when the last backup was build by a schedule script.
54 | ".LI_LOGIN.": Here you can see when you logged in to phpMyBackupPro the last time and from with which IP."; 55 | break; 56 | case 'config.php': $filename=F_CONFIG; 57 | $html="There are two levels of configuration: basic and extended configuration options. Editing the extended configuration variables is optional. 58 | The * indicates that this item may not be blank.

59 | Basic configuration:
60 | ".C_SITENAME.": Give this system a name like e.g. 'production server'.
61 | ".C_LANG.": Change the language of phpMyBackupPro. Your can download several language packages on the phpMyBackupPro project site.
62 | ".C_SQL_HOST.": Enter your MySQL host e.g. 'localhost' or with portnumber 'localhost:3306'.
63 | ".C_SQL_USER.": Enter your MySQL username.
64 | ".C_SQL_PASSWD.": Enter your MySQL password.
65 | ".C_SQL_DB.": If you want to only use one database on the server, you can enter the name of that database here.
66 | ".C_FTP_USE.": Check this if you want to use FTP functions to upload your backups automatically to an FTP server.
67 | ".C_FTP_BACKUP.": Check this if you want to enable the backup of directories to a FTP server.
68 | ".C_FTP_REC.": Check this if you want to backup directories including their sub directories.
69 | ".C_FTP_SERVER.": Enter the IP or URL of you FTP server.
70 | ".C_FTP_USER.": Enter your FTP loginname.
71 | ".C_FTP_PASSWD.": Enter your FTP password.
72 | ".C_FTP_PATH.": Enter a path to a directory on the FTP server where you want your backups stored.
73 | ".C_FTP_PASV.": Check this to use passive FTP.
74 | ".C_FTP_PORT.": Enter the port on which your FTP server is available. Default port is 21.
75 | ".C_FTP_DEL.": Check this to have the backup files on the FTP server automatically deleted when they are deleted locally.
76 | ".C_EMAIL_USE.": Check this to send your backups automatically via Email.
77 | ".C_EMAIL.": Enter the email address to which you want to send the backups.

78 | Extended configuration:
79 | ".C_STYLESHEET.": Choose a stylesheet for phpMyBackupPro. You can download and upload stylesheets on the phpMyBackupPro project site.
80 | ".C_DATE.": Choose your favorite date format.
81 | ".C_LOGIN.": You can switch to HTTP authentication if you want to.
82 | ".C_DEL_TIME.": Specify a number of days after which the backup files are automatically deleted. Use 0 to disable this function.
83 | ".C_DEL_NUMBER.": Spezify a max number of backup files to be stored for each database.
84 | ".C_TIMELIMIT.": Increase the PHP time limit if there are problems with doing backups or imports.
85 | ".C_CONFIRM.": Choose which actions on the import site need to be confirmed.
86 | ".C_IMPORT_ERROR.": Check this to receive a list of import errors if any occur.
87 | ".C_DIR_BACKUP.": Check this to enable directory backups. Valid FTP data must be entered to use this feature.
88 | ".C_DIR_REC.": Check this to backup directories recursively (with all subfolders).
89 | ".C_NO_LOGIN.": Check this to disable the login function. This is not recommended as everyone would get access to your database!

90 | System variables:
91 | Here you can change the values of the internal phpMyBackupPro system variables. Only change anything if you know what you are doing. 92 | You can find further help in the 'SYSTEM_VARIABLES.txt' documentation file."; 93 | break; 94 | case 'import.php': $filename=F_IMPORT; 95 | $html="Here you can see all currently stored local backup files.
96 | You can get more information by clicking '".B_INFO."'.
97 | By clicking '".B_VIEW."', you can read the backup file.
98 | To download the backup file just click '".B_DOWNLOAD."'.
99 | Click '".B_IMPORT."' to re-import the file in the database. Before you do this you can empty the database by clicking '".B_EMPTY_DB."'.
100 | You can import big backups using the '".B_IMPORT_FRAG."' import. This will import the backup bit by bit.
101 | To delete a backup file click '".B_DELETE."'. You can delete all backups of one database by clicking '".B_DELETE_ALL."'.

102 | Click '".B_EMPTY_ALL."' to empty all available databases, click '".B_IMPORT_ALL."' to import the latest backup of each database, 103 | click '".B_DELETE_ALL_2."' to delete all available backup files."; 104 | break; 105 | case 'backup.php': $filename=F_BACKUP; 106 | $html="Here you can select which databases you want to backup.
107 | A comment will be saved to each backup file.
108 | You can choose if just the table structure, the data or both will be stored.
109 | Add a 'drop table if exists ...' row to each table structure by clicking 'add drop table'
110 | You can also choose the compression type for the backup files. On some systems, not all formats are available.

111 | If you have activated the FTP backup function, you also can backup complete directories to your FTP server.
112 | The selected directories and their files will be copied to the '".C_FTP_PATH."' configured on the '".F_CONFIG."' page.
113 | It is not possible email the files but you can select '".EX_PACKED."' to pack all files and directories into one ZIP file. 114 | This will take more time than a normal transfer. The directory list is only generated once at the login. If you want to 115 | update the list, click on '".PMBP_EXS_UPDATE_DIRS."'."; 116 | break; 117 | case 'scheduled.php': $filename=F_SCHEDULE; 118 | $html="To automate the backup, you can generate some code to include in any existing PHP script.
119 | When this script is loaded, the backup automatically starts. You can schedule when the backup will run.

120 | Next, choose where the script will be located. The directory phpMyBackupPro must not be moved after this change! 121 | (If you have knowledge of coding PHP you can change the path later.)

122 | A click on '".EXS_SHOW."' will show you a script that can be used for doing the scheduled backup. Copy the code and include it into an existing file, 123 | or use '".C_SAVE."' to save the script automatically with a given filename. This will overwrite an existing file with the same name!
124 | Note: The file must be in the directory selected on the previous page in order to work correctly.
125 | The backup will only run, when the script is opened or executed. You can include it into an existing PHP file or use a frame set with an invisible frame.

126 | All configuration options will work in this script!
You can find more information about the backup options in the 'backup' help.

127 | If you want to see a larger list of available directories go to the configuration page and change the system variable 'dir_lists' to 2!"; 128 | break; 129 | case 'db_info.php': $filename=F_DB_INFO; 130 | $html="Here you can see a small summary of your databases.

131 | In the column 'number of rows' you can find the sum of the number of rows from all tables.
132 | If a database contains tables, you can click 'tables info' to get the names, number of cols, number of rows and size of all tables of the respective database.
133 | The sizes may differ from the sizes of backup files because of additional data needed in the backup files."; 134 | break; 135 | case 'sql_query.php': $filename=F_SQL_QUERY; 136 | $html="This page is to send simple sql queries to the database.

137 | You can select a database on which you want to run the queries.
138 | You can insert one or more sql queries in the textbox.
139 | Queries like 'select ...' will return a result table.
140 | Some queries like 'delete ...' will only tell you '".SQ_SUCCESS."'

141 | If you upload a file to be executed you will receive an error message for each error that has happened! (and this could be a lot!)
142 | The last error message contains a list of all queries, which generated errors. An 'F' before a number of the query means this query was in the file.

143 | These functions are not mature yet! There is no guarantee that all correct queries can be processed successfully!"; 144 | break; 145 | default: $html="Sorry, no help available for this site."; 146 | } 147 | 148 | echo "\n\n\n
"; 40 | echo PMBP_image_tag("../".PMBP_IMAGE_DIR."logo.png","phpMyBackupPro ".PMBP_WEBSITE,PMBP_WEBSITE); 41 | echo "
\n"; 149 | if ($filename) echo "
Help for ".$filename.":

\n"; 150 | echo $html; 151 | echo "
\n\n"; 152 | ?> 153 | -------------------------------------------------------------------------------- /language/english_help.php: -------------------------------------------------------------------------------- 1 | 31 | 32 | 33 | 34 | 35 | phpMyBackupPro - ".F_HELP." 36 | 37 | 38 | \n 39 | \n"; 42 | 43 | // choose help text 44 | switch(preg_replace("'^.*/'","",$_GET['script'])) { 45 | case 'index.php': $filename=F_START; 46 | $html="On this page you can see system informations about the server where phpMyBackupPro is running on.

47 | ".PMBP_I_SERVER.": Here you can see on what kind of server phpMyBackupPro is running on and the current server time.
48 | "."PHP".": Here you can see the version of PHP and informations about different important PHP modules und functions. 49 | You can see the PHP memory limit value, wether gzip compression is possible, 50 | and wether you are able to send emails and transfer files via FTP on this server.
51 | "."MySQL".": Here you can see your MySQL servers version and your MySQL clients version.
52 | ".F_BACKUP.": Here you cann see how much diskspace is allocated by stored backups, 53 | when the last backup was build and when the last backup was build by a schedule script.
54 | ".LI_LOGIN.": Here you can see when you logged in to phpMyBackupPro the last time and from with which IP."; 55 | break; 56 | case 'config.php': $filename=F_CONFIG; 57 | $html="There are two levels of configuration: basic and extended configuration options. Editing the extended configuration variables is optional. 58 | The * indicates that this item may not be blank.

59 | Basic configuration:
60 | ".C_SITENAME.": Give this system a name like e.g. 'production server'.
61 | ".C_LANG.": Change the language of phpMyBackupPro. Your can download several language packages on the phpMyBackupPro project site.
62 | ".C_SQL_HOST.": Enter your MySQL host e.g. 'localhost' or with portnumber 'localhost:3306'.
63 | ".C_SQL_USER.": Enter your MySQL username.
64 | ".C_SQL_PASSWD.": Enter your MySQL password.
65 | ".C_SQL_DB.": If you want to only use one database on the server, you can enter the name of that database here.
66 | ".C_FTP_USE.": Check this if you want to use FTP functions to upload your backups automatically to an FTP server.
67 | ".C_FTP_BACKUP.": Check this if you want to enable the backup of directories to a FTP server.
68 | ".C_FTP_REC.": Check this if you want to backup directories including their sub directories.
69 | ".C_FTP_SERVER.": Enter the IP or URL of you FTP server.
70 | ".C_FTP_USER.": Enter your FTP loginname.
71 | ".C_FTP_PASSWD.": Enter your FTP password.
72 | ".C_FTP_PATH.": Enter a path to a directory on the FTP server where you want your backups stored.
73 | ".C_FTP_PASV.": Check this to use passive FTP.
74 | ".C_FTP_PORT.": Enter the port on which your FTP server is available. Default port is 21.
75 | ".C_FTP_DEL.": Check this to have the backup files on the FTP server automatically deleted when they are deleted locally.
76 | ".C_EMAIL_USE.": Check this to send your backups automatically via Email.
77 | ".C_EMAIL.": Enter the email address to which you want to send the backups.

78 | Extended configuration:
79 | ".C_STYLESHEET.": Choose a stylesheet for phpMyBackupPro. You can download and upload stylesheets on the phpMyBackupPro project site.
80 | ".C_DATE.": Choose your favorite date format.
81 | ".C_LOGIN.": You can switch to HTTP authentication if you want to.
82 | ".C_DEL_TIME.": Specify a number of days after which the backup files are automatically deleted. Use 0 to disable this function.
83 | ".C_DEL_NUMBER.": Spezify a max number of backup files to be stored for each database.
84 | ".C_TIMELIMIT.": Increase the PHP time limit if there are problems with doing backups or imports.
85 | ".C_CONFIRM.": Choose which actions on the import site need to be confirmed.
86 | ".C_IMPORT_ERROR.": Check this to receive a list of import errors if any occur.
87 | ".C_DIR_BACKUP.": Check this to enable directory backups. Valid FTP data must be entered to use this feature.
88 | ".C_DIR_REC.": Check this to backup directories recursively (with all subfolders).
89 | ".C_NO_LOGIN.": Check this to disable the login function. This is not recommended as everyone would get access to your database!

90 | System variables:
91 | Here you can change the values of the internal phpMyBackupPro system variables. Only change anything if you know what you are doing. 92 | You can find further help in the 'SYSTEM_VARIABLES.txt' documentation file."; 93 | break; 94 | case 'import.php': $filename=F_IMPORT; 95 | $html="Here you can see all currently stored local backup files.
96 | You can get more information by clicking '".B_INFO."'.
97 | By clicking '".B_VIEW."', you can read the backup file.
98 | To download the backup file just click '".B_DOWNLOAD."'.
99 | Click '".B_IMPORT."' to re-import the file in the database. Before you do this you can empty the database by clicking '".B_EMPTY_DB."'.
100 | You can import big backups using the '".B_IMPORT_FRAG."' import. This will import the backup bit by bit.
101 | To delete a backup file click '".B_DELETE."'. You can delete all backups of one database by clicking '".B_DELETE_ALL."'.

102 | Click '".B_EMPTY_ALL."' to empty all available databases, click '".B_IMPORT_ALL."' to import the latest backup of each database, 103 | click '".B_DELETE_ALL_2."' to delete all available backup files."; 104 | break; 105 | case 'backup.php': $filename=F_BACKUP; 106 | $html="Here you can select which databases you want to backup.
107 | A comment will be saved to each backup file.
108 | You can choose if just the table structure, the data or both will be stored.
109 | Add a 'drop table if exists ...' row to each table structure by clicking 'add drop table'
110 | You can also choose the compression type for the backup files. On some systems, not all formats are available.

111 | If you have activated the FTP backup function, you also can backup complete directories to your FTP server.
112 | The selected directories and their files will be copied to the '".C_FTP_PATH."' configured on the '".F_CONFIG."' page.
113 | It is not possible email the files but you can select '".EX_PACKED."' to pack all files and directories into one ZIP file. 114 | This will take more time than a normal transfer. The directory list is only generated once at the login. If you want to 115 | update the list, click on '".PMBP_EXS_UPDATE_DIRS."'."; 116 | break; 117 | case 'scheduled.php': $filename=F_SCHEDULE; 118 | $html="To automate the backup, you can generate some code to include in any existing PHP script.
119 | When this script is loaded, the backup automatically starts. You can schedule when the backup will run.

120 | Next, choose where the script will be located. The directory phpMyBackupPro must not be moved after this change! 121 | (If you have knowledge of coding PHP you can change the path later.)

122 | A click on '".EXS_SHOW."' will show you a script that can be used for doing the scheduled backup. Copy the code and include it into an existing file, 123 | or use '".C_SAVE."' to save the script automatically with a given filename. This will overwrite an existing file with the same name!
124 | Note: The file must be in the directory selected on the previous page in order to work correctly.
125 | The backup will only run, when the script is opened or executed. You can include it into an existing PHP file or use a frame set with an invisible frame.

126 | All configuration options will work in this script!
You can find more information about the backup options in the 'backup' help.

127 | If you want to see a larger list of available directories go to the configuration page and change the system variable 'dir_lists' to 2!"; 128 | break; 129 | case 'db_info.php': $filename=F_DB_INFO; 130 | $html="Here you can see a small summary of your databases.

131 | In the column 'number of rows' you can find the sum of the number of rows from all tables.
132 | If a database contains tables, you can click 'tables info' to get the names, number of cols, number of rows and size of all tables of the respective database.
133 | The sizes may differ from the sizes of backup files because of additional data needed in the backup files."; 134 | break; 135 | case 'sql_query.php': $filename=F_SQL_QUERY; 136 | $html="This page is to send simple sql queries to the database.

137 | You can select a database on which you want to run the queries.
138 | You can insert one or more sql queries in the textbox.
139 | Queries like 'select ...' will return a result table.
140 | Some queries like 'delete ...' will only tell you '".SQ_SUCCESS."'

141 | If you upload a file to be executed you will receive an error message for each error that has happened! (and this could be a lot!)
142 | The last error message contains a list of all queries, which generated errors. An 'F' before a number of the query means this query was in the file.

143 | These functions are not mature yet! There is no guarantee that all correct queries can be processed successfully!"; 144 | break; 145 | default: $html="Sorry, no help available for this site."; 146 | } 147 | 148 | echo "\n\n\n
"; 40 | echo PMBP_image_tag("../".PMBP_IMAGE_DIR."logo.png","phpMyBackupPro ".PMBP_WEBSITE,PMBP_WEBSITE); 41 | echo "
\n"; 149 | if ($filename) echo "
Help for ".$filename.":

\n"; 150 | echo $html; 151 | echo "
\n\n"; 152 | ?> 153 | -------------------------------------------------------------------------------- /definitions.php: -------------------------------------------------------------------------------- 1 | 54 | You can configure the MySQL module in php.ini. Read the HTTP servers (eg. Apache) log files for more infomation."; 55 | exit; 56 | } 57 | 58 | // must be set always 59 | $CONF['sql_host_s'] = array(); 60 | $CONF['sql_user_s'] = array(); 61 | $CONF['sql_passwd_s'] = array(); 62 | $CONF['sql_db_s'] = array(); 63 | 64 | // change path when in shell mode 65 | if (isset($argv) && basename($GLOBALS['_SERVER']['SCRIPT_FILENAME']) == "backup.php") { 66 | $prepath = dirname($GLOBALS['_SERVER']['SCRIPT_FILENAME']) . "/"; 67 | //return; 68 | } else { 69 | $prepath = ""; 70 | } 71 | 72 | // include functions.inc 73 | require_once $prepath . PMBP_MAIN_INC; 74 | 75 | // set up multi user mode 76 | if (@include_once ($prepath . PMBP_GLOBAL_CONF_MU)) { 77 | if ($PMBP_MU_CONF['sql_user_admin'] && $PMBP_MU_CONF['sql_passwd_admin']) { 78 | // test MySQL admin data 79 | if (!$con = @mysqli_connect($CONF['sql_host'], $PMBP_MU_CONF['sql_user_admin'], $PMBP_MU_CONF['sql_passwd_admin'])) { 80 | echo "MySQL admin data are incorrect in global_conf_mu.php. Please correct them in order to use the multi user mode."; 81 | exit; 82 | } 83 | // if connection issn't closed the user could get access to all data 84 | if (!mysqli_close($con)) { 85 | echo "phpMyBackupPro stoped loading due to security reasons: The MySQL connection could not be shut down! (" . __FILE__ . ", Line " . __LINE__ . ")"; 86 | exit; 87 | } 88 | 89 | // discover if we are in mu mode 90 | if (isset($_SESSION['sql_user']) && isset($_SESSION['sql_passwd'])) { 91 | // admin has logged on 92 | if ($_SESSION['sql_user'] == $PMBP_MU_CONF['sql_user_admin'] && $_SESSION['sql_passwd'] == $PMBP_MU_CONF['sql_passwd_admin']) { 93 | $_SESSION['multi_user_mode'] = false; 94 | } else { 95 | $_SESSION['multi_user_mode'] = true; 96 | } 97 | 98 | if (isset($_SESSION['LOGGED_IN'])) { 99 | $override_user_date = true; 100 | } 101 | 102 | } else { 103 | $_SESSION['multi_user_mode'] = true; 104 | } 105 | } else { 106 | $_SESSION['multi_user_mode'] = false; 107 | } 108 | } 109 | 110 | // include global-conf file 111 | if ($_SESSION['multi_user_mode'] && isset($_SESSION['sql_user'])) { 112 | define('PMBP_GLOBAL_CONF', $PMBP_MU_CONF['user_conf_file']); 113 | } else { 114 | define('PMBP_GLOBAL_CONF', $_PMBP_GLOBAL_CONF); 115 | } 116 | 117 | // try to include global conf file 118 | if (!include_once ($prepath . PMBP_GLOBAL_CONF)) { 119 | // show warning in scheduled mode only if scheduled_debug is on 120 | if ((!isset($security_key) || $PMBP_SYS_VAR['scheduled_debug'])) { 121 | // try to create global_conf.php 122 | if (!@touch($prepath . PMBP_GLOBAL_CONF)) { 123 | echo PMBP_GLOBAL_CONF . " is missing.
Please read INSTALL.txt and specify the global_conf.php path in definitions.php."; 124 | exit; 125 | } 126 | } 127 | } 128 | 129 | // now override sql data and restricted settings in $CONF 130 | if (isset($override_user_date)) { 131 | $CONF['sql_user'] = $_SESSION['sql_user']; 132 | $CONF['sql_passwd'] = $_SESSION['sql_passwd']; 133 | $CONF['sql_host'] = $PMBP_MU_CONF['sql_host_admin']; 134 | $CONF['sql_db'] = ""; 135 | 136 | // disable the following functions if they were disabled in global_mu_conf.php 137 | if ($PMBP_MU_CONF['sitename']) { 138 | $CONF['sitename'] = $PMBP_MU_CONF['sitename']; 139 | } 140 | 141 | if (!$PMBP_MU_CONF['allow_ftp']) { 142 | $CONF['ftp_use'] = "0"; 143 | } 144 | 145 | if (!$PMBP_MU_CONF['allow_dir_backup']) { 146 | $CONF['allow_dir_backup'] = "0"; 147 | } 148 | 149 | if (!$PMBP_MU_CONF['allow_email']) { 150 | $CONF['email_use'] = "0"; 151 | } 152 | 153 | } 154 | 155 | // reset missing system variables and configurations but not before login 156 | if ($_SESSION['multi_user_mode'] && $_PMBP_GLOBAL_CONF != PMBP_GLOBAL_CONF || !$_SESSION['multi_user_mode']) { 157 | include $prepath . "sys_vars.inc.php"; 158 | } 159 | 160 | // multi server mode only if not in multi user mode 161 | if (!$_SESSION['multi_user_mode']) { 162 | @include_once $prepath . PMBP_GLOBAL_CONF_SQL; 163 | } 164 | 165 | // LOGGED_IN initialisieren 166 | if (!isset($_SESSION['LOGGED_IN'])) { 167 | $_SESSION['LOGGED_IN'] = false; 168 | } 169 | 170 | // set working sql server 171 | if (count($CONF['sql_host_s'])) { 172 | // set working server and register session vars 173 | if (!isset($_SESSION['sql_host_org']) || !$_SESSION['LOGGED_IN']) { 174 | $_SESSION['sql_host_org'] = $CONF['sql_host']; 175 | } 176 | 177 | if (!isset($_SESSION['sql_user_org']) || !$_SESSION['LOGGED_IN']) { 178 | $_SESSION['sql_user_org'] = $CONF['sql_user']; 179 | } 180 | 181 | if (!isset($_SESSION['sql_passwd_org']) || !$_SESSION['LOGGED_IN']) { 182 | $_SESSION['sql_passwd_org'] = $CONF['sql_passwd']; 183 | } 184 | 185 | if (!isset($_SESSION['sql_db_org']) || !$_SESSION['LOGGED_IN']) { 186 | $_SESSION['sql_db_org'] = $CONF['sql_db']; 187 | } 188 | 189 | if (!isset($_SESSION['wss']) || !$_SESSION['LOGGED_IN']) { 190 | $_SESSION['wss'] = -1; 191 | } 192 | 193 | if (isset($_POST['mysql_host'])) { 194 | $_SESSION['wss'] = $_POST['mysql_host']; 195 | } 196 | 197 | // load setting from $_SESSION['wss'] as long we are not on the config page and if the host data are still in global_conf_sql.php 198 | // otherwise set to original host 199 | if ($_SESSION['wss'] < 0 || basename($_SERVER['SCRIPT_NAME']) == "config.php" || !isset($CONF['sql_host_s'][$_SESSION['wss']])) { 200 | $CONF['sql_host'] = $_SESSION['sql_host_org']; 201 | $CONF['sql_user'] = $_SESSION['sql_user_org']; 202 | $CONF['sql_passwd'] = $_SESSION['sql_passwd_org']; 203 | $CONF['sql_db'] = $_SESSION['sql_db_org']; 204 | } else { 205 | $CONF['sql_host'] = $CONF['sql_host_s'][$_SESSION['wss']]; 206 | $CONF['sql_user'] = $CONF['sql_user_s'][$_SESSION['wss']]; 207 | $CONF['sql_passwd'] = $CONF['sql_passwd_s'][$_SESSION['wss']]; 208 | $CONF['sql_db'] = $CONF['sql_db_s'][$_SESSION['wss']]; 209 | } 210 | } 211 | 212 | // set export directory and global-conf file based on multi user mode 213 | if (!$_SESSION['multi_user_mode']) { 214 | // choose the right export directory in multi db mode 215 | if (count($CONF['sql_host_s']) && basename($_SERVER['SCRIPT_NAME']) !== "config.php") { 216 | // multi db mode 217 | if ($_SESSION['wss'] < 0) { 218 | // main account from global_conf.php 219 | define('PMBP_EXPORT_DIR', $prepath . $_PMBP_EXPORT_DIR); 220 | } else { 221 | // other accounts 222 | define('PMBP_EXPORT_DIR', $prepath . $_PMBP_EXPORT_DIR . $CONF['sql_host'] . "_" . $CONF['sql_user'] . "/"); 223 | } 224 | } else { 225 | // single db mode 226 | define('PMBP_EXPORT_DIR', $prepath . $_PMBP_EXPORT_DIR); 227 | } 228 | } else { 229 | // multi user mode 230 | define('PMBP_EXPORT_DIR', $prepath . $PMBP_MU_CONF['user_export_dir']); 231 | } 232 | 233 | // try to create export directories 234 | @umask(0000); 235 | @mkdir(PMBP_EXPORT_DIR, 0777); 236 | 237 | // check if language was just changed in config.php 238 | if (isset($_POST['lang']) && preg_replace("#.*/#", "", $_SERVER['PHP_SELF']) == "config.php") { 239 | if (preg_match("#^[a-zA-Z ]*$#", $_POST['lang'])) { 240 | $CONF['lang'] = $_POST['lang']; 241 | } 242 | } 243 | 244 | // include language.inc.php 245 | if (!isset($CONF['lang'])) { 246 | $CONF['lang'] = "english"; 247 | } 248 | 249 | if (!file_exists($prepath . PMBP_LANGUAGE_DIR . $CONF['lang'] . ".inc.php")) { 250 | include_once $prepath . PMBP_LANGUAGE_DIR . "english.inc.php"; 251 | } else { 252 | include $prepath . PMBP_LANGUAGE_DIR . $CONF['lang'] . ".inc.php"; 253 | } 254 | 255 | // set local time to defined or environment variable value 256 | if (function_exists("phpversion")) { 257 | $tmp = @phpversion(); 258 | $phpvers = $tmp[0] . $tmp[1] . $tmp[2]; 259 | } else { 260 | $phpvers = "0"; 261 | } 262 | 263 | if (defined("BD_LANG_SHORTCUT") and $phpvers >= 4.3) { 264 | setlocale(LC_TIME, BD_LANG_SHORTCUT, BD_LANG_SHORTCUT . "_" . strtoupper('BD_LANG_SHORTCUT')); 265 | } else { 266 | setlocale(LC_TIME, ""); 267 | } 268 | 269 | // special part for arabic language 270 | if ($CONF['lang'] == "arabic") { 271 | define('ARABIC_HTML', " dir=\"rtl\""); 272 | } else { 273 | define('ARABIC_HTML', ""); 274 | } 275 | 276 | // update the system variables but not before login 277 | if ($_SESSION['multi_user_mode'] && $_PMBP_GLOBAL_CONF != PMBP_GLOBAL_CONF || !$_SESSION['multi_user_mode']) { 278 | include "sys_vars.inc.php"; 279 | } 280 | -------------------------------------------------------------------------------- /doc/HISTORY.txt: -------------------------------------------------------------------------------- 1 | version history: 2 | ================ 3 | 4 | ??/04/2003 5 | v.0.2: intern release: bugs fixed 6 | new features: definitions page, better error messages, online help 7 | 8 | 06/07/2004 9 | v.0.3: first public release: bugs fixed, a real html frontend 10 | new features: email and ftp backup, schedule backup, 11 | multi language functionality 12 | 13 | 06/08/2004 14 | v.0.4: bugs considering variable names and schedule backup fixed, 15 | some small changes 16 | 17 | 06/09/2004 18 | v.0.4.1:bug considering using language files, ftp bug fixed code clean up, 19 | added many comments and some defines 20 | 21 | 06/16/2004 22 | v.0.5: new features: delete ALL backup files and empty ALL dbs links, 23 | database info, 'drop db' function, posibility to select several dbs, 24 | password-fields on configuration site 25 | 26 | 06/18/2004 27 | v.0.5.1:fixed bug considering import and backup of some kinds of backup files 28 | and gzip files 29 | removed .htaccess file - not longer part of this project 30 | 31 | 06/29/2004 32 | v.0.6.0:new features: login and logout functions, warning on 'start' page if 33 | wrong mySQL data, possibility to input and send sql querys to db 34 | 35 | 06/30/2004 36 | v.0.6.1:better php code generated by 'schedule backup', 37 | small bug in ftp upload, export will be finished if connection breaks 38 | new features: path selection in 'schedule backup', 39 | 40 | 06/30/2004 41 | v.0.6.2:bugs fixed in sql_query.php 42 | 43 | 07/17/2004 44 | v.1.0: backup data is saved in several steps to save memory, 45 | better style and better html code, better install guide, 46 | support of shell mode (read file: SHELL_MODE) 47 | new features: Delete, empty, import actions can be confirmed, 48 | import ALL function to import the last backup of each database, 49 | possibility to view .gz backups, add 'use database' to backups, 50 | table infos can be viewed in 'database info', support of 51 | different time formates, validation of some configuration entries, 52 | validation of mySQL username and password, export directory can 53 | be moved to another place, duration of backups and imports and 54 | more is shown, sum of backup sizes and date of last backup on 55 | import page and maybe something more ... 56 | 57 | 09/21/2004 58 | v.1.1: small bugs fixed, new email code, code cleanup 59 | new features: possibility to select a non default FTP port, 60 | possibility to disable the login function, bug fixed with missing 61 | gzip function, gzip checkbox is disabled when function gzopen() 62 | is not available; ftp, mail amd timelimit items are disabled in 63 | configuration if the corresponding functions are not available 64 | 65 | 11/29/2004 66 | v.1.2: fixed typos in comments and language files, reformat of backup files, 67 | bugs in scripts for scheduled backups fixed, code cleanup, 68 | immediately change of language, better backup files header 69 | new features: charsets now in dependence of choosen language, 70 | new compression method 'zip' (*.zip) added (builds one-file-archives), 71 | automatically show arabic layout when arabic language files are choosen, 72 | possibility to get also backups on ftp servers automatically deleted, 73 | auto increment value added in backup files, validation of ftp data, 74 | comments are no longer saved in separate file but are included now, 75 | possibility to create a file with the 'schedule backup' script, 76 | totally new designed configuration page with some new features like: 77 | possibility to choose a skin (stylesheet) in the configuration, 78 | possibility to set number of backup files to store for each database, 79 | get_db_list patch integrated: declaration of only one database possible 80 | 81 | 03/05/2005 82 | v.1.3: improved sql queries, fixed shellmode bug, fixed backup bug from v.1.2, 83 | fixed empty ALL db bug from v.1.2, improved db info page sql queries, 84 | improved handling of NULL values, improved shell mode 85 | new features: download links at import page, possibility to mail backups 86 | to several email adresses, directory backup functions, 87 | HTTP authentication as alternative login method 88 | 89 | 03/10/2005 90 | v.1.3.1:fixed minor bug in backup function, changed URLs in commments to 91 | new homepage http://phpmybackup.sourceforge.net 92 | 93 | 03/12/2005 94 | v.1.3.2:fixed a wrong error message, improved error handling in backup functions 95 | new feature: to only send backups by email or ftp it is possible to set 96 | number of stored files to 0. 97 | 98 | 03/25/2005 99 | v.1.4: a new and better email function, minor bug fixes, improved documentation 100 | faster loading of pages, date.dat is generated automatically 101 | all links are now updated to new home page http://www.phpMyBackupPro.net 102 | new features: management of accounts on several servers possible, 103 | recursive directory backups 104 | 105 | 04/13/2005 106 | v.1.5: bug with null values removed, bug with ZIP compression fixed, more 107 | precise execution times, highlighting of rows in lists, 108 | new features: new design with logo with images and with new stylesheet, 109 | recursively directory backups, directory backups now seperated from 110 | MySQL backups to FTP server, support of MySQL tables with foreign keys 111 | 112 | 05/17/2005 113 | v.1.6: no 'use database' command in backup files when using single db mode, 114 | images contain title tags, some defines now with prefix, check wether 115 | databases selected for backups are available, duration values now with 116 | milliseconds, improved 'schedule backup' script which generates smaller 117 | scripts, better inclusion of login.php, the correct PHP timelimit will 118 | be shown in 'configuration' also if Safe Mode is activated, minor bug 119 | fixes and code cleanupfaster directory listing in directory backup mode, 120 | improved several server mode 121 | new features: detailed system informations on 'start' page, multi server 122 | mode is now useable with the 'single db' attribute for all servers, 123 | date.dat is no longer required, accesskeys for the menu items (alt+key), 124 | possibility to upload .gz files and .zip files (but only those ZIP files 125 | created by phpMyBackupPro) on page 'sql_queries', system variables 126 | for storing not configurable settings and system status values, 127 | debug modus for scheduled backup mode, if more than one db is available 128 | 'CREATE DATABASE IF NOT EXISTS ...' will be added to the backup files 129 | 130 | 05/27/2005 131 | v.1.6.1:a major bug was fixed in this release: the bug in get_db_list() which 132 | produced empty backups, also $_SERVER['SCRIPT_FILENAME'] was projectwider 133 | replaced by $_SERVER['SCRIPT_NAME'] as $_SERVER['SCRIPT_FILENAME'] is not 134 | on all servers available. The schedule backup page remembers the file 135 | name and directory for the scheduled-backup-script 136 | 137 | 06/13/2005 138 | v.1.6.2:actually it is v.1.6.1, but with improved multi server mode (bug fixes): 139 | Scheduled backup are working fine now, etc. There is one bug left which 140 | occasianally writes the wrong sql data to the global_conf.php file. If 141 | this happens, you must login with this data! I can't reproduce this bug! 142 | new features: possibility to exclude tables from backups using the system 143 | variables, the backups for the sql account entered on configurations are 144 | also saved directly in the export directory now 145 | 146 | 07/11/2005 147 | v.1.6.3:improved English syntax and many corrected typos in the documentation 148 | files and the English language files. 149 | No code modifications! 150 | 151 | 07/19/2005 152 | v.1.7: improved FTP delete function which no longer leaves old backup files on 153 | the ftp server, bug with null values in the backup function fixed, 154 | directory lists for backup and schedule backup pages are stored temporary 155 | now, improved email function (fixes a problem with some mail servers), 156 | new features: all selections made on the backup and schedule backup pages 157 | are stored in the system variables now, system variables can be viewed 158 | and edited on the configuration page, link to view the file which was 159 | specified on the schedule backup page, if settings were lost in 160 | global_conf.php they will automatically be reset now, an empty html page 161 | in the export directory which prevents a directory listing from a client 162 | PC, now it is possible to use scheduled scripts for several servers 163 | without timing problems 164 | 165 | 07/21/2005 166 | v.1.7.1:fixed a major bug in the schedule backup functions! 167 | Update to v.1.7.1 if you are using scheduled backups! 168 | 169 | 02/13/2006 170 | v.1.8: increased the speed of the import funktion and decreased its memory 171 | demands (only gzip and sql files), increased the speed of sql queries, 172 | new features: system variable to backup all existing databases in 173 | scheduled backups, favicon for Mozilla Firefox users 174 | 175 | 02/08/2007 176 | v.2.0b: new favicon, larger backups and their properties can be viewed now, 177 | triggering of several automatic and synchronous backups is no longer 178 | possible, improved zip functions, sql queries in zip-files can be 179 | executed on the 'sql queries' page, fixed 'last login' information, 180 | better stylesheet error handling, improved (online) help and 181 | documentation 182 | new features: one installation of pMBP is now useable for several users 183 | of one MySQL database => read MULTI_USERS.txt for more information, 184 | file system backups can be zipped into one zip file, fragmented imports 185 | for large backups 186 | 187 | 03/15/2007 188 | v.2.0: FTP backup fixed, problem with incorrect FTP data fixed, problem with 189 | pathes of zipped files fixed 190 | 191 | 04/01/2007 192 | v.2.1: email problem in v.2.0 fixed (empty/missing files), fixed call-by- 193 | -reference problem enables bigger backups now, fixed shell/cron mode 194 | new features: directory backups can be send by email (see 195 | SYSTEM_VARIABLES.txt) 196 | 197 | 09/25/2011 198 | v.2.2: support for PHP 5.x, improved error messages on memory problems or 199 | PHP timeouts, permissions of backup files are now set to 0700 instead 200 | 0777, improved gzip algorithm, "simple mode" without configuration and 201 | sql-queries tabs, support for zipped files in shell-mode, support for 202 | backing up all tables in shell mode, support for different character 203 | sets, improved generator for the scheduled backup scripts, backups of 204 | directories zipped in one file by email 205 | 206 | 07/09/2012 207 | v.2.3: minor security fixes, improved support for special characters in 208 | passwords, support of individual chmod values (useful with cron-jobs), 209 | support of views (backup and import) 210 | 211 | 08/14/2013 212 | v.2.4: PHP 5 support (deprecated methods like ereg/eregi/etc removed), upgrade 213 | to pclzip 2.8.2, changed all communication and file-formats to UTF-8, 214 | improved VIEWS support (DROP VIEW if exists, dependencies support), 215 | corrected DROP TABLES order for dependencies, fixed compressed file 216 | backup feature, "empty db" feature now considers views, minor bug fixes 217 | 218 | 03/26/2015 219 | v.2.5: security fixes in mutli user mode, minor bug fixes 220 | 221 | 02/09/2018 222 | v.2.6: added compatibility for PHP 7.x 223 | Tested on: 224 | Apache/2.4.29 (Unix) OpenSSL/1.0.2n PHP/7.2.1 mod_perl/2.0.8-dev Perl/v5.16.3 225 | PHP 7.2.1 (cli) (built: Jan 16 2018 14:26:44) ( NTS ) 226 | Zend Engine v3.2.0 227 | Zorin OS 12.2 (Based on Ubuntu 16.04) -------------------------------------------------------------------------------- /backup.php: -------------------------------------------------------------------------------- 1 | \n| phpMyBackupPro ".PMBP_VERSION." (c) 2004-2015 by Dirk Randhahn\n| ".PMBP_WEBSITE."\n+======>\n\n"; 53 | if (!isset($argv[1])) { 54 | echo PMBP_EX_NO_ARGV; 55 | exit; 56 | } 57 | $mode="shell"; 58 | $_POST['db']=$argv[1]; 59 | if (isset($argv[2])) { 60 | if ($argv[2]) $_POST['tables']="on"; else $_POST['tables']="off"; 61 | } else $_POST['tables']="off"; 62 | if (isset($argv[3])) { 63 | if ($argv[3]) $_POST['data']="on"; else $_POST['data']="off"; 64 | } else $_POST['data']="off"; 65 | if (isset($argv[4])) { 66 | if ($argv[4]) $_POST['drop']="on"; else $_POST['drop']="off"; 67 | } else $_POST['drop']="off"; 68 | if (isset($argv[5])) { 69 | if ($argv[5]==1 || $argv[5]=="gzip") $_POST['zip']="gzip"; 70 | elseif($argv[5]=="zip") $_POST['zip']="zip"; 71 | else $_POST['zip']="off"; 72 | } else $_POST['zip']="off"; 73 | if (isset($argv[6])) $_POST['man_dirs']=$argv[6]; else $_POST['man_dirs']=FALSE; 74 | if(isset($argv[7])) { 75 | if ($argv[5]) $_POST['packed']="on"; else $_POST['packed']="off"; 76 | } else $_POST['packed']="off"; 77 | if(isset($argv[8])) $_POST['comments']=$argv[8]; 78 | 79 | // backups are only triggered if security key is set right 80 | // older versions of the backup script witout security key should not cause error outputs, but will not trigger backups! 81 | } elseif (isset($security_key)) { 82 | $mode="incl"; 83 | include_once("definitions.php"); 84 | if (!isset($_SESSION['wss'])) $_SESSION['wss']=-1; 85 | // is a databse or a directory selected? 86 | if ($_POST['db'] || isset($_POST['dirs']) || strlen($_POST['man_dirs'])) { 87 | // backups can only be triggered with the right security key! 88 | if ($security_key==$PMBP_SYS_VAR['security_key']) { 89 | // add new 'last_scheduled' system variables if it does not exist for the current account 90 | if ($_SESSION['wss']<0) { 91 | if (!isset($PMBP_SYS_VAR['last_scheduled'])) $PMBP_SYS_VAR['last_scheduled']=0; 92 | } else { 93 | if (!isset($PMBP_SYS_VAR['last_scheduled_'.$_SESSION['wss']])) $PMBP_SYS_VAR['last_scheduled_'.$_SESSION['wss']]=0; 94 | } 95 | // check if it is already time for a new backup 96 | if ($period!=0) { 97 | if ( ($_SESSION['wss']<0 && $PMBP_SYS_VAR['last_scheduled']>(time()-$period) ) || 98 | ($_SESSION['wss']>=0 && $PMBP_SYS_VAR['last_scheduled_'.$_SESSION['wss']]>(time()-$period)) ) { 99 | if($PMBP_SYS_VAR['scheduled_debug']) 100 | echo "It's not time for a new backups yet! Set period to 'At each call' for debugging.
\n"; 101 | return FALSE; 102 | } 103 | } 104 | } else { 105 | if($PMBP_SYS_VAR['scheduled_debug']) 106 | echo "The security key is wrong. It must have the same value as in global_conf.php. Create a new script!
\n"; 107 | return FALSE; 108 | } 109 | } else { 110 | if($PMBP_SYS_VAR['scheduled_debug']) 111 | echo "No database or directory was selected to backup.
\n"; 112 | return FALSE; 113 | } 114 | if($PMBP_SYS_VAR['scheduled_debug']) 115 | echo "Start backing up the databases now:
\n"; 116 | } else { 117 | $mode="web"; 118 | include("login.php"); 119 | } 120 | 121 | // set the timelimit 122 | @set_time_limit($CONF['timelimit']); 123 | @ignore_user_abort(TRUE); 124 | 125 | if ($mode=="incl") { 126 | // save the new timestamp 127 | if ($_SESSION['wss']<0) { 128 | $PMBP_SYS_VAR['last_scheduled']=time(); 129 | } else { 130 | $PMBP_SYS_VAR['last_scheduled_'.$_SESSION['wss']]=time(); 131 | } 132 | // update global_conf.php 133 | PMBP_save_global_conf(); 134 | } 135 | 136 | 137 | // print html if web mode 138 | if ($mode=="web") { 139 | PMBP_print_header(preg_replace("#.*/#","",$_SERVER['SCRIPT_NAME'])); 140 | 141 | // if first use or no db-connection possible 142 | if (!PMBP_mysql_connect()) echo PMBP_addOutput(I_SQL_ERROR,"red"); 143 | 144 | // check if ftp connection is possible 145 | if ($CONF['ftp_use'] || $CONF['dir_backup']) { 146 | if (!$CONF['ftp_server']) { 147 | echo PMBP_addOutput(C_WRONG_FTP,"red"); 148 | } elseif (!$conn_id=@ftp_connect($CONF['ftp_server'],$CONF['ftp_port'],$PMBP_SYS_VAR['ftp_timeout'])) { 149 | echo PMBP_addOutput(F_FTP_1." '".$CONF['ftp_server']."'!","red"); 150 | } 151 | } 152 | } 153 | 154 | // if pressed 'backup' backup the db 155 | if ($_POST['db'] || isset($_POST['dirs']) || strlen($_POST['man_dirs'])) { 156 | $out=""; 157 | 158 | // get start time to calculate duration 159 | if (function_exists("microtime")) { 160 | $microtime=explode(" ",microtime()); 161 | $starttime=($microtime[0]+$microtime[1]); 162 | } else { 163 | $starttime=time(); 164 | } 165 | 166 | // delete old backup files 167 | PMBP_get_backup_files(); 168 | 169 | // save PMBP_SYS_VARS 170 | if ($mode=="web") PMBP_save_export_settings(); 171 | 172 | // get all available databases 173 | $available_dbs=PMBP_get_db_list(); 174 | 175 | // in shell mode the dbs must be seperated with commas 176 | if ($mode=="shell") { 177 | if($_POST['db']=='%%ALL%%') { 178 | $db_list=$available_dbs; 179 | } else { 180 | $db_list=explode(",",$_POST['db']); 181 | } 182 | } elseif(!isset($_POST['db'][0])) { 183 | $db_list=FALSE; 184 | } else { 185 | $db_list=$_POST['db']; 186 | } 187 | 188 | // always backup all dbs in scheduled mode, if the system variable is set 189 | if ($mode=="incl" && $PMBP_SYS_VAR["schedule_all_dbs"]) { 190 | $db_list=$available_dbs; 191 | } 192 | 193 | // is a database selected? 194 | if ($db_list) { 195 | 196 | foreach($db_list as $export_db) { 197 | 198 | // check if $export_db is available 199 | if (in_array($export_db,$available_dbs)) { 200 | 201 | // generate db dump 202 | $backupfile=PMBP_dump($export_db,($_POST['tables']=="on"),($_POST['data']=="on"),($_POST['drop']=="on"),$_POST['zip'],$_POST['comments']); 203 | 204 | // is there no db connection or a db missing? 205 | if ($backupfile && $backupfile!=="DB_ERROR") { 206 | // change mode to 0700 207 | // if you can't read the files, alter this to e.g. 0777' 208 | @chmod($backupfile,$PMBP_SYS_VAR['B_backup_chmod']); 209 | 210 | // remember filenames if backup by ftp or email is selected 211 | if (($CONF['email_use'] && function_exists("mail")) || ($CONF['ftp_use'] && function_exists("ftp_connect"))) { 212 | $store_files[]=PMBP_EXPORT_DIR.$backupfile; 213 | } 214 | 215 | $msg=PMBP_addOutput(EX_SAVED." ".$backupfile,"green"); 216 | if($mode=="incl") $out.=$msg; else echo $msg; 217 | 218 | } elseif($backupfile==="DB_ERROR") { 219 | $msg=PMBP_addOutput(C_WRONG_SQL,"red"); 220 | if($mode=="incl") $out.=$msg; else echo $msg; 221 | } else { 222 | $msg=PMBP_addOutput(sprintf(EX_NOT_SAVED,$export_db,PMBP_EXPORT_DIR),"red"); 223 | if($mode=="incl") $out.=$msg; else echo $msg; 224 | } 225 | 226 | } else { 227 | $msg=PMBP_addOutput(sprintf(PMBP_EX_NO_AVAILABLE,$export_db),"red"); 228 | if($mode=="incl") $out.=$msg; else echo $msg; 229 | } 230 | } 231 | } else { 232 | $smg=PMBP_addOutput(EX_NO_DB,"red"); 233 | if($mode=="incl") $out.=$msg; else echo $msg; 234 | } 235 | 236 | // start backup using ftp or email 237 | $backup_info=array("comments"=>$_POST['comments'],"tables"=>($_POST['tables']=="on"),"data"=>($_POST['data']=="on"),"drop"=>($_POST['drop']=="on"),"comp"=>$_POST['zip']); 238 | if ($CONF['ftp_use'] && isset($store_files)) $out.=PMBP_FTP_store($store_files); 239 | if ($CONF['email_use'] && isset($store_files)) $out.=PMBP_email_store($store_files,$backup_info); 240 | 241 | // file backup per FTP 242 | if ($CONF['dir_backup'] && (isset($_POST['dirs']) || strlen($_POST['man_dirs']))) { 243 | $_POST['man_dirs']= str_replace("\n",",",$_POST['man_dirs']); 244 | $files=array(); 245 | if (isset($_POST['dirs'])) { 246 | $_POST['dirs']=array_merge(explode(",",$_POST['man_dirs']),$_POST['dirs']); 247 | foreach($_POST['dirs'] as $dir) $files=array_merge($files,PMBP_get_files($dir)); 248 | } else { 249 | foreach(explode("|",$_POST['man_dirs']) as $dir) $files=array_merge($files,PMBP_get_files(trim($dir))); 250 | } 251 | 252 | // backup files by FTP 253 | $out.=PMBP_save_FTP_and_Email($files,$_POST['packed']); 254 | } 255 | 256 | // show execution duration 257 | if (function_exists("microtime")) { 258 | $microtime=explode(" ",microtime()); 259 | $endtime=($microtime[0]+$microtime[1]); 260 | } else { 261 | $endtime=time(); 262 | } 263 | 264 | if ($mode=="web") { 265 | echo $out."\n"; 266 | echo "
".F_DURATION.": ".number_format($endtime-$starttime,3)." ".F_SECONDS."
\n"; 267 | echo "
"; 268 | } elseif ($mode=="shell") { 269 | echo $out; 270 | echo F_DURATION.": ".number_format($endtime-$starttime,3)." ".F_SECONDS."\n"; 271 | } elseif($mode=="incl") { 272 | if ($PMBP_SYS_VAR['scheduled_debug']) { 273 | echo $out; 274 | echo F_DURATION.": ".number_format($endtime-$starttime,3)." ".F_SECONDS; 275 | } 276 | } 277 | } 278 | 279 | // show the form for selecting a db to backup 280 | if ($mode=="web") { 281 | echo "
\n
\n"; 282 | PMBP_print_export_form(); 283 | echo "\n\n
\n
\n"; 284 | } 285 | 286 | // update file list (deletes new generated files if $CONS[del_numer]=0) 287 | PMBP_get_backup_files(); 288 | 289 | // print html if web mode 290 | if ($mode=="web") { 291 | PMBP_print_footer(); 292 | } elseif ($mode=="incl") { 293 | return TRUE; 294 | } 295 | ?> 296 | -------------------------------------------------------------------------------- /import.php: -------------------------------------------------------------------------------- 1 | $last_files[$db][1]) { 90 | $last_files[$db][0] = $file; 91 | $last_files[$db][1] = $time; 92 | } 93 | } 94 | if (isset($last_files)) { 95 | foreach ($last_files as $last_file) { 96 | $import_files[] = $last_file[0]; 97 | } 98 | } 99 | 100 | } 101 | 102 | if (isset($import_files)) { 103 | 104 | // set php timelimit 105 | @set_time_limit($CONF['timelimit']); 106 | @ignore_user_abort(true); 107 | 108 | // import each file 109 | foreach ($import_files as $import_file) { 110 | 111 | // check if a db with the name of the backup file still exists and select it 112 | $db = @mysqli_select_db($dbname = PMBP_file_info("db", PMBP_EXPORT_DIR . $import_file)); 113 | if (!$db) { 114 | echo PMBP_addOutput(sprintf(PMBP_EX_NO_AVAILABLE, $dbname), "red"); 115 | } else { 116 | $error = ""; 117 | 118 | // extract zip file 119 | if (PMBP_file_info("comp", PMBP_EXPORT_DIR . $import_file) == "zip") { 120 | include_once "pclzip.lib.php"; 121 | $pclzip = new PclZip(PMBP_EXPORT_DIR . $import_file); 122 | $extracted_file = $pclzip->extractByIndex(0, PMBP_EXPORT_DIR, ""); 123 | if ($pclzip->error_code != 0) { 124 | $error = "plczip: " . $pclzip->error_string . "
" . BI_BROKEN_ZIP . "!"; 125 | } 126 | 127 | $import_file = substr($import_file, 0, strlen($import_file) - 4); 128 | unset($pclzip); 129 | } 130 | 131 | // execute sql queries 132 | if (!$error) { 133 | if ($file = @gzopen(PMBP_EXPORT_DIR . $import_file, "r")) { 134 | extract(PMBP_exec_sql($file, $con), EXTR_OVERWRITE); 135 | } else { 136 | $error = F_MAIL_3; 137 | } 138 | 139 | if ($file) { 140 | @gzclose($file); 141 | } 142 | 143 | if (file_exists(PMBP_EXPORT_DIR . $import_file . ".zip")) { 144 | unlink(PMBP_EXPORT_DIR . $import_file); 145 | } 146 | 147 | $import_file .= ".zip"; 148 | } 149 | 150 | // echo success 151 | if ($error) { 152 | echo PMBP_addOutput($import_file . ": " . $error, "red_left"); 153 | } else { 154 | echo PMBP_addOutput(IM_SUCCESS . " " . $insertQueries . " " . IM_TABLES . " " . $tableQueries . " " . IM_ROWS . " (" . $import_file . ")", "green"); 155 | } 156 | } 157 | } 158 | } 159 | // show execution duration 160 | if (function_exists("microtime")) { 161 | $microtime = explode(" ", microtime()); 162 | $endtime = ($microtime[0] + $microtime[1]); 163 | } else { 164 | $endtime = time(); 165 | } 166 | echo "
" . F_DURATION . ": " . number_format($endtime - $starttime, 3) . " " . F_SECONDS . "

\n"; 167 | } 168 | 169 | // remove old backup files and get list of backup files 170 | $all_files = PMBP_get_backup_files(); 171 | 172 | // delete ALL backup files if the link was clicked 173 | if ($_GET['del_ALL']) { 174 | $result = false; 175 | if (is_array($all_files)) { 176 | $result = PMBP_delete_backup_files($all_files); 177 | } 178 | 179 | if (!$result) { 180 | echo PMBP_addOutput(B_DELETED_ALL, "green"); 181 | } else { 182 | echo PMBP_addOutput($result, "red"); 183 | } 184 | 185 | } 186 | 187 | // empty ALL db if the link was clicked 188 | if ($_GET['empty_ALL']) { 189 | foreach (PMBP_get_db_list() as $dbname) { 190 | empty_single_db($_GET['empty_all']); 191 | } 192 | } 193 | 194 | // empty db if the link was clicked 195 | if ($_GET['empty_all']) { 196 | empty_single_db($_GET['empty_all']); 197 | } 198 | 199 | // delete all backup files of selected db if the link was clicked 200 | if ($_GET['del_all']) { 201 | if (is_array($all_files)) { 202 | foreach ($all_files as $filename) { 203 | if ($_GET['del_all'] == PMBP_file_info("db", PMBP_EXPORT_DIR . $filename)) { 204 | $del_files[] = $filename; 205 | } 206 | } 207 | } 208 | 209 | $result = PMBP_delete_backup_files($del_files); 210 | if (!$result) { 211 | echo PMBP_addOutput(B_DELETED_ALL, "green"); 212 | } else { 213 | echo PMBP_addOutput($result, "red"); 214 | } 215 | 216 | } 217 | 218 | // delete selected backup file if the link was clicked 219 | if ($_GET['del']) { 220 | $out = PMBP_delete_backup_files($_GET['del']); 221 | if ($out) { 222 | echo $out; 223 | } else { 224 | echo PMBP_addOutput(B_DELETED, "green"); 225 | } 226 | 227 | } 228 | 229 | // get new list of backup files 230 | $all_files = PMBP_get_backup_files(); 231 | 232 | echo "\n"; 233 | 234 | // list all backup files 235 | if (is_array($all_files)) { 236 | $last_backup = 0; 237 | $size_sum = 0; 238 | 239 | // print html table 240 | foreach ($all_files as $filename) { 241 | $file = PMBP_EXPORT_DIR . $filename; 242 | 243 | // generate one row for the db name 244 | if (!isset($printed_title[$db = PMBP_file_info("db", $file)])) { 245 | $printed_title[$db] = true; 246 | echo "\n"; 248 | } 249 | 250 | echo "\n\n"; 251 | echo "\n"; 252 | if ($time > $last_backup) { 253 | $last_backup = $time; 254 | } 255 | 256 | $size_sum += $size = PMBP_file_info("size", $file); 257 | $size = PMBP_size_type($size); 258 | echo "\n"; 259 | echo "\n"; 260 | echo "\n"; 261 | echo "\n"; 262 | if ($con) { 263 | echo "\n"; 270 | } else { 271 | echo B_IMPORT_FRAG . "\n"; 272 | } 273 | 274 | echo "\n\n"; 275 | } 276 | 277 | // print delete ALL backups and empty ALL dbs links if backup files are available 278 | $size_sum = PMBP_size_type($size_sum); 279 | echo "\n"; 280 | echo "\n\n"; 283 | } else { 284 | 285 | // if there are no backup files 286 | echo "\n\n\n"; 287 | } 288 | 289 | echo "
" . $db . " " . PMBP_confirm(B_CONF_EMPTY_DB, "import.php?empty_all=" . $db, "[" . B_EMPTY_DB . "]"); 247 | echo " " . PMBP_confirm(B_CONF_DEL_ALL, "import.php?del_all=" . $db, "[" . B_DELETE_ALL . "]") . "
\n" . $filename . "" . strftime($CONF['date'], $time = PMBP_file_info("time", $file)) . "" . $size['value'] . " " . $size['type'] . "" . PMBP_pop_up("file_info.php?file=" . $filename, B_INFO, "info") . "" . PMBP_pop_up("get_file.php?view=" . $file, B_VIEW, "view") . "" . B_DOWNLOAD . "" . PMBP_confirm(B_CONF_IMP, "import.php?import=" . $filename, B_IMPORT) . " \n"; 264 | } else { 265 | echo "" . B_IMPORT . " \n"; 266 | } 267 | 268 | if ($con) { 269 | echo "(" . PMBP_confirm(B_CONF_IMP, "big_import.php?fn=" . PMBP_EXPORT_DIR . $filename . "&dbn=" . $db, B_IMPORT_FRAG, "info") . ")" . PMBP_confirm(B_CONF_DEL, "import.php?del=" . $filename, B_DELETE) . "

" . B_SIZE_SUM . ": " . $size_sum['value'] . " " . $size_sum['type'] . " - " . B_LAST_BACKUP . ": " . strftime($CONF['date'], $last_backup) . "
" . PMBP_confirm(B_CONF_EMPT_ALL, "import.php?empty_ALL=TRUE", "[" . B_EMPTY_ALL . "]"); 281 | echo " " . PMBP_confirm(B_CONF_IMP_ALL, "import.php?imp_ALL=TRUE", "[" . B_IMPORT_ALL . "]") . "\n"; 282 | echo " " . PMBP_confirm(B_CONF_DEL_ALL_2, "import.php?del_ALL=TRUE", "[" . B_DELETE_ALL_2 . "]") . "
 
" . B_NO_FILES . ".
\n
\n"; 290 | PMBP_print_footer(); 291 | 292 | function startTransaction() 293 | { 294 | mysqli_query($con, "SET AUTOCOMMIT=0"); 295 | mysqli_query($con, "START TRANSACTION"); 296 | mysqli_query($con, "SET FOREIGN_KEY_CHECKS=0"); 297 | } 298 | function endTransaction() 299 | { 300 | mysqli_query($con, "SET FOREIGN_KEY_CHECKS=1"); 301 | mysqli_query($con, "COMMIT"); 302 | } 303 | 304 | function empty_single_db($db_name) 305 | { 306 | $con = PMBP_mysql_connect(); 307 | $db = mysqli_select_db($con, $db_name); 308 | if (!$db) { 309 | echo PMBP_addOutput(sprintf(PMBP_EX_NO_AVAILABLE, $db_name), "red"); 310 | } else { 311 | // $query = "SHOW TABLES"; 312 | // $res = mysqli_query($con, $query); // This is not doing anything 313 | $tables_and_views = PMBP_list_tables_and_view($con); 314 | startTransaction(); 315 | foreach ($tables_and_views['views'] as $view) { 316 | mysqli_query($con, "drop view `" . $view['Name'] . "`"); 317 | echo mysqli_error($con); 318 | } 319 | foreach ($tables_and_views['tables'] as $table) { 320 | mysqli_query($con, "drop table `" . $table['Name'] . "`"); 321 | echo mysqli_error($con); 322 | } 323 | endTransaction(); 324 | $error = mysqli_error($con); 325 | if ($error) { 326 | echo $error; 327 | } else { 328 | echo PMBP_addOutput(B_EMPTIED, "green"); 329 | } 330 | 331 | } 332 | } 333 | -------------------------------------------------------------------------------- /sql_query.php: -------------------------------------------------------------------------------- 1 | "; 58 | } 59 | 60 | // if sql_query was send to db 61 | if (($_POST['sql_query'] || $_FILES['sql_file']) && $_POST['db']) { 62 | 63 | // get start time to calculate duration 64 | if (function_exists("microtime")) { 65 | $microtime = explode(" ", microtime()); 66 | $starttime = ($microtime[0] + $microtime[1]); 67 | } else { 68 | $starttime = time(); 69 | } 70 | 71 | // set php timelimit 72 | @set_time_limit($CONF['timelimit']); 73 | @ignore_user_abort(true); 74 | 75 | // get the submited file 76 | if (is_uploaded_file($_FILES['sql_file']['tmp_name'])) { 77 | 78 | // run big_import.php 79 | if (isset($_POST['fragmented'])) { 80 | $filename = PMBP_EXPORT_DIR . $_FILES['sql_file']['name']; 81 | // rename to make it consistent 82 | @rename($_FILES['sql_file']['tmp_name'], $filename); 83 | if (file_exists($filename)) { 84 | echo ""; 88 | } 89 | 90 | // standard import 91 | } else { 92 | 93 | // trim lines and remove comments 94 | $sql_file = ""; 95 | 96 | // remove comments and store sql queries in $sql_file 97 | while ($line = PMBP_getln($_FILES['sql_file']['tmp_name'], false, $_FILES['sql_file']['name'])) { 98 | if (trim($line) && substr(trim($line), 0, 1) != "#" && substr(trim($line), 0, 2) != "--") { 99 | $sql_file .= trim($line) . "\n"; 100 | } 101 | 102 | } 103 | PMBP_getln($_FILES['sql_file']['tmp_name'], true, $_FILES['sql_file']['name']); 104 | 105 | // do everything below once for the POST-data and once for the file 106 | $file_and_post = array($_POST['sql_query'], $sql_file); 107 | 108 | /* 109 | // alternative code instead of the paragraph before: 110 | // it uses exec_sql for executing the sql queries but does not output any query results!!! 111 | 112 | // extract zip file 113 | if (PMBP_file_info("comp",$_FILES['sql_file']['name'])=="zip") { 114 | include_once("pclzip.lib.php"); 115 | $pclzip = new PclZip($_FILES['sql_file']['tmp_name']); 116 | $extracted_file=$pclzip->extractByIndex(0,PMBP_EXPORT_DIR,""); 117 | if ($pclzip->error_code!=0) $error="plczip: ".$pclzip->error_string."
".BI_BROKEN_ZIP."!"; 118 | $filename=PMBP_EXPORT_DIR.$extracted_file[0]["stored_filename"]; 119 | unset($pclzip); 120 | } 121 | 122 | $resultArray=PMBP_exec_sql($filehandler=gzopen($filename,"r"),$con); 123 | @gzclose($filehandler); 124 | @unlink($filename); 125 | print_r($resultArray); 126 | */ 127 | } 128 | } 129 | 130 | if (!isset($file_and_post)) { 131 | $file_and_post = array($_POST['sql_query']); 132 | } 133 | 134 | // for standard imports 135 | if (!isset($_POST['fragmented'])) { 136 | 137 | // $key > 0 when the source was a file 138 | foreach ($file_and_post as $key => $sql_queries) { 139 | // select the db 140 | if (!$key) { 141 | mysqli_select_db($con, $_POST['db']); 142 | } 143 | 144 | // replace these strings in the sql query. Do you know any more or a better way? 145 | if (!$key) { 146 | $str_find = array("\\'", '\\"', "\\\\"); //" 147 | $str_repl = array("'", '"', "\\"); //" 148 | $sql_queries = str_replace($str_find, $str_repl, $sql_queries); 149 | $sql_print = $sql_queries; 150 | } 151 | 152 | // separate sql queries and remove empty queries 153 | $all_queries = str_replace(";\n", ";|:-:--:-:|", $sql_queries); 154 | $all_queries = str_replace(";\r\n", ";|:-:--:-:|", $all_queries); 155 | $queries = explode("|:-:--:-:|", $all_queries); 156 | 157 | // to remove empty rows 158 | $all_queries = ""; 159 | foreach ($queries as $number => $query) { 160 | if (strlen($query) > 1) { 161 | $all_queries[$number] = $query; 162 | } 163 | } 164 | 165 | // execute sql queries 166 | $i = 0; 167 | $sql_error = false; 168 | 169 | if (is_array($all_queries)) { 170 | foreach ($all_queries as $query) { 171 | $i++; 172 | if (!$key) { 173 | echo "
" . SQ_RESULT . " " . $i . ":
\n"; 174 | } 175 | 176 | // error if: no result AND error is not 'empty result' OR: error is empty result and its the first error 177 | if ((!$res = mysqli_query($con, $query) and mysqli_errno($con) != 1065) or (mysqli_errno($con) == 1065 and !$sql_error)) { 178 | echo $query . "\n" . PMBP_addOutput(mysqli_error($con), "red_left") . "
\n"; 179 | if ($key) { 180 | $sql_error .= "F" . $i . ", "; 181 | } else { 182 | $sql_error .= $i . ", "; 183 | } 184 | 185 | } elseif (mysqli_errno($con) != 1065) { 186 | 187 | // print result table 188 | if (!$key) { 189 | echo "\n"; 190 | 191 | // print field names 192 | echo "\n"; 193 | for ($j = 0, $field_names = ""; $field_names[] = @mysqli_field_name($res, $j); $j++) { 194 | echo ""; 195 | } 196 | 197 | echo "\n"; 198 | 199 | // print query results 200 | $result_exists = false; 201 | while ($result = @mysqli_fetch_array($res, MYSQL_NUM)) { 202 | $result_exists = true; 203 | if (!$key) { 204 | echo ""; 205 | } 206 | 207 | foreach ($result as $field) { 208 | if ($field != "" && !$key) { 209 | echo ""; 210 | } else { 211 | echo ""; 212 | } 213 | } 214 | 215 | if (!$key) { 216 | echo "\n"; 217 | } 218 | 219 | } 220 | 221 | // print number of rows or if empty mysql result print number of affected rows 222 | if (!$result_exists) { 223 | if (!$key) { 224 | echo "\n\n\n"; 225 | } 226 | 227 | if (!$affected = @mysqli_affected_rows()) { 228 | $affected = 0; 229 | } 230 | 231 | } else { 232 | if (!$affected = @mysqli_num_rows($res)) { 233 | $affected = 0; 234 | } 235 | 236 | } 237 | 238 | echo "\n\n\n"; 239 | echo "
" . $field_names[$j] . "
" . htmlentities($field) . " 
" . SQ_SUCCESS . "
" . SQ_AFFECTED . ": " . $affected . "

\n"; 240 | } 241 | } 242 | } 243 | } 244 | 245 | if (!$key && isset($_FILES['sql_file']['filename'])) { 246 | echo "======== " . $_FILES['sql_file']['name'] . " ========
\n"; 247 | } 248 | 249 | } 250 | } 251 | 252 | // print errors and final message if the import was not fragmented 253 | if (!isset($_POST['fragmented'])) { 254 | // print errors or message of success 255 | if ($sql_error) { 256 | echo PMBP_addOutput(SQ_ERROR . " " . $sql_error, "red_left"); 257 | } else { 258 | echo PMBP_addOutput(SQ_SUCCESS, "green_left"); 259 | } 260 | 261 | // print execution duration 262 | if (function_exists("microtime")) { 263 | $microtime = explode(" ", microtime()); 264 | $endtime = ($microtime[0] + $microtime[1]); 265 | } else { 266 | $endtime = time(); 267 | } 268 | echo "
" . F_DURATION . ": " . number_format($endtime - $starttime, 3) . " " . F_SECONDS . "


\n"; 269 | } 270 | } 271 | 272 | // print html form and show last selected database and last queries 273 | echo "
\n
\n"; 274 | echo "
" . SQ_WARNING . "
\n"; 275 | 276 | // print database select 277 | echo SQ_SELECT_DB . ":
\n
"; 293 | 294 | // print sql textarea and submit button 295 | echo "
" . SQ_INSERT . ":
\n"; 296 | echo ""; 297 | echo "

" . SQ_FILE . ":
\n" . $_POST['sql_file']; 298 | echo "

\n\n"; 299 | echo "\n    ( " . B_IMPORT_FRAG . ")
\n"; 300 | echo "
\n
\n"; 301 | PMBP_print_footer(); 302 | -------------------------------------------------------------------------------- /language/english.inc.php: -------------------------------------------------------------------------------- 1 | The reason probably is a database which is to large.
Enlarge the values of the PHP directives \"memory_limit\" and \"max_execution_time\" (see PHP manual)."); 71 | 72 | /*index.php*/ 73 | define('I_SQL_ERROR',"ERROR: Please insert your correct MySQL data in the 'configuration'!"); 74 | define('I_NAME',"This is phpMyBackupPro"); 75 | define('I_WELCOME',"phpMyBackupPro is free software licensed under the GNU GPL.
76 | For help try the online help or visit %s.

77 | Choose in the top menu what you want to do next! If this is your first time using phpMyBackupPro you should start with the configuration! 78 | The rights of the directory 'export' and the file 'global_conf.php' must be set to 0777."); 79 | define('I_CONF_ERROR',"The file ".PMBP_GLOBAL_CONF." is not writeable!"); 80 | define('I_DIR_ERROR',"The directory ".PMBP_EXPORT_DIR." is not writeable!"); 81 | define('PMBP_I_INFO',"System information"); 82 | define('PMBP_I_SERVER',"Server"); 83 | define('PMBP_I_TIME',"Time"); 84 | define('PMBP_I_PHP_VERS',"PHP Version"); 85 | define('PMBP_I_MEM_LIMIT',"PHP Memory Limit"); 86 | define('PMBP_I_FTP',"FTP transfer possible"); 87 | define('PMBP_I_MAIL',"Emails sendable"); 88 | define('PMBP_I_GZIP',"gzip compression possible"); 89 | define('PMBP_I_SQL_SERVER',"MySQL Server"); 90 | define('PMBP_I_SQL_CLIENT',"MySQL Client"); 91 | define('PMBP_I_NO_RES',"*Can not be retrieved*"); 92 | define('PMBP_I_LAST_SCHEDULED',"Last scheduled backup"); 93 | define('PMBP_I_LAST_LOGIN',"Last login"); 94 | define('PMBP_I_LAST_LOGIN_ERROR',"Last incorrect login"); 95 | 96 | /*config.php*/ 97 | define('C_SITENAME',"site name"); 98 | define('C_LANG',"language"); 99 | define('C_SQL_HOST',"MySQL hostname"); 100 | define('C_SQL_USER',"MySQL username"); 101 | define('C_SQL_PASSWD',"MySQL password"); 102 | define('C_SQL_DB',"only this database"); 103 | define('C_FTP_USE',"save backups via FTP?"); 104 | define('C_FTP_BACKUP',"use directory backup?"); 105 | define('C_FTP_REC',"backup directories recursively?"); 106 | define('C_FTP_SERVER',"FTP server (url or IP)"); 107 | define('C_FTP_USER',"FTP username"); 108 | define('C_FTP_PASSWD',"FTP password"); 109 | define('C_FTP_PATH',"FTP path"); 110 | define('C_FTP_PASV',"use passive ftp?"); 111 | define('C_FTP_PORT',"FTP port"); 112 | define('C_FTP_DEL',"delete files on FTP server"); 113 | define('C_EMAIL_USE',"use email?"); 114 | define('C_EMAIL',"email address"); 115 | define('C_STYLESHEET',"skin"); 116 | define('C_DATE',"date style"); 117 | define('C_DEL_TIME',"delete local backups after x days"); 118 | define('C_DEL_NUMBER',"store max x files per database"); 119 | define('C_TIMELIMIT',"php timelimit"); 120 | define('C_IMPORT_ERROR',"show import errors?"); 121 | define('C_NO_LOGIN',"disable login function?"); 122 | define('C_LOGIN',"HTTP authentication?"); 123 | define('C_DIR_BACKUP',"enable directory backups?"); 124 | define('C_DIR_REC',"directory backup with subdirectories?"); 125 | define('C_CONFIRM',"confirmation level"); 126 | define('C_CONFIRM_1',"empty, delete, import"); 127 | define('C_CONFIRM_2',"... all"); 128 | define('C_CONFIRM_3',"... ALL"); 129 | define('C_CONFIRM_4',"don't confirm anything"); 130 | 131 | define('C_BASIC_VAL',"Basic configuration"); 132 | define('C_EXT_VAL',"Extended configuration"); 133 | define('PMBP_C_SYSTEM_VAL',"System variables"); 134 | define('PMBP_C_SYS_WARNING',"These system variables are managed by phpMyBackupPro. Don't edit them unless you know what you are doing!"); 135 | define('C_TITLE_SQL',"SQL data"); 136 | define('C_TITLE_FTP',"FTP settings"); 137 | define('C_TITLE_EMAIL',"Backup by email"); 138 | define('C_TITLE_STYLE',"Style of phpMyBackupPro"); 139 | define('C_TITLE_DELETE',"Automatic deletion of backup files"); 140 | define('C_TITLE_CONFIG',"Further configuration items"); 141 | define('C_WRONG_TYPE',"is not correct!"); 142 | define('C_WRONG_SQL',"MySQL data is not correct!"); 143 | define('C_WRONG_DB',"MySQL database name is not correct!"); 144 | define('C_WRONG_FTP',"FTP data is not correct!"); 145 | define('C_OPEN',"Can't open"); 146 | define('C_WRITE',"Can't write to"); 147 | define('C_SAVED',"Data successfully saved"); 148 | define('C_WRITEABLE',"is not writeable"); 149 | define('C_SAVE',"Save data"); 150 | 151 | /*import.php*/ 152 | define('IM_ERROR',"%d error(s) occured. You can use 'empty database' to be sure the database does not contain any tables."); 153 | define('IM_SUCCESS',"Successfully imported"); 154 | define('IM_TABLES',"tables and"); 155 | define('IM_ROWS',"rows"); 156 | 157 | define('B_EMPTIED_ALL',"All databases were succesfully emptied"); 158 | define('B_EMPTIED',"The database was succesfully emptied"); 159 | define('B_DELETED',"The file was succesfully deleted"); 160 | define('B_DELETED_ALL',"All files were succesfully deleted"); 161 | define('B_NO_FILES',"There are currently no backup files"); 162 | define('B_DELETE_ALL_2',"delete ALL backups"); 163 | define('B_IMPORT_ALL',"import ALL backups"); 164 | define('B_EMPTY_ALL',"empty ALL databases"); 165 | define('B_EMPTY_DB',"empty database"); 166 | define('B_DELETE_ALL',"delete all backups"); 167 | define('B_INFO',"info"); 168 | define('B_VIEW',"view"); 169 | define('B_DOWNLOAD',"download"); 170 | define('B_IMPORT',"import"); 171 | define('B_IMPORT_FRAG',"fragmented"); 172 | define('B_DELETE',"delete"); 173 | define('B_CONF_EMPTY_DB',"Do you really want to empty the database?"); 174 | define('B_CONF_DEL_ALL',"Do you really want to delete all backups of this database?"); 175 | define('B_CONF_IMP',"Do you really want to import this backup?"); 176 | define('B_CONF_DEL',"Do you really want to delete this backup?"); 177 | define('B_CONF_EMPT_ALL',"Do you really want to empty ALL databases?"); 178 | define('B_CONF_IMP_ALL',"Do you really want to import ALL last backups?"); 179 | define('B_CONF_DEL_ALL_2',"Do you really want to delete ALL backups?"); 180 | define('B_LAST_BACKUP',"Last backup built on"); 181 | define('B_SIZE_SUM',"Total size of all backups"); 182 | 183 | /*backup.php*/ 184 | define('EX_SAVED',"File successfully saved as"); 185 | define('EX_NO_DB',"No database selected"); 186 | define('EX_EXPORT',"Backup"); 187 | define('EX_NOT_SAVED',"Could not save backup of database %s in '%s'"); 188 | define('EX_DIRS',"Select directories to backup to FTP server"); 189 | define('EX_DIRS_MAN',"Enter more directory paths relative to the phpMyBackupPro directory.
Separate with '|'"); 190 | define('EX_PACKED',"Pack all in one ZIP file"); 191 | define('PMBP_EX_NO_AVAILABLE',"Database %s is not available"); 192 | define('PMBP_EXS_UPDATE_DIRS',"Update directory list"); 193 | define('PMBP_EX_NO_ARGV',"Usage example:\n$ php backup.php db1,db2,db3\nFor more functions please read 'SHELL_MODE.txt' in the 'documentation' directory"); 194 | 195 | /*scheduled.php*/ 196 | define('EXS_PERIOD',"Select backup period"); 197 | define('EXS_PATH',"Select directory where the PHP file will be placed"); 198 | define('EXS_BACK',"back"); 199 | define('PMBP_EXS_ALWAYS',"At each call"); 200 | define('EXS_HOUR',"hour"); 201 | define('EXS_HOURS',"hours"); 202 | define('EXS_DAY',"day"); 203 | define('EXS_DAYS',"days"); 204 | define('EXS_WEEK',"week"); 205 | define('EXS_WEEKS',"weeks"); 206 | define('EXS_MONTH',"month"); 207 | define('EXS_SHOW',"Show script"); 208 | define('PMBP_EXS_INCL',"Include this script in the PHP file (%s) you want to do the backup job"); 209 | define('PMBP_EXS_SAVE',"or save this script to a new file (will overwrite an existing file!)"); 210 | 211 | /*file_info.php*/ 212 | define('INF_INFO',"info"); 213 | define('INF_DATE',"Date"); 214 | define('INF_DB',"Database"); 215 | define('INF_SIZE',"Backup size"); 216 | define('INF_COMP',"Is compressed"); 217 | define('INF_DROP',"Contains 'drop table'"); 218 | define('INF_TABLES',"Contains tables"); 219 | define('INF_DATA',"Contains data"); 220 | define('INF_COMMENT',"Comments"); 221 | define('INF_NO_FILE',"No file selected"); 222 | 223 | /*db_status.php*/ 224 | define('DB_NAME',"name of database"); 225 | define('DB_NUM_TABLES',"number of tables"); 226 | define('DB_NUM_ROWS',"number of rows"); 227 | define('DB_SIZE',"size"); 228 | define('DB_DIFF',"Sizes can differ from sizes of backup files!"); 229 | define('DB_NO_DB',"No databases available"); 230 | define('DB_TABLES',"tables info"); 231 | define('DB_TAB_TITLE',"tables of database "); 232 | define('DB_TAB_NAME',"name of table"); 233 | define('DB_TAB_COLS',"number of fields"); 234 | 235 | /*sql_query.php*/ 236 | define('SQ_ERROR',"Errors occured in line number"); 237 | define('SQ_SUCCESS',"Successfully executed"); 238 | define('SQ_RESULT',"Query result"); 239 | define('SQ_AFFECTED',"Number of affected rows"); 240 | define('SQ_WARNING',"Attention: This page is only built to send simple sql queries to the databases. Being careless can destroy your databases!"); 241 | define('SQ_SELECT_DB',"Select database"); 242 | define('SQ_INSERT',"Insert your sql query here"); 243 | define('SQ_FILE',"Upload sql file"); 244 | define('SQ_SEND',"Run"); 245 | 246 | /*login.php*/ 247 | define('LI_MSG',"Please login (use your MySQL username and password)"); 248 | define('LI_USER',"username"); 249 | define('LI_PASSWD',"password"); 250 | define('LI_LOGIN',"Login"); 251 | define('LI_LOGED_OUT',"Logged out!"); 252 | define('LI_NOT_LOGED_OUT',"Not securely logged out!
To securely logout enter a WRONG password"); 253 | 254 | /*big_import.php*/ 255 | define('BI_IMPORTING_FILE',"Importing file"); 256 | define('BI_INTO_DB',"Into database"); 257 | define('BI_SESSION_NO',"Session number"); 258 | define('BI_STARTING_LINE',"Starting at line"); 259 | define('BI_STOPPING_LINE',"Stopping at line"); 260 | define('BI_QUERY_NO',"Number of queries performed"); 261 | define('BI_BYTE_NO',"Number of bytes processed yet"); 262 | define('BI_DURATION',"Duration of last session"); 263 | define('BI_THIS_LAST',"this session/total"); 264 | define('BI_END',"End of file reached, import seems to be OK"); 265 | define('BI_RESTART',"Restart import of file "); 266 | define('BI_SCRIPT_RUNNING',"This script is still running!
Please wait until the end of the file is reached"); 267 | define('BI_CONTINUE',"Continue from the line"); 268 | define('BI_ENABLE_JS',"Enable JavaScript to continue automatically"); 269 | define('BI_BROKEN_ZIP',"The ZIP file seems to be broken"); 270 | define('BI_WRONG_FILE',"Stopped at line %s.
The current query includes more than %s dump lines. That happens if your backup file was created 271 | by some tool which didn't place a semicolon followed by a linebreak at the end of each query, or if your backup file contains extended inserts."); 272 | 273 | /*get_file.php*/ 274 | define("GF_INVALID_EXT","It is only possible to view files with one of these extensions: .php, .php3, .html, .htm, .sql, .sql.zip, .sql.gz. It is not possible to view phpMyBackupPro config files"); 275 | 276 | ?> 277 | -------------------------------------------------------------------------------- /language/czech.inc.php: -------------------------------------------------------------------------------- 1 | OUBRECHT.com"); 42 | define('F_NOW_AVAILABLE',"A new version of phpMyBackupPro is now available on %s".PMBP_WEBSITE."%s"); 43 | define('F_SELECT_DB',"Vybrat databáze pro zálohu"); 44 | define('F_SELECT_ALL',"vybrat vše"); 45 | define('F_COMMENTS',"Komentáře"); 46 | define('F_EX_TABLES',"exportovat tabulky"); 47 | define('F_EX_DATA',"exportovat data"); 48 | define('F_EX_DROP',"přidat 'drop table'"); 49 | define('F_EX_COMP',"komprese"); 50 | define('F_EX_OFF',"žádná"); 51 | define('F_EX_GZIP',"gzip"); 52 | define('F_EX_ZIP',"zip"); 53 | define('F_DEL_FAILED',"Chyba při mazání záloh %s"); 54 | define('F_FTP_1',"Chyba FTP připojení k serveru"); 55 | define('F_FTP_2',"Failed to login with user"); 56 | define('F_FTP_3',"FTP upload failed"); 57 | define('F_FTP_4',"File succesfully uploaded as"); 58 | define('F_FTP_5',"FTP delete of file '%s' failed"); 59 | define('F_FTP_6',"File '%s' succesfully deleted on FTP server"); 60 | define('F_FTP_7',"File '%s' not available on FTP server"); 61 | define('F_MAIL_1',"One receivers email is wrong"); 62 | define('F_MAIL_2',"This mail was sent by phpMyBackupPro ".PMBP_VERSION." ".PMBP_WEBSITE." running on"); 63 | define('F_MAIL_3',"coudn't be read"); 64 | define('F_MAIL_4',"MySQL záloha z"); 65 | define('F_MAIL_5',"Mail coudn't be sent"); 66 | define('F_MAIL_6',"Files succesfully sent by email to"); 67 | define('F_YES',"ano"); 68 | define('F_NO',"ne"); 69 | define('F_DURATION',"Trvání"); 70 | define('F_SECONDS',"vteřin"); 71 | define('F_TIMEOUT',"Function timed out!
The reason probably is a database which is to large.
Enlarge the values of the PHP directives \"memory_limit\" and \"max_execution_time\" (see PHP manual)."); 72 | 73 | /*index.php*/ 74 | define('I_SQL_ERROR',"CHYBA: Prosím vložte správné údaje pro MySQL v 'nastavení'!"); 75 | define('I_NAME',"Toto je phpMyBackupPro"); 76 | define('I_WELCOME',"phpMyBackupPro je svobodný software licencovaný pod GNU GPL.
77 | Pro nápovědu zkuste online pomoc nebo navštivte %s.

78 | Vyberte si v horním menu co chcete udělat dál! Pokud je to vaše první použití phpMyBackupPro měli byste začít v 'nastavení'! 79 | Práva adresáře 'export' a soubor 'global_conf.php' musí být nastaveny na 0777.
"); 80 | define('I_CONF_ERROR',"Do souboru ".PMBP_GLOBAL_CONF." nelze zapisovat!"); 81 | define('I_DIR_ERROR',"Do umístění ".PMBP_EXPORT_DIR." nelze zapisovat!"); 82 | define('PMBP_I_INFO',"Systémové informace"); 83 | define('PMBP_I_SERVER',"Server"); 84 | define('PMBP_I_TIME',"Čas"); 85 | define('PMBP_I_PHP_VERS',"PHP verze"); 86 | define('PMBP_I_MEM_LIMIT',"PHP limit paměti"); 87 | define('PMBP_I_FTP',"Možnost FTP přenosu"); 88 | define('PMBP_I_MAIL',"Možnost e-mailů"); 89 | define('PMBP_I_GZIP',"Možnost gzip"); 90 | define('PMBP_I_SQL_SERVER',"MySQL server"); 91 | define('PMBP_I_SQL_CLIENT',"MySQL klient"); 92 | define('PMBP_I_NO_RES',"*Nelze načíst*"); 93 | define('PMBP_I_LAST_SCHEDULED',"Poslední plánovaná záloha"); 94 | define('PMBP_I_LAST_LOGIN',"Poslední přihlášení"); 95 | define('PMBP_I_LAST_LOGIN_ERROR',"Poslední špatné přihlášení"); 96 | 97 | /*config.php*/ 98 | define('C_SITENAME',"název stránek"); 99 | define('C_LANG',"jazyk"); 100 | define('C_SQL_HOST',"MySQL adresa"); 101 | define('C_SQL_USER',"MySQL jméno"); 102 | define('C_SQL_PASSWD',"MySQL heslo"); 103 | define('C_SQL_DB',"pouze tato databáze"); 104 | define('C_FTP_USE',"uložit zálohy na FTP?"); 105 | define('C_FTP_BACKUP',"použít záložní adresář?"); 106 | define('C_FTP_REC',"záložní adresáře rekurzivně?"); 107 | define('C_FTP_SERVER',"FTP server (adresa nebo IP)"); 108 | define('C_FTP_USER',"FTP jméno"); 109 | define('C_FTP_PASSWD',"FTP heslo"); 110 | define('C_FTP_PATH',"FTP cesta"); 111 | define('C_FTP_PASV',"použít pasivní ftp?"); 112 | define('C_FTP_PORT',"FTP port"); 113 | define('C_FTP_DEL',"smazat soubory na FTP serveru"); 114 | define('C_EMAIL_USE',"použít email?"); 115 | define('C_EMAIL',"emailová adresa"); 116 | define('C_STYLESHEET',"vzhled"); 117 | define('C_DATE',"formát data"); 118 | define('C_DEL_TIME',"odstranit místní zálohy po X dnech"); 119 | define('C_DEL_NUMBER',"uchovat max X souborů na databázi"); 120 | define('C_TIMELIMIT',"php časový limit"); 121 | define('C_IMPORT_ERROR',"Zobrazit chyby importu?"); 122 | define('C_NO_LOGIN',"Zakázat přihlašování?"); 123 | define('C_LOGIN',"HTTP ověřování?"); 124 | define('C_DIR_BACKUP',"Povolit složku záloh?"); 125 | define('C_DIR_REC',"zálohovací složka s podsložkami?"); 126 | define('C_CONFIRM',"potvrzovací režim"); 127 | define('C_CONFIRM_1',"prázdné, odstranit, importovat"); 128 | define('C_CONFIRM_2',"... vše"); 129 | define('C_CONFIRM_3',"... VŠE"); 130 | define('C_CONFIRM_4',"nic nepotvrzovat"); 131 | 132 | define('C_BASIC_VAL',"Jednoduché nastavení"); 133 | define('C_EXT_VAL',"Pokročilé nastavení"); 134 | define('PMBP_C_SYSTEM_VAL',"Systémové proměnné"); 135 | define('PMBP_C_SYS_WARNING',"Tyto systémové proměnné jsou spravovány phpMyBackupPro. Neupravovat, pokud nevíte co děláte!"); 136 | define('C_TITLE_SQL',"SQL data"); 137 | define('C_TITLE_FTP',"FTP nastavení"); 138 | define('C_TITLE_EMAIL',"Zálohování prostřednictvím e-mailu"); 139 | define('C_TITLE_STYLE',"Vzhled phpMyBackupPro"); 140 | define('C_TITLE_DELETE',"Automatické odstranění záložních souborů"); 141 | define('C_TITLE_CONFIG',"Další položky konfigurace"); 142 | define('C_WRONG_TYPE',"není správné!"); 143 | define('C_WRONG_SQL',"MySQL data nenjsou správná!"); 144 | define('C_WRONG_DB',"Název MySQL databáze není správný!"); 145 | define('C_WRONG_FTP',"FTP data nejsou správná!"); 146 | define('C_OPEN',"Nelze otevřít"); 147 | define('C_WRITE',"Nelze zapisovat do"); 148 | define('C_SAVED',"Data úspěšně uložena"); 149 | define('C_WRITEABLE',"není zapisovatelný"); 150 | define('C_SAVE',"Uložit nastavení"); 151 | 152 | /*import.php*/ 153 | define('IM_ERROR',"%d chyba(y). Můžete použít 'vyprázdnit databázi' aby jste se ujistili, že databáze neobsahuje žádná data."); 154 | define('IM_SUCCESS',"Úspěšně importováno"); 155 | define('IM_TABLES',"tabulky a"); 156 | define('IM_ROWS',"řádky"); 157 | 158 | define('B_EMPTIED_ALL',"Všechny databáze byly úspěšně vyprázdněny"); 159 | define('B_EMPTIED',"Databáze byla úspěšně vyprázdněna"); 160 | define('B_DELETED',"Soubor byl úspěšně odstraněn"); 161 | define('B_DELETED_ALL',"Všechny soubory byly úspěšně odstraněny"); 162 | define('B_NO_FILES',"V současné době neexistují žádné záložní soubory"); 163 | define('B_DELETE_ALL_2',"vymazat všechny zálohy"); 164 | define('B_IMPORT_ALL',"importovat všechny zálohy"); 165 | define('B_EMPTY_ALL',"vaprázdnit všechny databáze"); 166 | define('B_EMPTY_DB',"vyprázdnit databázi"); 167 | define('B_DELETE_ALL',"vymazat všechny zálohy"); 168 | define('B_INFO',"info"); 169 | define('B_VIEW',"zobrazit"); 170 | define('B_DOWNLOAD',"stáhnout"); 171 | define('B_IMPORT',"importovat"); 172 | define('B_IMPORT_FRAG',"fragmentovat"); 173 | define('B_DELETE',"smazat"); 174 | define('B_CONF_EMPTY_DB',"Opravdu chcete vyprázdnit databázi?"); 175 | define('B_CONF_DEL_ALL',"Opravdu chcete odstranit všechny zálohy této databáze?"); 176 | define('B_CONF_IMP',"Opravdu chcete importovat tuto zálohu?"); 177 | define('B_CONF_DEL',"Opravdu chcete odstranit tuto zálohu?"); 178 | define('B_CONF_EMPT_ALL',"Opravdu chcete vyprázdnit všechny databáze?"); 179 | define('B_CONF_IMP_ALL',"Opravdu chcete importovat všechny poslední zálohy?"); 180 | define('B_CONF_DEL_ALL_2',"Opravdu chcete odstranit všechny zálohy?"); 181 | define('B_LAST_BACKUP',"Poslední záloha"); 182 | define('B_SIZE_SUM',"Celková velikost všech záloh"); 183 | 184 | /*backup.php*/ 185 | define('EX_SAVED',"Soubor byl úspěšně uložen jako"); 186 | define('EX_NO_DB',"Žádné vybrané databáze"); 187 | define('EX_EXPORT',"Zálohovat"); 188 | define('EX_NOT_SAVED',"Nelze uložit zálohu databáze %s do '%s'"); 189 | define('EX_DIRS',"Vyberte adresáře pro zálohování na FTP server"); 190 | define('EX_DIRS_MAN',"Enter more directory paths relative to the phpMyBackupPro directory.
Separate with '|'"); 191 | define('EX_PACKED',"Zabalit vše v jednom ZIP souboru"); 192 | define('PMBP_EX_NO_AVAILABLE',"Databáze %s není dostupná"); 193 | define('PMBP_EXS_UPDATE_DIRS',"Aktualizovat seznam"); 194 | define('PMBP_EX_NO_ARGV',"Příklad použití:\n$ php backup.php db1,db2,db3\nPro více informací si přečtěte 'SHELL_MODE.txt'."); 195 | 196 | /*scheduled.php*/ 197 | define('EXS_PERIOD',"Vybrat periodu záloh"); 198 | define('EXS_PATH',"Vyberte adresář, kam bude umístěn PHP soubor (pro CRONa"); 199 | define('EXS_BACK',"zpět"); 200 | define('PMBP_EXS_ALWAYS',"Při zavolání"); 201 | define('EXS_HOUR',"hodina"); 202 | define('EXS_HOURS',"hodiny"); 203 | define('EXS_DAY',"den"); 204 | define('EXS_DAYS',"dny"); 205 | define('EXS_WEEK',"týden"); 206 | define('EXS_WEEKS',"týdnů"); 207 | define('EXS_MONTH',"měsíc"); 208 | define('EXS_SHOW',"Zobrazit script"); 209 | define('PMBP_EXS_INCL',"Zahrnout tento skript v PHP souboru (%s) kterým chcete provést úlohu zálohování."); 210 | define('PMBP_EXS_SAVE',"Neukládejte tento skript do nového souboru (přepište existující soubor)"); 211 | 212 | /*file_info.php*/ 213 | define('INF_INFO',"info"); 214 | define('INF_DATE',"Datum"); 215 | define('INF_DB',"Databáze"); 216 | define('INF_SIZE',"Velikost zálohy"); 217 | define('INF_COMP',"Komprese"); 218 | define('INF_DROP',"Obsahuje 'drop table'"); 219 | define('INF_TABLES',"Obsahuje tabulky"); 220 | define('INF_DATA',"Obsahujedata"); 221 | define('INF_COMMENT',"Komentáře"); 222 | define('INF_NO_FILE',"Nevybrán žádný soubor"); 223 | 224 | /*db_status.php*/ 225 | define('DB_NAME',"jméno databáze"); 226 | define('DB_NUM_TABLES',"počet tabulek"); 227 | define('DB_NUM_ROWS',"počet řádků"); 228 | define('DB_SIZE',"velikost"); 229 | define('DB_DIFF',"Sizes can differ from sizes of backup files!"); 230 | define('DB_NO_DB',"No databases available"); 231 | define('DB_TABLES',"Více info"); 232 | define('DB_TAB_TITLE',"tabulky databáze "); 233 | define('DB_TAB_NAME',"jména tabulek"); 234 | define('DB_TAB_COLS',"počet sloupců"); 235 | 236 | /*sql_query.php*/ 237 | define('SQ_ERROR',"Došlo k chybám v řádku číslo"); 238 | define('SQ_SUCCESS',"Úspěšně provedeno"); 239 | define('SQ_RESULT',"Výsledek dotazu"); 240 | define('SQ_AFFECTED',"Počet ovlivněných řádků"); 241 | define('SQ_WARNING',"Upozornění: Tato stránka je postavena pouze na posílání jednoduchých sql dotazů. Pozor na to, že můžete poškodit vaše data!"); 242 | define('SQ_SELECT_DB',"Vybrat databázi"); 243 | define('SQ_INSERT',"SQL dotaz vložte sem"); 244 | define('SQ_FILE',"Nahrát soubor sql"); 245 | define('SQ_SEND',"Spustit"); 246 | 247 | /*login.php*/ 248 | define('LI_MSG',"Prosím přihlašte se (použijte vaše MySQL jméno a heslo)"); 249 | define('LI_USER',"jméno"); 250 | define('LI_PASSWD',"heslo"); 251 | define('LI_LOGIN',"Přihlásit"); 252 | define('LI_LOGED_OUT',"Odhlášen!"); 253 | define('LI_NOT_LOGED_OUT',"Nepřihlášen!
Špatné jméno nebo heslo"); 254 | 255 | /*big_import.php*/ 256 | define('BI_IMPORTING_FILE',"Import souboru"); 257 | define('BI_INTO_DB',"Do databáze"); 258 | define('BI_SESSION_NO',"Číslo relace"); 259 | define('BI_STARTING_LINE',"Od řádku"); 260 | define('BI_STOPPING_LINE',"Do řádku"); 261 | define('BI_QUERY_NO',"Počet provedených dotazů"); 262 | define('BI_BYTE_NO',"Počet zpracovaných bajtů"); 263 | define('BI_DURATION',"Doba trvání posledního sezení"); 264 | define('BI_THIS_LAST',"Tato relace/celkem"); 265 | define('BI_END',"Konec souboru byl dosažen a vše se zdá být OK."); 266 | define('BI_RESTART',"Restart importu souboru "); 267 | define('BI_SCRIPT_RUNNING',"This script is still running!
Please wait until the end of the file is reached"); 268 | define('BI_CONTINUE',"Pokračujte od řádku"); 269 | define('BI_ENABLE_JS',"Povolit JavaScript pro automatické pokračování"); 270 | define('BI_BROKEN_ZIP',"Zip soubor je nejspíš poškozen"); 271 | define('BI_WRONG_FILE',"Stopped at line %s.
The current query includes more than %s dump lines. That happens if your backup file was created 272 | by some tool which didn't place a semicolon followed by a linebreak at the end of each query, or if your backup file contains extended inserts."); 273 | 274 | /*get_file.php*/ 275 | define("GF_INVALID_EXT","Jsou viditelné pouze soubory s jedním z následujících přípon: .php, .php3, .html, .htm, .sql, .sql.zip, .sql.gz"); 276 | 277 | ?> 278 | -------------------------------------------------------------------------------- /scheduled.php: -------------------------------------------------------------------------------- 1 | $value) { 148 | $value = str_replace("\"", "'", $value); 149 | if ($key != "period" && $key != "path" && $key != "db" && $key != "dirs" && $key != "filename" && $value != '') { 150 | $result .= "\$_POST['" . $key . "']=\"" . $value . "\";\n"; 151 | } 152 | 153 | } 154 | 155 | // print the current working database (but always only once) 156 | if (isset($_SESSION['wss']) && !isset($_POST['mysql_host'])) { 157 | $result .= "\$_POST['mysql_host']=\"" . $_SESSION['wss'] . "\";\n"; 158 | } 159 | 160 | // add include(backup.php) to do all the work 161 | $result .= "\$period=(3600*24)" . str_replace(array(';', '$', '+'), '', $_POST['period']) . ";\n"; 162 | $result .= "\$security_key=\"" . ($PMBP_SYS_VAR['security_key']) . "\";\n"; 163 | $result .= "// switch to the phpMyBackupPro " . PMBP_VERSION . " directory\n"; 164 | // $result .= "@chdir(\"" . $_SERVER['DOCUMENT_ROOT'] . "\");\n"; 165 | $result .= "@include(\"backup.php\");\n"; 166 | $result .= "// switch back to the directory containing this script\n"; 167 | $result .= "@chdir(\"" . $_POST['path'] . "\");\n"; 168 | $result .= "?>"; 169 | 170 | // show the generated php script 171 | printf(PMBP_EXS_INCL, $_POST['path'] . "???.php"); 172 | echo ":\n
\n

"; 173 | echo "
\n"; 174 | 175 | // list all post variables as hidden fields 176 | foreach ($_POST as $key => $value) { 177 | if ($key != "db" && $key != "dirs") { 178 | echo "\n"; 179 | } elseif (is_array($_POST[$key])) { 180 | foreach ($value as $dbname) { 181 | echo "\n"; 182 | } 183 | } 184 | 185 | } 186 | 187 | // save file including the backup script 188 | if (isset($_POST['filename'])) { 189 | if (PMBP_save_to_file($_POST['path'] . $_POST['filename'], "", $result, "w")) { 190 | echo PMBP_addOutput(EX_SAVED . " " . $_POST['path'] . $_POST['filename'], "green_left"); 191 | @chmod($_POST['path'] . $_POST['filename'], 0644); 192 | 193 | // save specific settings for scheduled backups 194 | if ($PMBP_SYS_VAR['EXS_scheduled_file'] != $_POST['filename']) { 195 | $PMBP_SYS_VAR['EXS_scheduled_file'] = $_POST['filename']; 196 | } 197 | 198 | } else { 199 | echo PMBP_addOutput(C_WRITE . " " . $_POST['path'] . $_POST['filename'], "red_left"); 200 | } 201 | } 202 | echo PMBP_EXS_SAVE . ":
\n"; 203 | echo $_POST['path'] . " "; 204 | echo ""; 205 | if ($PMBP_SYS_VAR['EXS_scheduled_file'] != "???.php") { 206 | echo " (" . PMBP_pop_up("get_file.php?view=" . $_POST['path'] . $PMBP_SYS_VAR['EXS_scheduled_file'], B_VIEW, "view") . ")"; 207 | } 208 | 209 | echo "
"; 210 | echo "\n <- " . EXS_BACK . "\n"; 211 | 212 | // update specific settings for scheduled backups 213 | if ($_POST['path'] != $PMBP_SYS_VAR['EXS_scheduled_dir'] or $_POST['period'] != $PMBP_SYS_VAR['EXS_period']) { 214 | $PMBP_SYS_VAR['EXS_scheduled_dir'] = $_POST['path']; 215 | $PMBP_SYS_VAR['EXS_period'] = $_POST['period']; 216 | } 217 | 218 | // save PMBP_SYS_VARS 219 | PMBP_save_export_settings(); 220 | 221 | // print instructions and export form 222 | } else { 223 | if (isset($selection_ok) && isset($_POST['period'])) { 224 | echo PMBP_addOutput(EX_NO_DB . "!", "red"); 225 | } 226 | 227 | echo "
\n
\n"; 228 | echo EXS_PERIOD . ":
\n"; 229 | echo "\n

"; 326 | 327 | // get content of these directories (I know, it's partly redundant - but I think this is necessary) 328 | if ($_SESSION['multi_user_mode']) { 329 | $search_path1 = $PMBP_MU_CONF['user_export_dir']; 330 | $search_path2 = $PMBP_MU_CONF['user_scheduled_dir']; 331 | } else { 332 | $search_path1 = substr($_SERVER['DOCUMENT_ROOT'], 0, strrpos($_SERVER['DOCUMENT_ROOT'], "/")); 333 | $search_path2 = substr($search_path1, 0, strrpos($search_path1, "/")); 334 | $search_path1 .= "/"; 335 | // $search_path1=$_SERVER['DOCUMENT_ROOT']."/"."../"; 336 | // $search_path2=$_SERVER['DOCUMENT_ROOT']."/"."../../"; 337 | } 338 | if ($PMBP_SYS_VAR['dir_lists'] >= 1) { 339 | $dirs1 = PMBP_get_dirs($search_path1); 340 | } 341 | if ($PMBP_SYS_VAR['dir_lists'] >= 2) { 342 | $dirs2 = PMBP_get_dirs($search_path2); 343 | } 344 | 345 | echo EXS_PATH . ": (" . PMBP_EXS_UPDATE_DIRS . ")
\n"; 346 | echo "\n

"; 368 | 369 | // include the export form (known from the export page) and submitt the file list 370 | if (isset($dirs1)) { 371 | PMBP_print_export_form($dirs1, true); 372 | } else { 373 | PMBP_print_export_form(false, true); 374 | } 375 | 376 | echo "\n\n
\n
"; 377 | } 378 | 379 | PMBP_print_footer(); 380 | --------------------------------------------------------------------------------