commit 9764c1b42416683bb7cf8d6eb2db722edd3675c6 Author: DSB Date: Fri Jun 10 22:58:43 2011 +0000 diff --git a/ReadMe/changes.txt b/ReadMe/changes.txt new file mode 100644 index 0000000..dfdfcc3 --- /dev/null +++ b/ReadMe/changes.txt @@ -0,0 +1,58 @@ +Optik: +- Das Layout von MySQLDumper wird nun komplett per CSS-Datei gesteuert. Man kann ihn so leicht an eigene Wünsche anpassen. +- Die Übergabe der Steuerparameter beim Selbstaufruf erfolgt nun nicht per GET sondern per POST. So müsste der Bug in manchen + Mozilla-Versionen umgangen werden und MSD sollte nun auch damit funktionieren. +- Tabellenauswahl beim manuellen Dump war noch nicht an die neue Optik angepasst -> erledigt +- neues und endgültiges Logo entwickelt und eingebaunde (Danke an René, der es entwickelt hat) + +Parser: +- Inlinekommentare werden jetzt erkannt +- USE-Befehle werden ignoriert. So kann ein Backup mit USE in eine beliebige Datenbank eingespielt werden. +- START, BEGIN, TRANSACTION, CREATE IF NOT EXISTS und weitere SQL-Befehle hinzugefügt +- Bisher kam es zu einer Endlosschleife wenn der Parser auf einen unbekannten Befehl stieß. + Nun wird eine Fehlermeldung ausgegeben und der Vorgang abgebrochen. +- Problem bei erweiterten Inserts behoben + +Verwaltung: +- Listen optisch verbessert (Summenzeile rechtsbündig, usw...) +- Dateien werden nun nach dem verschlüsselten Dateidatum im Namen sortiert und nicht mehr nach dem tatsächlichen Dateidatum +- maximale Dateigröße für Upload per Formular wird nun ermittelt und angezeigt +- Fehler bei der Auflistung von Multipartfiles behoben + +Multipart: +- Die Dateigröße der einzelnen Parts wird nun wesentlich genauer erkannt. + Bei sehr kleinen Dateigrößen kann es trotzdem passieren, dass die Datei größer wird, als angegeben. + Genrell gilt: je größer die Dateigröße gewählt wird, umso genauer werden die Dateien gesplittet. + +Crondump: +- Spaltennamen werden nun auch von Backticks umschlossen gespeichert + +Datenbankerkennung: +- Die Routine zur Datenbankerkennung wurde verbessert, so dass nur noch Datenbanken gelistet werden, bei denen man + tatsächlich Zugriffsrechte hat. Lange Listen mit Einträgen "Datenbank existiert nicht" sollten damit der + Vergangenheit angehören. + +Speed: +- Durch konsequentes Austauschen von Indexen des Formats $var["index"] durch $var['index'] und Austausch von echo "text" + durch echo 'text' wurde ein Performanceschub erreicht + +Restore: +- Duplicate entry-Fehler führen nicht mehr zum Abbruch des Wiederherstellungsvorgangs. + Es wird ein Hinweis in das ErrorLogfile geschrieben und Hinweise werden beim Restore gezählt. + Generell werden Hinweise nun im ErrorLog grün dargestellt und wirkliche Fehler in rot. +- automatisches on-the-fly Downgrade implementiert + Schlägt der Versuch eine Tabelle anzulegen fehl, so übersetzt MySQLDumper die Create-Anweisung in den 3.x-Syntax und versucht erneut + die Tabelle anzulegen. Damit kann man ein 4.x-Dump (egal woher es stammt) auf einem MySQL-Server älterer Version problemlos einspielen! + +Konfiguration: +- Browserauswahl entfernt (überflüssig, da MSD nun in allen Browsern funktionieren sollte) +- Link zur SQL-Befehlsliste als Spalte hinzugefügt, damit man von hier zur Befehlsliste gelangt +- Javascript Fehler bei Listenauswahl im FF beseitigt +- Query before und Query after Dump-Fehler bei magic_quotes=on gefixt + +SQL-Browser: +- einige Bugs behoben +- weitere Administrationsmöglichkeiten hinzugefügt + +Sonstiges: +- alle include-Pfade von '../ordner/' auf './../ordner' geändert. Nun sollte MySQLDumper auch problemlos auf ILS-Servern laufen. diff --git a/ReadMe/install_deutsch.txt b/ReadMe/install_deutsch.txt new file mode 100644 index 0000000..9abcdcb --- /dev/null +++ b/ReadMe/install_deutsch.txt @@ -0,0 +1,63 @@ +Installation: + +- lade alle Dateien auf Deinen Webspace hoch +- gebe der Datei config.php die Rechte 777 +- Starte das Script im Browser (http://www.deineDomain.de/mysqldumper/) +- Folge der Installation +- in Schritt 2 (Konfiguration) ändere die Daten (Host, Name, Passwort) der zu verwaltenden Datenbanken + (alle anderen Einstellungen kannst Du später online verändern) + +- im Falle von safe_mode=1 müssen die Ordner manuell erstellt werden. + erzeuge im MySQLDumper-Verzeichnis die Ordner + + - work + - work/backup + - work/config + - work/structure + - work/log + + und gebe allen Ordnern die Rechte 777 + +- Fertig ! + + +Anleitung für das Perlskript: + +Die meisten haben ein cgi-bin Verzeichnis, in dem Perl ausgeführt werden kann. +Dies ist meist per Browser über http://www.domain.de/cgi-bin/ erreichbar. + +Für diesen Fall bitte folgende Schritte durchführen: + +1. Rufe im MySQLDumper die Seite Backup auf und klicke auf "Backup Perl". +2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht. +3. öffne die Datei "crondump.pl" im Editor +4. trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen) +5. Speicher crondump.pl +6. kopiere crondump.pl, sowie perltest.pl und simpletest.pl ins cgi-bin-Verzeichnis (Ascii-Modus im FTP) +7. gebe den Datein die Rechte 755 +7b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen) + +8. Rufe die Konfiguration im MySQLDumper auf +9. wähle Seite Cronscript +10. ändere Perl Ausführungspfad in /cgi-bin/ +10b. wenn die Scripte .pl haben, ändere die Dateiendung auf .cgi +11. speicher die Konfiuguration + +fertig, die Skripte lassen sich nun von der Backupseite aufrufen + +Wer Perl in allen Verzeichnissen ausführen kann, dem reichen folgende Schritte: + +1. Rufe im MySQLDumper die Seite Backup auf. +2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht. +3. öffne die Datei "crondump.pl" im Editor +4. trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen) +5. Speicher crondump.pl +6. gebe den Datein die Rechte 755 +6b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen) +(ev. 10b+11 von oben) + + +Windowsuser müssen bei allen Scripten die erste Zeile ändern, dort steht der Pfad von Perl. Beispiel: +statt: #!/usr/bin/perl -w +jetzt #!C:\perl\bin\perl.exe -w + diff --git a/ReadMe/install_english.txt b/ReadMe/install_english.txt new file mode 100644 index 0000000..4eef73b --- /dev/null +++ b/ReadMe/install_english.txt @@ -0,0 +1,65 @@ +Installation: + +- upload all files to your webspace +- make on file "config.php" chmod 777 +- start the script in your browser (http://www.deineDomain.de/mysqldumper/) +- Follow the Installationscript +- in step 2 (Configuration) change Data (Host, Name, Password) of your databaseconnection and save + (all other parameters you can change online) + +- in case of safe_mode=1 you must create the folders manually. + create following folders in the Scriptdir: + + - work + - work/backup + - work/config + - work/structure + - work/log + + and make chmod 777 on all folders + +- Ready ! + +Guidance for the Perl script: + +Most have a cgi-bin directory, in which Perl can be executed. +This is usually by Browser over http://www.domain.de/cgi-bin/ available. + +Make the following steps for this case please. + +1. Call in MySQLDumper the page Backup and click "Backup Perl". +2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir: +3. open the file "crondump.pl" in the editor +4. paste the copied path there with absolute_path_of_configdir (no blanks) +5. Save crondump.pl +6. copy crondump.pl, as well as perltest.pl and simpletest.pl to the cgi-bin directory (ASCII mode in the ftp-client!) +7. chmod 755 to the scripts. +7b. If the ending cgi is desired, change the ending of all 3 files pl - > cgi (rename) +8. Call in the MySQLDumper the page Configuration +9. click on Cronscript +10. changes Perl execution path to /cgi-bin/ +10b. if the Scripts are renamed to *.cgi , change Fileextension to cgi +11 save the Configuration + +Ready ! The scripts are available from the Page "Backup" + +When you can execute Perl anywhere, only following step are needed: + +1. Call in MySQLDumper the page Backup. +2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir: +3. open the file "crondump.pl" in the editor +4. paste the copied path there with absolute_path_of_configdir (no blanks) +5. Save crondump.pl + +6. chmod 755 to the scripts. +6b. If the ending cgi is desired, change the ending of all 3 files pl - > cgi (rename) +(ev. 10b+11 from above) + + +Windowsuser must change the first line of all Perlscripts, to the path of Perl. + +Example: + +instead of: #!/usr/bin/perl w +now #!C:\perl\bin\perl.exe w + diff --git a/ReadMe/license_deutsch.txt b/ReadMe/license_deutsch.txt new file mode 100644 index 0000000..64ff14f --- /dev/null +++ b/ReadMe/license_deutsch.txt @@ -0,0 +1,105 @@ +GNU General Public License +Deutsche Übersetzung der Version 2, Juni 1991 + +Copyright © 1989, 1991 Free Software Foundation, Inc. + +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + + +Diese Übersetzung ist kein rechtskräftiger Ersatz für die englischsprachige Originalversion! + + +Vorwort +Die meisten Softwarelizenzen sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die Software weiterzugeben und zu verändern. Im Gegensatz dazu soll Ihnen die GNU General Public License , die Allgemeine Öffentliche GNU-Lizenz, ebendiese Freiheit garantieren. Sie soll sicherstellen, daß die Software für alle Benutzer frei ist. Diese Lizenz gilt für den Großteil der von der Free Software Foundation herausgegebenen Software und für alle anderen Programme, deren Autoren ihr Datenwerk dieser Lizenz unterstellt haben. Auch Sie können diese Möglichkeit der Lizenzierung für Ihre Programme anwenden. (Ein anderer Teil der Software der Free Software Foundation unterliegt stattdessen der GNU Library General Public License , der Allgemeinen Öffentlichen GNU-Lizenz für Bibliotheken.) [Mittlerweile wurde die GNU Library Public License von der GNU Lesser Public License abgelöst - Anmerkung des Übersetzers.] + +Die Bezeichnung ,,freie`` Software bezieht sich auf Freiheit, nicht auf den Preis. Unsere Lizenzen sollen Ihnen die Freiheit garantieren, Kopien freier Software zu verbreiten (und etwas für diesen Service zu berechnen, wenn Sie möchten), die Möglichkeit, die Software im Quelltext zu erhalten oder den Quelltext auf Wunsch zu bekommen. Die Lizenzen sollen garantieren, daß Sie die Software ändern oder Teile davon in neuen freien Programmen verwenden dürfen - und daß Sie wissen, daß Sie dies alles tun dürfen. + +Um Ihre Rechte zu schützen, müssen wir Einschränkungen machen, die es jedem verbieten, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf diese Rechte zu verzichten. Aus diesen Einschränkungen folgen bestimmte Verantwortlichkeiten für Sie, wenn Sie Kopien der Software verbreiten oder sie verändern. + +Beispielsweise müssen Sie den Empfängern alle Rechte gewähren, die Sie selbst haben, wenn Sie - kostenlos oder gegen Bezahlung - Kopien eines solchen Programms verbreiten. Sie müssen sicherstellen, daß auch die Empfänger den Quelltext erhalten bzw. erhalten können. Und Sie müssen ihnen diese Bedingungen zeigen, damit sie ihre Rechte kennen. + +Wir schützen Ihre Rechte in zwei Schritten: (1) Wir stellen die Software unter ein Urheberrecht (Copyright), und (2) wir bieten Ihnen diese Lizenz an, die Ihnen das Recht gibt, die Software zu vervielfältigen, zu verbreiten und/oder zu verändern. + +Um die Autoren und uns zu schützen, wollen wir darüberhinaus sicherstellen, daß jeder erfährt, daß für diese freie Software keinerlei Garantie besteht. Wenn die Software von jemand anderem modifiziert und weitergegeben wird, möchten wir, daß die Empfänger wissen, daß sie nicht das Original erhalten haben, damit irgendwelche von anderen verursachte Probleme nicht den Ruf des ursprünglichen Autors schädigen. + +Schließlich und endlich ist jedes freie Programm permanent durch Software-Patente bedroht. Wir möchten die Gefahr ausschließen, daß Distributoren eines freien Programms individuell Patente lizensieren - mit dem Ergebnis, daß das Programm proprietär würde. Um dies zu verhindern, haben wir klargestellt, daß jedes Patent entweder für freie Benutzung durch jedermann lizenziert werden muß oder überhaupt nicht lizenziert werden darf. + +Es folgen die genauen Bedingungen für die Vervielfältigung, Verbreitung und Bearbeitung: + + +Allgemeine Öffentliche GNU-Lizenz +Bedingungen für die Vervielfältigung, +Verbreitung und Bearbeitung +§0. Diese Lizenz gilt für jedes Programm und jedes andere Datenwerk, in dem ein entsprechender Vermerk des Copyright-Inhabers darauf hinweist, daß das Datenwerk unter den Bestimmungen dieser General Public License verbreitet werden darf. Im folgenden wird jedes derartige Programm oder Datenwerk als ,,das Programm`` bezeichnet; die Formulierung ,,auf dem Programm basierendes Datenwerk`` bezeichnet das Programm sowie jegliche Bearbeitung des Programms im urheberrechtlichen Sinne, also ein Datenwerk, welches das Programm, auch auszugsweise, sei es unverändert oder verändert und/oder in eine andere Sprache übersetzt, enthält. (Im folgenden wird die Übersetzung ohne Einschränkung als ,,Bearbeitung`` eingestuft.) Jeder Lizenznehmer wird im folgenden als ,,Sie`` angesprochen. + +Andere Handlungen als Vervielfältigung, Verbreitung und Bearbeitung werden von dieser Lizenz nicht berührt; sie fallen nicht in ihren Anwendungsbereich. Der Vorgang der Ausführung des Programms wird nicht eingeschränkt, und die Ausgaben des Programms unterliegen dieser Lizenz nur, wenn der Inhalt ein auf dem Programm basierendes Datenwerk darstellt (unabhängig davon, daß die Ausgabe durch die Ausführung des Programmes erfolgte). Ob dies zutrifft, hängt von den Funktionen des Programms ab. + +§1. Sie dürfen auf beliebigen Medien unveränderte Kopien des Quelltextes des Programms, wie sie ihn erhalten haben, anfertigen und verbreiten. Voraussetzung hierfür ist, daß Sie mit jeder Kopie einen entsprechenden Copyright-Vermerk sowie einen Haftungsausschluß veröffentlichen, alle Vermerke, die sich auf diese Lizenz und das Fehlen einer Garantie beziehen, unverändert lassen und desweiteren allen anderen Empfängern des Programms zusammen mit dem Programm eine Kopie dieser Lizenz zukommen lassen. + +Sie dürfen für den eigentlichen Kopiervorgang eine Gebühr verlangen. Wenn Sie es wünschen, dürfen Sie auch gegen Entgeld eine Garantie für das Programm anbieten. + +§2. Sie dürfen Ihre Kopie(n) des Programms oder eines Teils davon verändern, wodurch ein auf dem Programm basierendes Datenwerk entsteht; Sie dürfen derartige Bearbeitungen unter den Bestimmungen von Paragraph 1 vervielfältigen und verbreiten, vorausgesetzt, daß zusätzlich alle im folgenden genannten Bedingungen erfüllt werden: + + +1. +Sie müssen die veränderten Dateien mit einem auffälligen Vermerk versehen, der auf die von Ihnen vorgenommene Modifizierung und das Datum jeder Änderung hinweist. + +2. +Sie müssen dafür sorgen, daß jede von Ihnen verbreitete oder veröffentlichte Arbeit, die ganz oder teilweise von dem Programm oder Teilen davon abgeleitet ist, Dritten gegenüber als Ganzes unter den Bedingungen dieser Lizenz ohne Lizenzgebühren zur Verfügung gestellt wird. + +3. +Wenn das veränderte Programm normalerweise bei der Ausführung interaktiv Kommandos einliest, müssen Sie dafür sorgen, daß es, wenn es auf dem üblichsten Wege für solche interaktive Nutzung gestartet wird, eine Meldung ausgibt oder ausdruckt, die einen geeigneten Copyright-Vermerk enthält sowie einen Hinweis, daß es keine Gewährleistung gibt (oder anderenfalls, daß Sie Garantie leisten), und daß die Benutzer das Programm unter diesen Bedingungen weiter verbreiten dürfen. Auch muß der Benutzer darauf hingewiesen werden, wie er eine Kopie dieser Lizenz ansehen kann. (Ausnahme: Wenn das Programm selbst interaktiv arbeitet, aber normalerweise keine derartige Meldung ausgibt, muß Ihr auf dem Programm basierendes Datenwerk auch keine solche Meldung ausgeben). + +Diese Anforderungen gelten für das bearbeitete Datenwerk als Ganzes. Wenn identifizierbare Teile des Datenwerkes nicht von dem Programm abgeleitet sind und vernünftigerweise als unabhängige und eigenständige Datenwerke für sich selbst zu betrachten sind, dann gelten diese Lizenz und ihre Bedingungen nicht für die betroffenen Teile, wenn Sie diese als eigenständige Datenwerke weitergeben. Wenn Sie jedoch dieselben Abschnitte als Teil eines Ganzen weitergeben, das ein auf dem Programm basierendes Datenwerk darstellt, dann muß die Weitergabe des Ganzen nach den Bedingungen dieser Lizenz erfolgen, deren Bedingungen für weitere Lizenznehmer somit auf das gesamte Ganze ausgedehnt werden - und somit auf jeden einzelnen Teil, unabhängig vom jeweiligen Autor. + +Somit ist es nicht die Absicht dieses Abschnittes, Rechte für Datenwerke in Anspruch zu nehmen oder Ihnen die Rechte für Datenwerke streitig zu machen, die komplett von Ihnen geschrieben wurden; vielmehr ist es die Absicht, die Rechte zur Kontrolle der Verbreitung von Datenwerken, die auf dem Programm basieren oder unter seiner auszugsweisen Verwendung zusammengestellt worden sind, auszuüben. + +Ferner bringt auch das einfache Zusammenlegen eines anderen Datenwerkes, das nicht auf dem Programm basiert, mit dem Programm oder einem auf dem Programm basierenden Datenwerk auf ein- und demselben Speicher- oder Vertriebsmedium dieses andere Datenwerk nicht in den Anwendungsbereich dieser Lizenz. + +§3. Sie dürfen das Programm (oder ein darauf basierendes Datenwerk gemäß Paragraph 2) als Objectcode oder in ausführbarer Form unter den Bedingungen der Paragraphen 1 und 2 kopieren und weitergeben - vorausgesetzt, daß Sie außerdem eine der folgenden Leistungen erbringen: + + +1. +Liefern Sie das Programm zusammen mit dem vollständigen zugehörigen maschinenlesbaren Quelltext auf einem für den Datenaustausch üblichen Medium aus, wobei die Verteilung unter den Bedingungen der Paragraphen 1 und 2 erfolgen muß. Oder: + +2. +Liefern Sie das Programm zusammen mit einem mindestens drei Jahre lang gültigen schriftlichen Angebot aus, jedem Dritten eine vollständige maschinenlesbare Kopie des Quelltextes zur Verfügung zu stellen - zu nicht höheren Kosten als denen, die durch den physikalischen Kopiervorgang anfallen -, wobei der Quelltext unter den Bedingungen der Paragraphen 1 und 2 auf einem für den Datenaustausch üblichen Medium weitergegeben wird. Oder: + +3. +Liefern Sie das Programm zusammen mit dem schriftlichen Angebot der Zurverfügungstellung des Quelltextes aus, das Sie selbst erhalten haben. (Diese Alternative ist nur für nicht-kommerzielle Verbreitung zulässig und nur, wenn Sie das Programm als Objectcode oder in ausführbarer Form mit einem entsprechenden Angebot gemäß Absatz b erhalten haben.) + +Unter dem Quelltext eines Datenwerkes wird diejenige Form des Datenwerkes verstanden, die für Bearbeitungen vorzugsweise verwendet wird. Für ein ausführbares Programm bedeutet ,,der komplette Quelltext``: Der Quelltext aller im Programm enthaltenen Module einschließlich aller zugehörigen Modulschnittstellen-Definitionsdateien sowie der zur Compilation und Installation verwendeten Skripte. Als besondere Ausnahme jedoch braucht der verteilte Quelltext nichts von dem zu enthalten, was üblicherweise (entweder als Quelltext oder in binärer Form) zusammen mit den Hauptkomponenten des Betriebssystems (Kernel, Compiler usw.) geliefert wird, unter dem das Programm läuft - es sei denn, diese Komponente selbst gehört zum ausführbaren Programm. + +Wenn die Verbreitung eines ausführbaren Programms oder von Objectcode dadurch erfolgt, daß der Kopierzugriff auf eine dafür vorgesehene Stelle gewährt wird, so gilt die Gewährung eines gleichwertigen Zugriffs auf den Quelltext als Verbreitung des Quelltextes, auch wenn Dritte nicht dazu gezwungen sind, den Quelltext zusammen mit dem Objectcode zu kopieren. + +§4. Sie dürfen das Programm nicht vervielfältigen, verändern, weiter lizenzieren oder verbreiten, sofern es nicht durch diese Lizenz ausdrücklich gestattet ist. Jeder anderweitige Versuch der Vervielfältigung, Modifizierung, Weiterlizenzierung und Verbreitung ist nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz. Jedoch werden die Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser Lizenz erhalten haben, nicht beendet, solange diese die Lizenz voll anerkennen und befolgen. + +§5. Sie sind nicht verpflichtet, diese Lizenz anzunehmen, da Sie sie nicht unterzeichnet haben. Jedoch gibt Ihnen nichts anderes die Erlaubnis, das Programm oder von ihm abgeleitete Datenwerke zu verändern oder zu verbreiten. Diese Handlungen sind gesetzlich verboten, wenn Sie diese Lizenz nicht anerkennen. Indem Sie das Programm (oder ein darauf basierendes Datenwerk) verändern oder verbreiten, erklären Sie Ihr Einverständnis mit dieser Lizenz und mit allen ihren Bedingungen bezüglich der Vervielfältigung, Verbreitung und Veränderung des Programms oder eines darauf basierenden Datenwerks. + +§6. Jedesmal, wenn Sie das Programm (oder ein auf dem Programm basierendes Datenwerk) weitergeben, erhält der Empfänger automatisch vom ursprünglichen Lizenzgeber die Lizenz, das Programm entsprechend den hier festgelegten Bestimmungen zu vervielfältigen, zu verbreiten und zu verändern. Sie dürfen keine weiteren Einschränkungen der Durchsetzung der hierin zugestandenen Rechte des Empfängers vornehmen. Sie sind nicht dafür verantwortlich, die Einhaltung dieser Lizenz durch Dritte durchzusetzen. + +§7. Sollten Ihnen infolge eines Gerichtsurteils, des Vorwurfs einer Patentverletzung oder aus einem anderen Grunde (nicht auf Patentfragen begrenzt) Bedingungen (durch Gerichtsbeschluß, Vergleich oder anderweitig) auferlegt werden, die den Bedingungen dieser Lizenz widersprechen, so befreien Sie diese Umstände nicht von den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht möglich ist, das Programm unter gleichzeitiger Beachtung der Bedingungen in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu verbreiten, dann dürfen Sie als Folge das Programm überhaupt nicht verbreiten. Wenn zum Beispiel ein Patent nicht die gebührenfreie Weiterverbreitung des Programms durch diejenigen erlaubt, die das Programm direkt oder indirekt von Ihnen erhalten haben, dann besteht der einzige Weg, sowohl das Patentrecht als auch diese Lizenz zu befolgen, darin, ganz auf die Verbreitung des Programms zu verzichten. + +Sollte sich ein Teil dieses Paragraphen als ungültig oder unter bestimmten Umständen nicht durchsetzbar erweisen, so soll dieser Paragraph seinem Sinne nach angewandt werden; im übrigen soll dieser Paragraph als Ganzes gelten. + +Zweck dieses Paragraphen ist nicht, Sie dazu zu bringen, irgendwelche Patente oder andere Eigentumsansprüche zu verletzen oder die Gültigkeit solcher Ansprüche zu bestreiten; dieser Paragraph hat einzig den Zweck, die Integrität des Verbreitungssystems der freien Software zu schützen, das durch die Praxis öffentlicher Lizenzen verwirklicht wird. Viele Leute haben großzügige Beiträge zu dem großen Angebot der mit diesem System verbreiteten Software im Vertrauen auf die konsistente Anwendung dieses Systems geleistet; es liegt am Autor/Geber, zu entscheiden, ob er die Software mittels irgendeines anderen Systems verbreiten will; ein Lizenznehmer hat auf diese Entscheidung keinen Einfluß. + +Dieser Paragraph ist dazu gedacht, deutlich klarzustellen, was als Konsequenz aus dem Rest dieser Lizenz betrachtet wird. + +§8. Wenn die Verbreitung und/oder die Benutzung des Programms in bestimmten Staaten entweder durch Patente oder durch urheberrechtlich geschützte Schnittstellen eingeschränkt ist, kann der Urheberrechtsinhaber, der das Programm unter diese Lizenz gestellt hat, eine explizite geographische Begrenzung der Verbreitung angeben, in der diese Staaten ausgeschlossen werden, so daß die Verbreitung nur innerhalb und zwischen den Staaten erlaubt ist, die nicht ausgeschlossen sind. In einem solchen Fall beinhaltet diese Lizenz die Beschränkung, als wäre sie in diesem Text niedergeschrieben. + +§9. Die Free Software Foundation kann von Zeit zu Zeit überarbeitete und/oder neue Versionen der General Public License veröffentlichen. Solche neuen Versionen werden vom Grundprinzip her der gegenwärtigen entsprechen, können aber im Detail abweichen, um neuen Problemen und Anforderungen gerecht zu werden. + +Jede Version dieser Lizenz hat eine eindeutige Versionsnummer. Wenn in einem Programm angegeben wird, daß es dieser Lizenz in einer bestimmten Versionsnummer oder ,,jeder späteren Version`` (``any later version'') unterliegt, so haben Sie die Wahl, entweder den Bestimmungen der genannten Version zu folgen oder denen jeder beliebigen späteren Version, die von der Free Software Foundation veröffentlicht wurde. Wenn das Programm keine Versionsnummer angibt, können Sie eine beliebige Version wählen, die je von der Free Software Foundation veröffentlicht wurde. + +§10. Wenn Sie den Wunsch haben, Teile des Programms in anderen freien Programmen zu verwenden, deren Bedingungen für die Verbreitung anders sind, schreiben Sie an den Autor, um ihn um die Erlaubnis zu bitten. Für Software, die unter dem Copyright der Free Software Foundation steht, schreiben Sie an die Free Software Foundation ; wir machen zu diesem Zweck gelegentlich Ausnahmen. Unsere Entscheidung wird von den beiden Zielen geleitet werden, zum einen den freien Status aller von unserer freien Software abgeleiteten Datenwerke zu erhalten und zum anderen das gemeinschaftliche Nutzen und Wiederverwenden von Software im allgemeinen zu fördern. + + +Keine Gewährleistung + +§11. Da das Programm ohne jegliche Kosten lizenziert wird, besteht keinerlei Gewährleistung für das Programm, soweit dies gesetzlich zulässig ist. Sofern nicht anderweitig schriftlich bestätigt, stellen die Copyright-Inhaber und/oder Dritte das Programm so zur Verfügung, ,,wie es ist``, ohne irgendeine Gewährleistung, weder ausdrücklich noch implizit, einschließlich - aber nicht begrenzt auf - Marktreife oder Verwendbarkeit für einen bestimmten Zweck. Das volle Risiko bezüglich Qualität und Leistungsfähigkeit des Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft herausstellen, liegen die Kosten für notwendigen Service, Reparatur oder Korrektur bei Ihnen. + +§12. In keinem Fall, außer wenn durch geltendes Recht gefordert oder schriftlich zugesichert, ist irgendein Copyright-Inhaber oder irgendein Dritter, der das Programm wie oben erlaubt modifiziert oder verbreitet hat, Ihnen gegenüber für irgendwelche Schäden haftbar, einschließlich jeglicher allgemeiner oder spezieller Schäden, Schäden durch Seiteneffekte (Nebenwirkungen) oder Folgeschäden, die aus der Benutzung des Programms oder der Unbenutzbarkeit des Programms folgen (einschließlich - aber nicht beschränkt auf - Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von Ihnen oder anderen getragen werden müssen, oder dem Unvermögen des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten), selbst wenn ein Copyright-Inhaber oder Dritter über die Möglichkeit solcher Schäden unterrichtet worden war. + + +Ende der Bedingungen diff --git a/ReadMe/license_english.txt b/ReadMe/license_english.txt new file mode 100644 index 0000000..13db015 --- /dev/null +++ b/ReadMe/license_english.txt @@ -0,0 +1,88 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +END OF TERMS AND CONDITIONS diff --git a/ReadMe/readme.txt b/ReadMe/readme.txt new file mode 100644 index 0000000..32114b6 --- /dev/null +++ b/ReadMe/readme.txt @@ -0,0 +1,15 @@ +MySqlDumper Copyright (C)2004 Daniel Schlichtholz (admin@daniel-schlichtholz.de) & Steffen Kamper + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 675 Mass +Ave, Cambridge, MA 02139, USA. diff --git a/mysqldumper/config.php b/mysqldumper/config.php new file mode 100644 index 0000000..c1dbeda --- /dev/null +++ b/mysqldumper/config.php @@ -0,0 +1,155 @@ +1000 +$config['processlist_refresh']=2000; + +//Disable all .htaccess-Functions with value 1 +$config['no_htaccess']=0; + +$config['empty_db_before_restore']=0; +$config['optimize_tables_beforedump']=0; +$config['stop_with_error']=1; + +// For sending a mail after backup set send_mail to 1, otherless set to 0 +$config['send_mail']=0; +// Attach the backup 0=no 1=yes +$config['send_mail_dump']=0; +// set the recieve adress for the mail +$config['email_recipient']=""; +// set the sender adress (the script) +$config['email_sender']=""; + +//max. Size of Email-Attach, here 3 MB +$config['email_maxsize1']=3; +$config['email_maxsize2']=2; + + +// For FTP-Transfer of Backupfiles set ftp_transfer to 1 +$config['ftp_transfer']=0; + +// FTP Server Configuration for Transfer +$config['ftp_connectionindex']=0; +$config['ftp_server'][0]=""; // Adress of FTP-Server +$config['ftp_port'][0]="21"; // Port +$config['ftp_user'][0]=""; // Username +$config['ftp_pass'][0]=""; // Password +$config['ftp_dir'][0]=""; // Upload-Directory + +$config['ftp_server'][1]=""; // Adress of FTP-Server +$config['ftp_port'][1]="21"; // Port +$config['ftp_user'][1]=""; // Username +$config['ftp_pass'][1]=""; // Password +$config['ftp_dir'][1]=""; // Upload-Directory + +$config['ftp_server'][2]=""; // Adress of FTP-Server +$config['ftp_port'][2]="21"; // Port +$config['ftp_user'][2]=""; // Username +$config['ftp_pass'][2]=""; // Password +$config['ftp_dir'][2]=""; // Upload-Directory + +$config['ftp_timeout']=30; +$config['ftp_useSSL']=0; + +//Multipart 0=off 1=on +$config['multi_part']=0; +$config['multipartgroesse1']=1; +$config['multipartgroesse2']=2; +$config['multipart_groesse']=0; + +//Auto-Delete 0=off 1=on +$config['auto_delete']=0; +$config['del_files_after_days']=0; +$config['max_backup_files']=3; +$config['max_backup_files_each']=0; + + +//configuration file +$config['cron_configurationfile']="mysqldumper.conf"; +//path to perl, for windows use e.g. C:perlbinperl.exe +$config['cron_perlpath']="/usr/bin/perl"; +//mailer use sendmail(1) or SMTP(0) +$config['cron_use_sendmail']=1; +//path to sendmail +$config['cron_sendmail']="/usr/lib/sendmail"; +//adress of smtp-server +$config['cron_smtp']="localhost"; +//smtp-port +$config['cron_smtp_port']=25; +$config['cron_samedb']=0; +$config['cron_timelimit']=360; +$config['cron_extender']=0; +$config['cron_mail']=0; +$config['cron_mail_dump']=0; +$config['cron_ftp']=0; +$config['cron_compression']=1; +$config['cron_printout']=1; +$config['cron_completelog']=1; +$config['multi_dump']=0; + +$config['logcompression'] = "0"; +$config['log_maxsize1'] = "1"; +$config['log_maxsize2'] = "2"; +$config['log_maxsize'] = "1048576"; + +?> + + + + + + diff --git a/mysqldumper/config_overview.php b/mysqldumper/config_overview.php new file mode 100644 index 0000000..a196254 --- /dev/null +++ b/mysqldumper/config_overview.php @@ -0,0 +1,681 @@ +1 && substr($config['ftp_dir'][$i],-1)!="/")) $config['ftp_dir'][$i].="/"; + } +} + +$oldtheme=$config['theme']; +$oldscposition=$config['interface_server_caption_position']; +$checkFTP=Array(" 

 
 "," 

 
 "," 

 
 "); +if(isset($_POST['testFTP0'])) { + $checkFTP[0]='
'.$lang['testconnection'].' FTP-Connection 1

'.TesteFTP($_POST['ftp_server0'],$_POST['ftp_port0'],$_POST['ftp_user0'],$_POST['ftp_pass0'],$_POST['ftp_dir0']).'
'; + $ftptested=0; +} +if(isset($_POST['testFTP1'])) { + $checkFTP[1]='
'.$lang['testconnection'].' FTP-Connection 2

'.TesteFTP($_POST['ftp_server1'],$_POST['ftp_port1'],$_POST['ftp_user1'],$_POST['ftp_pass1'],$_POST['ftp_dir1']).'
'; + $ftptested=1; +} +if(isset($_POST['testFTP2'])) { + $checkFTP[2]='
'.$lang['testconnection'].' FTP-Connection 3

'.TesteFTP($_POST['ftp_server2'],$_POST['ftp_port2'],$_POST['ftp_user2'],$_POST['ftp_pass2'],$_POST['ftp_dir2']).'
'; + $ftptested=2; +} + +if($ftptested>-1) { + $ftp_server[$ftptested]=$_POST['ftp_server'.$ftptested]; + $ftp_port[$ftptested]=$_POST['ftp_port'.$ftptested]; + $ftp_user[$ftptested]=$_POST['ftp_user'.$ftptested]; + $ftp_pass[$ftptested]=$_POST['ftp_pass'.$ftptested]; + $ftp_dir[$ftptested]=stripslashes($_POST['ftp_dir'.$ftptested]); + if($ftp_dir[$ftptested]=="" || (strlen($ftp_dir[$ftptested])>1 && substr($ftp_dir[$ftptested],-1)!="/")) $ftp_dir[$ftptested].="/"; +} + +if (isset($_POST['load'])) +{ + $msg=SetDefault(true); + $msg=nl2br($msg)."
". $lang['load_success']."
"; + echo ''; +} + +if (isset($_POST['save'])) +{ + //Parameter auslesen + + $config['multi_dump']=(isset($_POST['MultiDBDump'])) ? $_POST['MultiDBDump'] : 0; + $databases['db_actual_cronpraefix']=$_POST['dbcronpraefix']; + $config['compression']=$_POST['compression']; + $config['language']=$_POST['language']; + $config['interface_server_caption']=$_POST['server_caption']; + $config['interface_server_caption_position']=$_POST['server_caption_position']; + $config['interface_sqlboxsize']=$_POST['sqlboxsize']; + $config['theme']=$_POST['theme']; + $config['interface_table_compact']=(isset($_POST['interface_table_compact'])) ? $_POST['interface_table_compact'] : 1; + + $config['email_recipient']=$_POST['email0']; + $config['email_sender']=$_POST['email1']; + $config['send_mail']=$_POST['send_mail']; + $config['send_mail_dump']=$_POST['send_mail_dump']; + + $config['email_maxsize1']=$_POST['email_maxsize1']; if($config['email_maxsize1']=="") $config['email_maxsize1']=0; + $config['email_maxsize2']=$_POST['email_maxsize2']; + $config['email_maxsize']=$config['email_maxsize1']*(($config['email_maxsize2']==1) ? 1024 : 1024*1024); + + $config['backup_complete_inserts']=(isset($_POST['backup_complete_inserts'])) ? 1 : 0; + $config['backup_extended_inserts']=(isset($_POST['backup_extended_inserts'])) ? 1 : 0; + $config['backup_delayed_inserts']=(isset($_POST['backup_delayed_inserts'])) ? 1 : 0; + $config['backup_ignore_inserts']=(isset($_POST['backup_ignore_inserts'])) ? 1 : 0; + $config['backup_lock_tables']=(isset($_POST['backup_lock_tables'])) ? 1 : 0; + $config['backup_downgrade']=(isset($_POST['backup_downgrade'])) ? 1 : 0; + + $config['memory_limit']=$_POST['memory_limit']; if($config['memory_limit']=="") $config['memory_limit']=0; + $config['minspeed']=$_POST['minspeed']; if($config['minspeed']<50) $config['minspeed']=50; + $config['maxspeed']=$_POST['maxspeed']; + $config['stop_with_error']=$_POST['stop_with_error']; + + $config['multi_part']=$_POST['multi_part']; + $config['multipartgroesse1']=$_POST['multipartgroesse1']; + $config['multipartgroesse2']=$_POST['multipartgroesse2']; + if($config['multipartgroesse1']<100 && $config['multipartgroesse2']==1)$config['multipartgroesse1']=100; + + $oldlogcompression=$config['logcompression']; + $config['logcompression']=(isset($_POST['logcompression']) && $_POST['logcompression']==1) ? 1 : 0; + $config['log_maxsize1']=$_POST['log_maxsize1']; if($config['log_maxsize1']=="") $config['log_maxsize1']=0; + $config['log_maxsize2']=$_POST['log_maxsize2']; + $config['log_maxsize']=$config['log_maxsize1']*(($config['log_maxsize2']==1) ? 1024 : 1024*1024); + + $config['auto_delete']=$_POST['auto_delete']; + $config['del_files_after_days']=$_POST['del_files_after_days']; + $config['max_backup_files']=$_POST['max_backup_files']; + $config['max_backup_files_each']=$_POST['max_backup_files_each']; + + + $config['empty_db_before_restore']=$_POST['empty_db_before_restore']; + $config['optimize_tables_beforedump']=$_POST['optimize_tables']; + $config['cron_samedb']=$_POST['cron_samedb']; + + + $config['cron_extender']=$_POST['cron_extender']; + // cron_select_savepath/ + if(isset($_POST['cron_savepath_new']) && !empty($_POST['cron_savepath_new'])) + $config['cron_configurationfile']=$_POST['cron_savepath_new'].".conf"; + else + $config['cron_configurationfile']=$_POST['cron_select_savepath'].".conf"; + + + $config['cron_execution_path']=$_POST['cron_execution_path']; + if($config['cron_execution_path']=="")$config['cron_execution_path']="msd_cron/"; + if(strlen($config['cron_execution_path'])>1 && substr($config['cron_execution_path'],-1)!="/") $config['cron_execution_path'].="/"; + $config['cron_mail']=$_POST['cron_mail']; + $config['cron_mail_dump']=$_POST['cron_mail_dump']; + + $config['cron_use_sendmail']=$_POST['cron_use_sendmail']; + $config['cron_sendmail']=$_POST['cron_sendmail']; + $config['cron_smtp']=$_POST['cron_smpt']; + + $config['cron_printout']=$_POST['cron_printout']; + $config['cron_completelog']=$_POST['cron_completelog']; + $config['cron_ftp']=$_POST['cron_ftp']; + $config['cron_compression']=$_POST['cron_compression']; + $config['cron_comletelog']=$_POST['cron_completelog']; + + $databases['multi']=Array(); + $databases['multi_praefix']=Array(); + $databases['multi_commandbeforedump']=Array(); + $databases['multi_commandafterdump']=Array(); + for($i=0;$i0)?implode(";",$databases['multi']) : ""; + $databases['multisetting_praefix']=(count($databases['multi'])>0)?implode(";",$databases['multi_praefix']) : ""; + $databases['multisetting_commandbeforedump']=(count($databases['multi'])>0)?implode(";",$databases['multi_commandbeforedump']) : ""; + $databases['multisetting_commandafterdump']=(count($databases['multi'])>0)?implode(";",$databases['multi_commandafterdump']) : ""; + + $databases['db_actual_cronindex']=$_POST['cron_dbindex']; + if($config['cron_samedb']==0){ + $databases['db_actual_cronindex']=$databases['db_selected_index']; + + } elseif($databases['db_actual_cronindex']=="-2") { + $cron_save_all_dbs=1; + $datenbanken=count($databases['Name']); + $cron_db_array=str_replace(";","|",$databases['multisetting']); + $cron_dbpraefix_array=str_replace(";","|",$databases['multisetting_praefix']); + $cron_db_cbd_array=str_replace(";","|",$databases['multisetting_commandbeforedump']); + $cron_db_cad_array=str_replace(";","|",$databases['multisetting_commandafterdump']); + + } elseif ($databases['db_actual_cronindex']=="-3") { + $cron_save_all_dbs=1; + $cron_db_array=implode("|",$databases['Name']); + $cron_dbpraefix_array=implode("|",$databases['praefix']); + $cron_db_cbd_array=implode("|",$databases['command_before_dump']); + $cron_db_cad_array=implode("|",$databases['command_after_dump']); + + } + + $config['ftp_transfer']=$_POST['ftp_transfer']; + $config['ftp_connectionindex']=$_POST['ftp_transferconn']; + $config['ftp_timeout']=$_POST['ftp_timeout']; + $config['ftp_useSSL']=isset($_POST['ftp_useSSL']) ? $_POST['ftp_useSSL'] : 0; + + for($i=0;$i<3;$i++) { + $checkFTP[$i]=""; + $config['ftp_server'][$i]=$_POST['ftp_server'.$i]; + $config['ftp_port'][$i]=$_POST['ftp_port'.$i]; + $config['ftp_user'][$i]=$_POST['ftp_user'.$i]; + $config['ftp_pass'][$i]=$_POST['ftp_pass'.$i]; + $config['ftp_dir'][$i]=stripslashes($_POST['ftp_dir'.$i]); + if($config['ftp_port'][$i]+0==0) $config['ftp_port'][$i]=21; + if($config['ftp_dir'][$i]=="" || (strlen($config['ftp_dir'][$i])>1 && substr($config['ftp_dir'][$i],-1)!="/")) $config['ftp_dir'][$i].="/"; + } + + $config['bb_width']=$_POST['bb_width']; + $config['bb_textcolor']=$_POST['bb_textcolor']; + $config['sql_limit']=$_POST['sql_limit']; + + if($config['dbhost']!=$_POST['dbhost'] || + $config['dbuser']!=$_POST['dbuser'] || + $config['dbpass']!=$_POST['dbpass'] || + $config['dbport']!=$_POST['dbport'] || + $config['dbsocket']!=$_POST['dbsocket']) { + //neue Verbindungsparameter + + //alte Parameter sichern + $old['dbhost']=$config['dbhost']; + $old['dbuser']=$config['dbuser']; + $old['dbpass']=$config['dbpass']; + $old['dbport']=$config['dbport']; + $old['dbsocket']=$config['dbsocket']; + + //neu setzen + $config['dbhost']=$_POST['dbhost']; + $config['dbuser']=$_POST['dbuser']; + $config['dbpass']=$_POST['dbpass']; + $config['dbport']=$_POST['dbport']; + $config['dbsocket']=$_POST['dbsocket']; + if(MSD_mysql_connect()) { + SetDefault(); + $msg.= ''; + } else { + //alte Werte holen + $config['dbhost']=$old['dbhost']; + $config['dbuser']=$old['dbuser']; + $config['dbpass']=$old['dbpass']; + $config['dbport']=$old['dbport']; + $config['dbsocket']=$old['dbsocket']; + $msg.='

'.$lang['wrong_connectionpars'].'

'; + } + + } else { + + // und wegschreiben + if (WriteParams(0,$config,$databases)==true) + { + //neue Sprache? Dann Menü links auch aktualisieren + if( $_POST['lang_old']!=$config['language'] + || $_POST['scaption_old']!=$config['interface_server_caption'] + || $oldtheme!=$config['theme'] + || $oldscposition!=$config['interface_server_caption_position']) + { + $msg.= ''; + } + //Parameter laden + include($config['files']['parameter']); + if ($config['logcompression']!=$oldlogcompression) SwitchLogfileFormat(); + $msg.= '

'.$lang['save_success'].'

'; + } else $msg.= '

'.$lang['save_error'].'

'; + } +} + +echo MSDHeader(); +ReadSQL(); + +?> + +'.$nl; +$aus['formstart'].='
'; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; +$aus['formstart'].='
'.$nl; + +$aus['formstart'].='


'.$nl; +$aus['formstart'].=''.$nl; +$aus['formstart'].=''.$nl; +$aus['formstart'].='
'.$msg.$nl; + +// Zugangsdaten +$aus['db']='
'.$lang['connectionpars'].''.$nl.$nl; +$aus['db'].='
'.$lang['db_backuppars'].''; + +$aus['db'].=''; +if(count($databases['Name'])==1) { + $aus['db'].=''; + $aus['db'].=''; + $aus['db'].=''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; +} else { + $aus['db'].=''; + $aus['db'].=''; +} +$aus['db'].='
'.Help($lang['help_db'],"conf1").$lang['list_db'].''.$databases['db_actual'].'
'.Help($lang['help_praefix'],"conf2").$lang['praefix'].'
'.Help($lang['help_commands'],"").'Command before Dump'.ComboCommandDump(0,$databases['db_selected_index']).'
'.Help($lang['help_commands'],"").'Command after Dump'.ComboCommandDump(1,$databases['db_selected_index']).''.$lang['sql_befehle'].'
'.Help($lang['help_db'],"conf1").$lang['list_db'].''.$lang['activate_multidump'].'
'; + $aus['db'].=''; + $aus['db'].=''; + + //erst die aktuelle DB + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + + $dbacombo=$dbbcombo="";$j=0; + for($i=0;$i'; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + $aus['db'].= ''; + } + } + + $aus['db'].='
'.$lang['db'].'Multidump
('.$lang['all'].' '.$lang['none'].')
'.Help($lang['help_praefix'],"conf2").$lang['praefix'].''.Help($lang['help_commands'],"",11).'Command before Dump'.Help($lang['help_commands'],"",11).'Command after Dump'.$lang['sql_befehle'].'
'.$databases['db_actual'].''.ComboCommandDump(0,$databases['db_selected_index']).''.ComboCommandDump(1,$databases['db_selected_index']).''.$lang['sql_befehle'].'
'.$databases['Name'][$i].''.ComboCommandDump(0,$i).''.ComboCommandDump(1,$i).''.$lang['sql_befehle'].'
'; + +// sonstige Einstellungen +$aus['global1']='
'.$lang['general'].''; + +$aus['global1'].=''; +$aus['global1'].=''; + +$aus['global1'].=''; +$aus['global1'].=''; + +$aus['global1'].=''; +$aus['global1'].=''; + +$aus['global1'].='
'.Help("","").'Logfiles: '.$lang['compressed'].'
'; +$aus['global1'].=''.$lang['maxsize'].':    '; +$aus['global1'].='
'.Help($lang['help_memorylimit'],"").$lang['memory_limit'].':  '; +$aus['global1'].=' Bytes   automatisch ermitteln'; +$aus['global1'].='
'.Help($lang['help_speed'],"").$lang['speed'].':  '.$lang['to'].' 
'.$lang['dump'].''; + +$aus['global1'].=''; +$aus['global1'].=''; +//Multipart-Backup --> +$aus['global1'].=''; +$aus['global1'].=''; +$aus['global1'].=''; +$aus['global1'].=''; +$aus['global1'].=''; + +$aus['global1'].=''; + + +$aus['global1'].='
'.Help($lang['help_zip'],"conf3").$lang['gzip'].': '.$lang['activated']; +$aus['global1'].=''.$lang['not_activated'].'
'.Help($lang['help_multipart'],"").$lang['multi_part'].': '; +$aus['global1'].=''.$lang['yes']; +$aus['global1'].=''.$lang['no']; +$aus['global1'].='
'.Help($lang['help_multipartgroesse'],"").$lang['multi_part_groesse'].':  
'; +$aus['global1'].='  '; +$aus['global1'].='
'.Help($lang['help_optimize'],"").$lang['optimize'].': '.$lang['activated']; +$aus['global1'].=''.$lang['not_activated'].'
'.Help("","").$lang['backup_format'].': '.$lang['inserts_complete'].'
'; +$aus['global1'].=''.$lang['inserts_extended'].'
'; +$aus['global1'].=''.$lang['inserts_delayed'].'
'; +$aus['global1'].=''.$lang['inserts_ignore'].'
'; +$aus['global1'].=''.$lang['lock_tables'].'
'; +$aus['global1'].=''.$lang['downgrade'].'
'.$lang['restore'].''; +$aus['global1'].=''; + + +$aus['global1'].='
'.Help($lang['help_empty_db_before_restore'],"conf4").$lang['empty_db_before_restore'].': '; +$aus['global1'].=''.$lang['yes']; +$aus['global1'].=''.$lang['no']; +$aus['global1'].='
'.Help("","").$lang['errorhandling_restore'].''; +$aus['global1'].=''.$lang['ehrestore_continue'].'
'; +$aus['global1'].=''.$lang['ehrestore_stop']; +$aus['global1'].='
'; + +//Interface --> +$aus['global3']='
'.$lang['config_interface'].''; +$aus['global3'].=''; +$aus['global3'].=''; + +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; + +$aus['global3'].='
'.Help($lang['help_lang'],"conf11").$lang['language'].':   '.$lang['download_languages'].'
'.Help($lang['help_servercaption'],"").$lang['servercaption'].':'.$lang['activated'].'   '; +$aus['global3'].=''.$lang['in_mainframe'].'  '.$lang['in_leftframe'].''; +$aus['global3'].='
'.Help("","").'Theme  '.$lang['download_styles'].'
'.$lang['sql_browser'].''; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].=''; + +$aus['global3'].='
'.Help("","").$lang['sqlboxheight'].':  pixel
'.Help("","").$lang['sqllimit'].':  
'.Help("","").$lang['bbparams'].': '; +$aus['global3'].=''; +$aus['global3'].=''; +$aus['global3'].='
'.$lang['width'].': pixel
'.$lang['bbtextcolor'].': 
'; +$aus['global3'].='
'.Help("","").'SQL-Grid: normal   '; +$aus['global3'].='compact
'; + +//automatisches Löschen--> +$aus['global2']='
'.$lang['config_autodelete'].''; +$aus['global2'].=''; +$aus['global2'].=''; +$aus['global2'].=''; +$aus['global2'].=''; +$aus['global2'].='
'.Help($lang['help_ad1'],"conf8").$lang['autodelete'].': '.$lang['activated']; +$aus['global2'].=''.$lang['not_activated']; +$aus['global2'].='
'.Help($lang['help_ad2'],"conf9").$lang['age_of_files'].': 
'.Help($lang['help_ad3'],"conf10").$lang['number_of_files_form'].':  '; +$aus['global2'].=''.$lang['max_backup_files_each1'].' '; +$aus['global2'].=''.$lang['max_backup_files_each2']; +$aus['global2'].='
'; + + +//Email--> +$aus['transfer1']='
'.$lang['config_email'].''; +$aus['transfer1'].=''; +$aus['transfer1'].=''; +$aus['transfer1'].=''; +$aus['transfer1'].=''; +$aus['transfer1'].=''; +$aus['transfer1'].='
'.Help($lang['help_mail1'],"conf5").$lang['send_mail_form'].': '.$lang['yes']; +$aus['transfer1'].=''.$lang['no']; +$aus['transfer1'].='
'.Help($lang['help_mail2'],"conf6").$lang['email_adress'].': 
'.Help($lang['help_mail3'],"conf7").$lang['email_subject'].': 
'.Help($lang['help_mail5'],"").$lang['send_mail_dump'].': '; +$aus['transfer1'].=''.$lang['yes']; +$aus['transfer1'].=''.$lang['no']; +$aus['transfer1'].='
'.Help($lang['help_mail4'],"").$lang['email_maxsize'].': '; +$aus['transfer1'].='  '; +$aus['transfer1'].='
'.Help($lang['help_cronmailprg'],"").$lang['cron_mailprg'].': '; +$aus['transfer1'].=''; +$aus['transfer1'].='
sendmail
SMPT
 SMTP-Port: '.$config['cron_smtp_port'].'
'; + +//FTP--> +$aus['transfer2']='
'.$lang['config_ftp'].''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; + +$aus['transfer2'].=''; +$aus['transfer2'].=''; + +$aus['transfer2'].=''; +$aus['transfer2'].='
'.Help($lang['help_ftptransfer'],"conf13").$lang['ftp_transfer'].': '.$lang['activated']; +$aus['transfer2'].=' '.$lang['not_activated'].'
'.Help($lang['useconnection'].":","").$lang['useconnection'].': '; +$aus['transfer2'].=' FTP 1  '; +$aus['transfer2'].=' FTP 2  '; +$aus['transfer2'].=' FTP 3
'.Help($lang['help_ftptimeout'],"").$lang['ftp_timeout'].':  sec
'.Help($lang['help_ftpssl'],"").$lang['ftp_ssl'].': '; +$aus['transfer2'].=''.$lang['ftp_useSSL'].'
'; + +//1 +$aus['transfer2'].='
FTP-Connection 1

'.$checkFTP[0].'
'; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].='
'.Help($lang['help_ftpserver'],"conf14",12).$lang['ftp_server'].': 
'.Help($lang['help_ftpport'],"conf15",12).$lang['ftp_port'].': 
'.Help($lang['help_ftpuser'],"conf16",12).$lang['ftp_user'].': 
'.Help($lang['help_ftppass'],"conf17",12).$lang['ftp_pass'].': 
'.Help($lang['help_ftpdir'],"conf18",12).$lang['ftp_dir'].': 
'; +//2 +$aus['transfer2'].='
FTP-Connection 2

'.$checkFTP[1].'
'; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].='
'.Help($lang['help_ftpserver'],"conf14",12).$lang['ftp_server'].': 
'.Help($lang['help_ftpport'],"conf15",12).$lang['ftp_port'].': 
'.Help($lang['help_ftpuser'],"conf16",12).$lang['ftp_user'].': 
'.Help($lang['help_ftppass'],"conf17",12).$lang['ftp_pass'].': 
'.Help($lang['help_ftpdir'],"conf18",12).$lang['ftp_dir'].': 
'; +//3 +$aus['transfer2'].='
FTP-Connection 3

'.$checkFTP[2].'
'; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].=''; +$aus['transfer2'].='
'.Help($lang['help_ftpserver'],"conf14",12).$lang['ftp_server'].': 
'.Help($lang['help_ftpport'],"conf15",12).$lang['ftp_port'].': 
'.Help($lang['help_ftpuser'],"conf16",12).$lang['ftp_user'].': 
'.Help($lang['help_ftppass'],"conf17",12).$lang['ftp_pass'].': 
'.Help($lang['help_ftpdir'],"conf18",12).$lang['ftp_dir'].': 
'; + + +//Crondump +$aus['cron']='
'.$lang['config_cronperl'].''; +$aus['cron'].=''; +$aus['cron'].=''; + +$aus['cron'].=''; + +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; +$aus['cron'].=''; + +$aus['cron'].=''; +$aus['cron'].='
'.Help($lang['help_cronextender'],"").$lang['cron_extender'].': .pl'; +$aus['cron'].='.cgi'; +$aus['cron'].='
'.Help($lang['help_cronsavepath'],"").$lang['cron_savepath'].': '; +$aus['cron'].='
'.$lang['existing'].':
'.$lang['new'].': .conf
'.Help($lang['help_cronexecpath'],"").$lang['cron_execpath'].': 
'.Help($lang['help_cronprintout'],"").$lang['cron_printout'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no'].'
'.Help($lang['help_croncompletelog'],"").$lang['cron_completelog'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no'].'
'.Help($lang['help_cronsamedb'],"conf13").$lang['cron_samedb'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no']; +$aus['cron'].='
'.Help($lang['help_crondbindex'],"conf14").$lang['cron_crondbindex'].': 
  
'.Help($lang['help_cronzip'],"").$lang['gzip'].': '.$lang['activated']; +$aus['cron'].=''.$lang['not_activated']; +$aus['cron'].='
'.Help($lang['help_cronmail'],"").$lang['send_mail_form'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no']; +$aus['cron'].='
'.Help($lang['help_cronmail_dump'],"").$lang['send_mail_dump'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no']; +$aus['cron'].='
'.Help($lang['help_cronftp'],"").$lang['cron_ftp'].': '.$lang['yes']; +$aus['cron'].=''.$lang['no']; +$aus['cron'].='
'; + + + + +//Formular-Buttons --> +$aus['formende']='

'; + + + +// AUSGABE + + +echo $aus['formstart']; +echo $aus['db']; +echo $aus['global1']; +echo $aus['global2']; +echo $aus['global3']; +echo $aus['transfer1']; +echo $aus['transfer2']; +echo $aus['cron']; + +echo $aus['formende']; +echo ''; + +echo MSDFooter(); + + + +?> \ No newline at end of file diff --git a/mysqldumper/css/msd/icons/ardown.gif b/mysqldumper/css/msd/icons/ardown.gif new file mode 100644 index 0000000..825c9e8 Binary files /dev/null and b/mysqldumper/css/msd/icons/ardown.gif differ diff --git a/mysqldumper/css/msd/icons/arrowdown.gif b/mysqldumper/css/msd/icons/arrowdown.gif new file mode 100644 index 0000000..32d7ceb Binary files /dev/null and b/mysqldumper/css/msd/icons/arrowdown.gif differ diff --git a/mysqldumper/css/msd/icons/arrowleft.gif b/mysqldumper/css/msd/icons/arrowleft.gif new file mode 100644 index 0000000..560043d Binary files /dev/null and b/mysqldumper/css/msd/icons/arrowleft.gif differ diff --git a/mysqldumper/css/msd/icons/arrowup.gif b/mysqldumper/css/msd/icons/arrowup.gif new file mode 100644 index 0000000..e9eba1f Binary files /dev/null and b/mysqldumper/css/msd/icons/arrowup.gif differ diff --git a/mysqldumper/css/msd/icons/arup.gif b/mysqldumper/css/msd/icons/arup.gif new file mode 100644 index 0000000..701b714 Binary files /dev/null and b/mysqldumper/css/msd/icons/arup.gif differ diff --git a/mysqldumper/css/msd/icons/blank.gif b/mysqldumper/css/msd/icons/blank.gif new file mode 100644 index 0000000..076c753 Binary files /dev/null and b/mysqldumper/css/msd/icons/blank.gif differ diff --git a/mysqldumper/css/msd/icons/close.gif b/mysqldumper/css/msd/icons/close.gif new file mode 100644 index 0000000..57b3cc3 Binary files /dev/null and b/mysqldumper/css/msd/icons/close.gif differ diff --git a/mysqldumper/css/msd/icons/compact.gif b/mysqldumper/css/msd/icons/compact.gif new file mode 100644 index 0000000..9dcb131 Binary files /dev/null and b/mysqldumper/css/msd/icons/compact.gif differ diff --git a/mysqldumper/css/msd/icons/delete.gif b/mysqldumper/css/msd/icons/delete.gif new file mode 100644 index 0000000..eb6f549 Binary files /dev/null and b/mysqldumper/css/msd/icons/delete.gif differ diff --git a/mysqldumper/css/msd/icons/edit.gif b/mysqldumper/css/msd/icons/edit.gif new file mode 100644 index 0000000..103a92c Binary files /dev/null and b/mysqldumper/css/msd/icons/edit.gif differ diff --git a/mysqldumper/css/msd/icons/empty.gif b/mysqldumper/css/msd/icons/empty.gif new file mode 100644 index 0000000..f931753 Binary files /dev/null and b/mysqldumper/css/msd/icons/empty.gif differ diff --git a/mysqldumper/css/msd/icons/emptykeys.gif b/mysqldumper/css/msd/icons/emptykeys.gif new file mode 100644 index 0000000..7750c06 Binary files /dev/null and b/mysqldumper/css/msd/icons/emptykeys.gif differ diff --git a/mysqldumper/css/msd/icons/encompact.gif b/mysqldumper/css/msd/icons/encompact.gif new file mode 100644 index 0000000..e590f5c Binary files /dev/null and b/mysqldumper/css/msd/icons/encompact.gif differ diff --git a/mysqldumper/css/msd/icons/fulltext.gif b/mysqldumper/css/msd/icons/fulltext.gif new file mode 100644 index 0000000..bedce14 Binary files /dev/null and b/mysqldumper/css/msd/icons/fulltext.gif differ diff --git a/mysqldumper/css/msd/icons/gz.gif b/mysqldumper/css/msd/icons/gz.gif new file mode 100644 index 0000000..f0adfe5 Binary files /dev/null and b/mysqldumper/css/msd/icons/gz.gif differ diff --git a/mysqldumper/css/msd/icons/help16.gif b/mysqldumper/css/msd/icons/help16.gif new file mode 100644 index 0000000..c1f81c4 Binary files /dev/null and b/mysqldumper/css/msd/icons/help16.gif differ diff --git a/mysqldumper/css/msd/icons/help32.gif b/mysqldumper/css/msd/icons/help32.gif new file mode 100644 index 0000000..18ac603 Binary files /dev/null and b/mysqldumper/css/msd/icons/help32.gif differ diff --git a/mysqldumper/css/msd/icons/key.gif b/mysqldumper/css/msd/icons/key.gif new file mode 100644 index 0000000..16106df Binary files /dev/null and b/mysqldumper/css/msd/icons/key.gif differ diff --git a/mysqldumper/css/msd/icons/nokey.gif b/mysqldumper/css/msd/icons/nokey.gif new file mode 100644 index 0000000..0a3caa6 Binary files /dev/null and b/mysqldumper/css/msd/icons/nokey.gif differ diff --git a/mysqldumper/css/msd/icons/notok.gif b/mysqldumper/css/msd/icons/notok.gif new file mode 100644 index 0000000..399e815 Binary files /dev/null and b/mysqldumper/css/msd/icons/notok.gif differ diff --git a/mysqldumper/css/msd/icons/ok.gif b/mysqldumper/css/msd/icons/ok.gif new file mode 100644 index 0000000..4abfb29 Binary files /dev/null and b/mysqldumper/css/msd/icons/ok.gif differ diff --git a/mysqldumper/css/msd/icons/openfile.gif b/mysqldumper/css/msd/icons/openfile.gif new file mode 100644 index 0000000..8987640 Binary files /dev/null and b/mysqldumper/css/msd/icons/openfile.gif differ diff --git a/mysqldumper/css/msd/icons/primary.gif b/mysqldumper/css/msd/icons/primary.gif new file mode 100644 index 0000000..c80e3cb Binary files /dev/null and b/mysqldumper/css/msd/icons/primary.gif differ diff --git a/mysqldumper/css/msd/icons/progressbar_dump.gif b/mysqldumper/css/msd/icons/progressbar_dump.gif new file mode 100644 index 0000000..c57f75e Binary files /dev/null and b/mysqldumper/css/msd/icons/progressbar_dump.gif differ diff --git a/mysqldumper/css/msd/icons/progressbar_restore.gif b/mysqldumper/css/msd/icons/progressbar_restore.gif new file mode 100644 index 0000000..e5ac82c Binary files /dev/null and b/mysqldumper/css/msd/icons/progressbar_restore.gif differ diff --git a/mysqldumper/css/msd/icons/progressbar_speed.gif b/mysqldumper/css/msd/icons/progressbar_speed.gif new file mode 100644 index 0000000..c8cd9dc Binary files /dev/null and b/mysqldumper/css/msd/icons/progressbar_speed.gif differ diff --git a/mysqldumper/css/msd/icons/rename.gif b/mysqldumper/css/msd/icons/rename.gif new file mode 100644 index 0000000..c55d78e Binary files /dev/null and b/mysqldumper/css/msd/icons/rename.gif differ diff --git a/mysqldumper/css/msd/icons/unique.gif b/mysqldumper/css/msd/icons/unique.gif new file mode 100644 index 0000000..1d5c870 Binary files /dev/null and b/mysqldumper/css/msd/icons/unique.gif differ diff --git a/mysqldumper/css/msd/pics/body_bg.gif b/mysqldumper/css/msd/pics/body_bg.gif new file mode 100644 index 0000000..f50f7aa Binary files /dev/null and b/mysqldumper/css/msd/pics/body_bg.gif differ diff --git a/mysqldumper/css/msd/pics/cellpic.gif b/mysqldumper/css/msd/pics/cellpic.gif new file mode 100644 index 0000000..242f988 Binary files /dev/null and b/mysqldumper/css/msd/pics/cellpic.gif differ diff --git a/mysqldumper/css/msd/pics/mainnavi.gif b/mysqldumper/css/msd/pics/mainnavi.gif new file mode 100644 index 0000000..23547e3 Binary files /dev/null and b/mysqldumper/css/msd/pics/mainnavi.gif differ diff --git a/mysqldumper/css/msd/pics/menubutton.gif b/mysqldumper/css/msd/pics/menubutton.gif new file mode 100644 index 0000000..f1def49 Binary files /dev/null and b/mysqldumper/css/msd/pics/menubutton.gif differ diff --git a/mysqldumper/css/msd/pics/navi_bg.jpg b/mysqldumper/css/msd/pics/navi_bg.jpg new file mode 100644 index 0000000..ccec880 Binary files /dev/null and b/mysqldumper/css/msd/pics/navi_bg.jpg differ diff --git a/mysqldumper/css/msd/pics/overall_bg.gif b/mysqldumper/css/msd/pics/overall_bg.gif new file mode 100644 index 0000000..af143fa Binary files /dev/null and b/mysqldumper/css/msd/pics/overall_bg.gif differ diff --git a/mysqldumper/css/msd/pics/pagetitle.gif b/mysqldumper/css/msd/pics/pagetitle.gif new file mode 100644 index 0000000..b240bf5 Binary files /dev/null and b/mysqldumper/css/msd/pics/pagetitle.gif differ diff --git a/mysqldumper/css/msd/style.css b/mysqldumper/css/msd/style.css new file mode 100644 index 0000000..c0e663f --- /dev/null +++ b/mysqldumper/css/msd/style.css @@ -0,0 +1,152 @@ +/* MySQLDumper STYLESHEET + +Name: msd + +*/ + +* {margin: 0;padding: 0;} +img {border:0;} + + + +body {font:12px/1.5 Verdana,Helvetica,sans-serif;color:#4E5665;background: #C7D1D0;} +body.menu {font:12px Verdana,Helvetica,sans-serif;color:#4E5665;background:#738C88;} + +/* LINKS */ + +a {color:#4E5665 ; text-decoration:underline; font:12px verdana, sans-serif} +a:hover {color:#E87B00; text-decoration:none} +a.ul {text-decoration:underline;} + + +/* general */ +#pagetitle {font-size: 18px;font-weight: bold;background:url(pics/pagetitle.gif) #A9AFBB;letter-spacing: 2px;color:White;padding:2px 6px;} + +#server0 {position:absolute;bottom:4px;text-align:center; left:10px; color:white;} +#server1 {position:absolute;right:16px;text-align:center;padding:10px;} +a.server {color:#333333;font-size:10px;} +a.server:hover {text-decoration: underline;color: white;} + +.version {font-size: 11px;font-weight:bold; } +.small {font-size:11px;} +.ssmall {font-size:10px;} +.success {font-weight:bold;} +.error {color:red;font-weight:bold;} + +table td {text-align:left;vertical-align:top;padding:0 6px;} +table th {padding:0 6px;} + +/* MENU */ +#wrapmenu { background:url(pics/pagetitle.gif) #A9AFBB; background-repeat:repeat-x;} +#db-select { font:12px Verdana,Helvetica,sans-serif;color:#4E5665;background:#A9AFBB; } + +#menu {margin-top:1px;background: url(pics/navi_bg.jpg) no-repeat; text-align:center;} +#menu ul {margin-top:174px;padding:0;list-style:none;border-top:1px solid #9AA2B1} +#menu ul li { height:20px;} +#menu ul li a {display:block;position:relative; /*fuer den ie*/ font:11px/20px verdana, sans-serif;text-decoration:none;color:#4E5665; background:url(pics/mainnavi.gif) repeat-x 0 -20px;padding:0 15px;height:20px;text-align:left;} +#menu ul li a:hover {color:#fff; background:url(pics/mainnavi.gif) repeat-x 0 0px;} +/*der aktive link in der navi*/ +#menu ul li.active a {font-weight:bold;color:#fff; background:url(pics/mainnavi.gif) repeat-x 0 -40px; display:block;} + +#menu p,#menu p a{color:#fff;line-height:1.5;font-size:11px;} + +#db-selectbox +{ + position:relative; + top:0px; + width:190px; + background:transparent; + text-align:center; + font:11px/1.5 Verdana,Helvetica,sans-serif; + color:white; +} + +#db-selectbox a { font:11px/1.5 Verdana,Helvetica,sans-serif; color:white;text-decoration:underline; } +#db-selectbox a:hover { text-decoration:none} + +/* MAIN */ +#topnavi {text-align:center;margin:6px;} +#content {margin-left:12px;} +#content p {margin-bottom:8px;} + +/*Tabellen */ +table tr.dbrow {background:#E4E9E8;} +table tr.dbrow1 {background:#D5DDDC;} +table tr.dbrowsel {background:#fff;} + +table.bordersmall,table.border {border:2px solid #738C88;width:84%;} +table.border th,table.bordersmall th {font-size:11px;color:#738C88;} +table.border tr.thead,table.bordersmall tr.thead {background:#A5B6B4;height:24px;} +table td.sum { background-color:red;font-weight:bold;text-align:right;} + + +table.bordersmall input,table.bordersmall select,table.bordersmall td, +#sqlheaderbox select,#configright select, #configright a {font-size:11px;} +.tdcompact {width:100px;height:16px;overflow:hidden;font-size:11px;} +.tdnormal {white-space:nowrap;padding:4px;} +.sqlheadmenu a {} + + +/* FORM-Elements */ +#content .Formbutton {white-space:nowrap;margin:6px;font:10px verdana, sans-serif; border: 1px solid #4E5665; background:#A9B2B1; color:#4E5665;padding:2px;cursor: pointer;} +#content .SQLbutton {font-size:11px;background:#E4E9E8;cursor: pointer;} +#content textarea #thta {font-size:11px;color:blue;width:400px;height:300px;overflow:scroll;} +#content textarea {width:100%;background:#B3C2C0;} + +input.radio,input.checkbox {background-color: transparent;} + +/* Colors for Formelements */ +input.text,input.small {background:#B3C2C0;color:#4E5665;} +select {background:#B3C2C0;color:#4E5665;} +textarea {background:#B3C2C0;color:#4E5665;} + +/* for Geckos */ +input[disabled] {color:#888;} + + +/*horizontales Menü */ + +#hormenu {} +#hormenu ul {border-bottom:thin solid #D5DDDC;margin-bottom:8px;width:80%;} +#hormenu ul li {display:inline;} +#hormenu ul li a {font:11px/20px verdana, sans-serif;text-decoration:none;color:#4E5665;padding:0 14px;border:0;} +#hormenu ul li a:hover {color:#E87B00;} +#hormenu ul li#active a{font:bold 11px/20px verdana, sans-serif;text-decoration:none; color:#E87B00; float:left; padding:0 14px;} +#hormenu ul li#active a:hover{color:#E87B00; } + +/* spezielle Elemente */ +.MySQLbox{font-size: 10pt;padding: 6px;background:#000; color: #fff;border: thin solid #999999;height: 200px;width: 80%;text-align: left;overflow: auto; } +#content #mysqlbox {border:1px solid #738C88;background:#D5DDDC;} +#content #sqlheaderbox {white-space:nowrap;height:20px;vertical-align:middle;padding-top:2px;} +#content #sqleditbox {border:1px solid #738C88;background:#E4E9E8;margin-bottom:10px;} +#content #sqleditbox p {background:#A5B6B4;font-weight:bold;text-align:center;} +#content #sqlnewbox {border:1px solid #738C88;background:#E4E9E8;} +#content #sqlnewbox p {background:#A5B6B4;font-weight:bold;text-align:center;} +#content #sqloutbox {font-size: 11px;width:700px;padding:6px;background:#D5DDDC;border:1px solid #738C88;overflow:auto;height:240px;} +#content p.autodel {font-size:11px;border-bottom:1px dashed #fff;margin-bottom:12px;} +#content .Logbox {font:12px/1.2 "Courier New", Courier, monospace;padding: 6px;border: thin solid #738C88;height: 320px;width: 90%;text-align: left;overflow: auto;} +#content .Logbox span {color:#738C88;} +#content .backupmsg {padding-left:20px;font-size:11px;} +#content .backupmsg .success,#content .backupmsg a{color:#999;font-size:11px;} +#content .backupmsg .error {color:red;} + +/* TEXT */ + +h1 {font-size:16px;} +h5 {font-size:14px;margin:12px 0;} +h6 {font-size:11px; background:#D1D4DC;border:1px solid #9AA2B1;text-indent: 12px;margin:8px 0;} + +/* Config */ +#configleft {float:left;width:160px;margin-top:24px;} +#configleft .Formbutton {width:130px;margin:8px 0;} +#configleft .ConfigButton {width:130px;font-size:11px;background:#E4E9E8;} +#configleft .ConfigButtonSelected {width: 130px;font-size: 11px;background: #D5DDDC;} + +#configright {font-size:11px;margin-left:160px;} +#configright fieldset {border:1px thin #D5DDDC;padding:12px;width:90%;} +#configright legend {color:#646968;margin:8px 0;} + + +#footer {font-size:11px;text-align:center;border-top:1px dashed #eee;margin-top:36px;} +#footer a {font-size:11px;} + diff --git a/mysqldumper/dump.php b/mysqldumper/dump.php new file mode 100644 index 0000000..245df8d --- /dev/null +++ b/mysqldumper/dump.php @@ -0,0 +1,419 @@ +0) ? $config['minspeed'] : 50); + +$mp2=array('Bytes','Kilobytes','Megabytes','Gigabytes'); +$cancelurl='dump.php?cancel=1&part='.$dump['part'].'&backupdatei='.urlencode($dump['backupdatei']).'&backupdateistructure='.urlencode($dump['backupdatei_structure']); +$aus2=$page_parameter=$debugausgabe=$a=''; +$dump['tabellen_gesamt']=0; + + +if($cancel==1) { + //Abbruch durch Benutzer + //Wildcard erzeugen + $wildcard=substr($dump['backupdatei'],0,strlen($databases['db_actual'])+17); + $wildcard2=$dump['backupdatei_structure']; + echo $pageheader.'

Abruch durch Benutzer

Der Backupvorgang wurde unterbrochen.

'; + echo 'Folgende angefangene Backupdateien wurden gelöscht:

'; + echo $wildcard.'*
'.$wildcard2; + echo ''; + exit; +} + +FillMultiDBArrays(); + +if($databases['db_actual_tableselected']!='' && $config['multi_dump']==0) +{ + $dump['tblArray']=explode('|',$databases['db_actual_tableselected']); + $tbl_sel=true; + $msgTbl=sprintf($lang['nr_tables_selected'],count($dump['tblArray'])); +} + +//Zeitzähler aktivieren +$dump['max_zeit']=intval($config['max_execution_time']*$config['time_buffer']); +$dump['startzeit']=time(); + +$xtime=(isset($_POST['xtime'])) ? $_POST['xtime']:time(); + +$dump['countdata']= (!empty($_POST['countdata'])) ? $_POST['countdata'] : 0; +$dump['aufruf']= (!empty($_POST['aufruf'])) ? $_POST['aufruf'] : 0; + +MSD_mysql_connect(); + +$flipped = array_flip($databases['Name']); +$dump['tables']=Array(); +$dump['records']=Array(); +$dump['totalrecords']=0; + +for($ii=0;$ii0) + { + for ($i=0;$i<$num_tables;$i++) + { + $row=mysql_fetch_array($tabellen); + if($config['optimize_tables_beforedump']==1 && $dump['table_offset']==-1) { + //Tabelle optimieren + mysql_query('OPTIMIZE `'.$row['Name'].'`'); + } + if (isset($tbl_sel)) + { + if (in_array($row['Name'],$dump['tblArray'])) { + $dump['tables'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Name']; + $dump['records'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Rows']; + $dump['totalrecords']+=$row['Rows']; + } + } + elseif ($databases['praefix'][$dump['dbindex']]!='' && !isset($tbl_sel)) + { + if (substr($row['Name'],0,strlen($databases['praefix'][$dump['dbindex']]))==$databases['praefix'][$dump['dbindex']]) { + $dump['tables'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Name']; + $dump['records'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Rows']; + $dump['totalrecords']+=$row['Rows']; + } + } + else + { + $dump['tables'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Name']; + $dump['records'][]=$databases['Name'][$dump['dbindex']].'|'.$row['Rows']; + $dump['totalrecords']+=$row['Rows']; + } + } + } + //else $aus_error[]= '

'.$lang['error'].': '.sprintf($lang['dump_notables'],$databases['Name'][$dump['dbindex']]).'

'; +} + +$num_tables=count($dump['tables']); +if($config['optimize_tables_beforedump']==1 && $dump['table_offset']==-1) $out.=sprintf($lang['nr_tables_optimized'],$num_tables).'
'; +$dump['data']=''; +$dump['structure']=''; +$dump['dbindex']=(isset($_POST['dbindex'])) ? $_POST['dbindex'] :$flipped[$databases['multi'][0]]; + +//Ausgaben-Header bauen +$aus_header[]= PicCache($relativ_path); +$aus_header[]= headline('Backup: '.(($config['multi_dump']==1) ? 'Multidump ('.count($databases['multi']).' '.$lang['dbs'].')' : $lang['db'].': '.$databases['Name'][$dump['dbindex']].(($databases['praefix'][$dump['dbindex']]!='') ?' ('.$lang['withpraefix'].' '.$databases['praefix'][$dump['dbindex']].')' : ''))); +if(isset($aus_error) && count($aus_error)>0) $aus_header=array_merge($aus_header,$aus_error); + +$aus_header[]='Browser : '; +if(count($dump['tables'])==0) { + //keine Tabellen gefunden + $aus[]='

'.$lang['error'].': '.sprintf($lang['dump_notables'],$databases['Name'][$dump['dbindex']]).'

'; + if($config['multi_dump']==1) + { + } +} +else +{ + if ($dump['table_offset']==-1) + { + // File anlegen, da Erstaufruf + new_file(); + $dump['table_offset']=0; // jetzt kanns losgehen + flush(); + } + else + { + + // SQL-Befehle ermitteln + $dump['restzeilen']=$dump['anzahl_zeilen']; + WHILE ( ($dump['table_offset'] < $num_tables) && ($dump['restzeilen']>0) ) + { + $table = substr($dump['tables'][$dump['table_offset']],strpos($dump['tables'][$dump['table_offset']],'|')+1); + $adbname=substr($dump['tables'][$dump['table_offset']],0,strpos($dump['tables'][$dump['table_offset']],'|')); + if($databases['Name'][$dump['dbindex']]!=$adbname) { + //neue Datenbank + WriteLog('Dump \''.$dump['backupdatei'].'\' finished.'); + ExecuteCommand('a'); + if($config['multi_part']==1) + { + $out.=$lang['finished'].'
'; + $dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],'part_')).'part_'; + $dateiendung=($config['compression']==1) ? '.sql.gz':'.sql'; + for ($i=1;$i<($dump['part']-$dump['part_offset']);$i++) + { + $mpdatei=$dateistamm.$i.$dateiendung; + clearstatcache(); + $sz=byte_output(@filesize($config['paths']['backup'].$mpdatei)); + $out.= $lang['file'].' '.$mpdatei.' ('.$sz.') '.$lang['dump_successful'].'
'; + } + } + else + { + clearstatcache(); + $out.=$lang['finished'].'
'.$dump['backupdatei'].' ('.byte_output(filesize($config['paths']['backup'].$dump['backupdatei'])).')
'; + } + if ($config['send_mail']==1) DoEmail(); + if($config['ftp_transfer']==1) DoFTP(); + if(isset($flipped[$adbname])) $dump['dbindex']=$flipped[$adbname]; + $dump['part_offset']=$dump['part']-1; + $out.='

'; + new_file(); + } + $aktuelle_tabelle=$dump['table_offset']; + if ($dump['zeilen_offset']==0) + { + if($config['minspeed']>0) + { + $dump['anzahl_zeilen']=$config['minspeed']; + $dump['restzeilen']=$config['minspeed']; + } + $dump['data'] .= get_def($adbname,$table); + $dump['structure'].=get_def($adbname,$table,0); + } + WriteToDumpFile(); + get_content($adbname,$table); + $dump['restzeilen']--; + if($config['memory_limit']>0 && strlen($dump['data'])>$config['memory_limit']) WriteToDumpFile(); + } +} + ///////////////////////////////// + // Anzeige - Fortschritt + ///////////////////////////////// + + if($config['multi_dump']==1) + { + $mudbs=''; + for($i=0;$i '; + else + $mudbs.= ''.$databases['multi'][$i].'   '; + } + } + if($config['multi_part']==1) $aus[]= '
Multipart-Backup: '.$config['multipartgroesse1'].' '.$mp2[$config['multipartgroesse2']].'
'; + + $aus[]= '

'.$lang['dump_headline'].'

'; + + if($dump['kommentar']) $aus[]= $lang['comment'].': '.$dump['kommentar'].'
'; + $aus[]=($config['multi_dump']==1) ? $lang['db'].': '.$mudbs : $lang['db'].': '.$databases['Name'][$dump['dbindex']].''; + $aus[]=(($databases['praefix'][$dump['dbindex']]!='') ?' ('.$lang['withpraefix'].' '.$databases['praefix'][$dump['dbindex']].')' : '').'
'; + if(isset($tbl_sel)) $aus[]= $msgTbl.'

'; + + if($config['multi_part']==1) + { + $aus[]= 'Multipart-Backup File '.($dump['part']-$dump['part_offset']-1).'
'; + $aus2=', '.($dump['part']-1).' files'; + } + $aus[]= $lang['dump_filename'].''.$dump['backupdatei'].''; + $aus[]= '
'.$lang['filesize'].': '.byte_output($dump['filesize']).'

'.$lang['gzip_compression'].' '; + $aus[]= ($config['compression']==1) ? $lang['activated'] : $lang['not_activated']; + $aus[]= '.
'; + + $table = @substr($dump['tables'][$dump['table_offset']],strpos($dump['tables'][$dump['table_offset']],'|')+1); + $adbname=@substr($dump['tables'][$dump['table_offset']],0,strpos($dump['tables'][$dump['table_offset']],'|')); + + $sql='SELECT COUNT(*) AS anzahl FROM `'.$table.'`'; + $res=mysql_query($sql); + if ($res) + { + $row=mysql_fetch_object($res); + $dump['zeilen_total']=intval($row->anzahl); + + if ($dump['zeilen_total']>0) + { + $fortschritt=intval((100*$dump['zeilen_offset'])/$dump['zeilen_total']); +// Nachfolgender Fall kann eigentlich nicht eintreten +// if ($dump['anzahl_zeilen']>=$dump['zeilen_total']) $fortschritt=100; + } + else $fortschritt=100; + + $aus[]= $lang['saving_table'].''.($dump['table_offset']+1).' '.$lang['of'].' '.sizeof($dump['tables']).'
' + .$lang['actual_table'].': '.$table.'

' + .$lang['progress_table'].':
'; + +/* + $aus[]='
'; + $aus[]=draw_progressbar('400','30',$config['files']['iconpath'].'progressbar_dump.gif',$dump['zeilen_offset'],$dump['zeilen_total']); + $aus[]='
Fortschritt: $fortschritt


'; +*/ + + $aus[]= '' + .'' + .'' + .''; + + if ($dump['anzahl_zeilen']+$dump['zeilen_offset']>=$dump['zeilen_total']) + { + $eintrag=$dump['zeilen_offset']+1; + $zeilen_gesamt=$dump['zeilen_total']; + if ($zeilen_gesamt==0) $eintrag=0; + } + else + { + $zeilen_gesamt=$dump['zeilen_offset']+$dump['anzahl_zeilen']; + $eintrag=$dump['zeilen_offset']+1; + } + + $aus[]= '' + .'
 '.($fortschritt).'%
'.$lang['entry'].' '.number_format($eintrag,0,',','.').' '.$lang['upto'].' ' + .number_format(($zeilen_gesamt),0,',','.').' '.$lang['of'].' ' + .number_format($dump['zeilen_total'],0,',','.').'
'; + + $dump['tabellen_gesamt']=(isset($dump['tables'])) ? count($dump['tables']) : 0; + + $noch_zu_speichern=$dump['totalrecords']-$dump['countdata']; + $prozent= ($dump['totalrecords']>0) ? round(((100*$noch_zu_speichern)/$dump['totalrecords']),0) : 100; + if ($noch_zu_speichern==0 || $prozent>100) $prozent=100; + + $aus[]= '
'.$lang['progress_over_all'].':' + .'' + .'' + .'' + .'
'.(100-$prozent).'%
'; + + //Speed-Anzeige + $fw=($config['maxspeed']==$config['minspeed']) ? 300 : round(($dump['anzahl_zeilen']-$config['minspeed'])/($config['maxspeed']-$config['minspeed'])*300,0); + if($fw>300)$fw=300; + $aus[]= '
'; + $aus[]= '
'; + $aus[]= 'Speed
'.$dump['anzahl_zeilen'].'
'; + $aus[]= ''; + $aus[]= '
'; + $aus[]= '
'; + $aus[]= ''; + $aus[]= ''; + $aus[]= '
'.$config['minspeed'].''.$config['maxspeed'].'
'; + + //Status-Text + $aus[]= '

'.zeit_format(time()-$xtime).', '.$dump['aufruf'].' pages'.$aus2; + $aus[]= ($dump['errors']>0) ? ', '.$dump['errors'].' errors' : ''; + $aus[]= '

'; + $aus[]= '
'.$out.'
'; + + } + ////////////////////////////////////// + // Ende Anzeige + ////////////////////////////////////// + + WriteToDumpFile(); + + flush(); + if(!isset($summe_eintraege)) $summe_eintraege=0; + + if ($dump['table_offset']<=$dump['tabellen_gesamt']) + { + $dauer=time()-($xtime+$dump['verbraucht']); + $dump['verbraucht']+=$dauer; + $summe_eintraege+=$dump['anzahl_zeilen']; + + //Zeitanpassung + if($config['direct_connection']==1) { + if ($dauer<$dump['max_zeit']) $dump['anzahl_zeilen']=$dump['anzahl_zeilen']*$config['tuning_add']; + else $dump['anzahl_zeilen']=$dump['anzahl_zeilen']*$config['tuning_sub']; + $dump['anzahl_zeilen']=round($dump['anzahl_zeilen'],0); + if($config['minspeed']>0) {if ($dump['anzahl_zeilen']<$config['minspeed']) $dump['anzahl_zeilen']=$config['minspeed'];} + if($config['maxspeed']>0) {if($dump['anzahl_zeilen']>$config['maxspeed']) $dump['anzahl_zeilen']=$config['maxspeed'];} + } + $dump['aufruf']++; + } + else + { + //Backup fertig + $dump['data']="\n".$mysql_commentstring.' EOB - End of backup\n\n\n'; + WriteToDumpFile(); + ExecuteCommand('a'); + if($config['multi_part']==1) { + $out.='
'; + $dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],'part_')).'part_'; + $dateiendung=($config['compression']==1) ? '.sql.gz':'.sql'; + clearstatcache(); + for ($i=1;$i<($dump['part']-$dump['part_offset']);$i++) + { + $mpdatei=$dateistamm.$i.$dateiendung; + $sz=byte_output(@filesize($config['paths']['backup'].$mpdatei)); + $out.= $lang['file'].' '.$mpdatei.' ('.$sz.') '.$lang['dump_successful'].'
'; + } + + } + else $out.='
'.$lang['file']. + ' '.$dump['backupdatei'].' ('.byte_output(filesize($config['paths']['backup'].$dump['backupdatei'])).')' + .''.$lang['dump_successful'].'
'; + + $backup_ready=1; + $xtime=time()-$xtime; + $aus=Array(); + $aus[]= '
'; + if($config['multi_dump']==1) { + WriteLog('Dump \''.$dump['backupdatei'].'\' finished.'); + WriteLog('Multidump: '.count($databases['multi']).' Databases in '.zeit_format($xtime).'.'); + } else WriteLog('Dump \''.$dump['backupdatei'].'\' finished in '.zeit_format($xtime).'.'); + + if ($config['send_mail']==1) DoEmail(); + if($config['ftp_transfer']==1) DoFTP(); + + @unlink($config['paths']['log'].'out.tmp'); + $out.='
'; + $aus[]= ''.$lang['done'].'
'; + if($dump['errors']>0) $aus[]=sprintf($lang['dump_errors'],$dump['errors']); + + if($config['multi_dump']==1) $aus[]= sprintf($lang['multidump'],count($databases['multi'])).'
'; + $aus[]= '
'.sprintf($lang['dump_endergebnis'],$num_tables,number_format($dump['countdata'],0,',','.')).''.$out.'
' + .'

'.zeit_format($xtime).', '.$dump['aufruf'].' pages'.$aus2.'

' + .str_repeat(' ',60); + $aus[]= '
'; + $aus[]= '   '; + $aus[]= '   

'; + + $DumpFertig=1; + } +} + + +//===================================================================== +//================= Anzeige =========================================== +//===================================================================== + +//Seite basteln +$config_array=(isset($config)) ? 'CONFIG
'.@print_r($config,true).'
': ''; +$database_array=(isset($database)) ? 'DATABASE
'.@print_r($database,true).'
': ''; +$dump_array=(isset($dump)) ? 'DUMP
'.@print_r($dump,true).'
': ''; +$aus=array_merge($aus_header,$aus); + +$dump['xtime']=$xtime; +if ($DumpFertig!=1) $page_parameter=get_page_parameter($dump); + +//DEBUGGER +$manuell=0; + +$pagefooter=($DumpFertig==1) ? '

Daniel Schlichtholz & Steffen Kamper - Infoboard: '.$config['homepage'].'

' : ''; +$pagefooter.='
'; + +$js_aufruf_automatisch=$page_parameter.''; +$js_aufruf_manuell=''; +$selbstaufruf=($page_parameter=='') ? '' : (($manuell==1) ? $js_aufruf_manuell : $js_aufruf_automatisch); +$complete_page=$pageheader.implode("\n",$aus).$debugausgabe.$selbstaufruf.$pagefooter; +echo $complete_page; + +?> \ No newline at end of file diff --git a/mysqldumper/filemanagement.php b/mysqldumper/filemanagement.php new file mode 100644 index 0000000..36540dd --- /dev/null +++ b/mysqldumper/filemanagement.php @@ -0,0 +1,470 @@ +parent.MySQL_Dumper_content.location.href="dump.php?comment='.urlencode($dk).'";'; + + exit; +} + +//-------------------------------------------------------- +//*** Abfrage ob Dump *** +//-------------------------------------------------------- +if (isset($_POST['dump'])) +{ + $dk=(isset($_POST['dumpKommentar'])) ? ((get_magic_quotes_gpc()) ? stripslashes($_POST['dumpKommentar']) : $_POST['dumpKommentar']) : ""; + if(isset($_POST['tblfrage']) && $_POST['tblfrage']==1) { + //Tabellenabfrage + $tblfrage_refer="dump"; + include ("inc/tabellenabfrage.php"); + exit; + } else { + @TestWorkDir(); + $databases['db_actual_tableselected']=""; + WriteParams(1,$config,$databases); + + $dump['fileoperations']=0; + echo ''; + } +} + +//-------------------------------------------------------- +//*** Abfrage ob Restore nach Tabellenaufruf *** +//-------------------------------------------------------- +if (isset($_POST['restore_tbl'])) +{ + $databases['db_actual_tableselected']=substr($_POST['tbl_array'],0,strlen($_POST['tbl_array'])-1); + WriteParams(1,$config,$databases); + + echo ''; + + exit; +} +//-------------------------------------------------------- +//*** Abfrage ob Restore *** +//-------------------------------------------------------- +if (isset($_POST['restore'])) +{ + if (isset($_POST['file'])) + { + if(file_exists($config['paths']['log']."restore.tmp")) @unlink($config['paths']['log']."restore.tmp"); + if(isset($_POST['tblfrage']) && $_POST['tblfrage']==1) { + //Tabellenabfrage + $tblfrage_refer="restore"; + $filename=urldecode($_POST['file'][0]); + include ("inc/tabellenabfrage.php"); + exit; + } else { + $databases['db_actual_tableselected']=""; + WriteParams(1,$config,$databases); + echo ''; + } + } + else + $msg.= '

'.$lang['fm_nofile'].'

'.br(); +} + + +//-------------------------------------------------------- +//*** Abfrage ob Delete *** +//-------------------------------------------------------- +if (isset($_POST['delete']) ) +{ + $msg=""; + if (isset($_POST['file'])) + { + $file=$_POST['file']; + //hier muss die Abfrage checkbox/radiobox rein + if($_POST['multi']==1) { + $delfiles=Array(); + $msg.= '

'; + for($i=0;$i'; + } else { + for ($j=0; $j'; + WriteLog("deleted '$del[$j]'."); + } + } + + } + $msg.='

'; + + + } else { + + if($_POST['multipart'][0]==0) { + $delfiles[]=$_POST['file'][0]; + } else { + $delfiles[]=substr($_POST['file'][0],0,strpos($_POST['file'][0],"_part_"))."*.*"; + } + + $del=DeleteFilesM($fpath,$delfiles[0]); + if($del==0){ + $msg.= '

'.$lang['fm_delete1'].$fpath.$_POST['file'][0].$lang['fm_delete3'].'

'; + } else { + for ($j=0; $j'; + WriteLog("deleted '$del[$j]'."); + } + } + } + } + else + $msg.= '

'.$lang['fm_nofile'].'

'.br(); +} +if (isset($_POST['deleteauto']) ) $msg.='

'.AutoDelete().'

'; + +if (isset($_POST['deleteall']) ) +{ + //hier kommt alldelete rein + $del=DeleteFilesM($fpath,"*.sql"); + if($del==0){ + //$msg.="Fehler beim löschen!"; + }else{ + for ($i=0; $i'; + WriteLog("deleted '$del[$i]'."); + } + $msg.='

'; + } + $del=DeleteFilesM($fpath,"*.gz"); + +} + +if (isset($_POST['deleteallfilter']) ) +{ + //hier kommt alldelete rein + $del=DeleteFilesM($fpath,$databases['db_actual']."*"); + if($del==0){ + //$msg.="Fehler beim löschen!"; + }else{ + for ($i=0; $i'; + WriteLog("deleted '$del[$i]'."); + } + $msg.='

'; + } +} + +////////////////////////////////// +// Upload +/////////////////////////////////// +if (isset($_POST['upload'])) +{ + $error=false; + if (!isset($_FILES['upfile']['name'])) echo ''.$lang['fm_uploadfilerequest'].'

'; + else + { + if (!file_exists($fpath.$_FILES['upfile']['name'])) + { + // Extension ermitteln -strrpos fängt hinten an und ermittelt somit den letzten Punkt + $endung=strrchr($_FILES['upfile']['name'],"."); + $erlaubt=ARRAY(".gz",".sql"); + if (!in_array($endung,$erlaubt)) + { + $msg.= "".$lang['fm_uploadnotallowed1']."
"; + $msg.= $lang['fm_uploadnotallowed2']."
"; + } + else + { + if (!$error) + { + if (move_uploaded_file($_FILES['upfile']['tmp_name'],$fpath.$_FILES['upfile']['name'])) @chmod($fpath.$upfile_name,0755); + else $error.="".$lang['fm_uploadmoveerror']."
"; + } + if ($error) $msg.= $error."".$lang['fm_uploadfailed']."
"; + } + } + else $msg.= "".$lang['fm_uploadfileexists']."
"; + } +} + + +//Seitenteile vordefinieren +$href='filemanagement.php?action='.$action.'&kind='.$kind; + + + + +$tbl_abfrage=' '; +if($config['multi_dump']==0) $tbl_abfrage.=''.$lang['fm_selecttables']; +$dk= (isset($_POST['dumpKommentar'])) ? htmlentities($_POST['dumpKommentar']):''; +$tbl_abfrage.='   '.$lang['fm_comment'].':  '.br(); + +$autodel='

'.$lang['autodelete'].": "; +$abue=($config['max_backup_files_each']==1)? $lang['max_backup_files_each2'] :$lang['max_backup_files_each1']; +$abue2=($config['del_files_after_days']>0) ? $lang['age_of_files']."=".$config['del_files_after_days'].", " : ""; +$autodel.=($config['auto_delete']==0) ? $lang['not_activated'] : $lang['activated']." (".$abue2.$lang['number_of_files_form']."=".$config['max_backup_files']." -> ".$abue.")"; +$autodel.='

'.br().br(); + +//Fallunterscheidung + + + +switch ($action) { + case "dump": + //Variablen + if($config['multi_dump']==0) DBDetailInfo($databases['db_selected_index']); + $cext=($config['cron_extender']==0) ? "pl" : "cgi"; + $actualUrl=substr($_SERVER['SCRIPT_NAME'],0,strrpos($_SERVER['SCRIPT_NAME'],"/")+1); + if(substr($actualUrl,-1)!="/") $actualUrl.="/"; + if(substr($actualUrl,0,1)!="/") $actualUrl="/$actualUrl"; + $refdir=(substr($config['cron_execution_path'],0,1)=="/") ? "" : $actualUrl; + $scriptdir=$config['cron_execution_path'].'crondump.'.$cext; + $sfile=$config['cron_execution_path']."perltest.$cext"; + $simplefile=$config['cron_execution_path']."simpletest.$cext"; + $scriptentry=Realpfad("./").$config['paths']['config']; + $cronabsolute=(substr($config['cron_execution_path'],0,1)=="/") ? $_SERVER['DOCUMENT_ROOT'].$scriptdir : Realpfad("./").$scriptdir; + $confabsolute=$config['cron_configurationfile']; + $scriptref="http://".$_SERVER['SERVER_NAME'].$refdir.$config['cron_execution_path'].'crondump.'.$cext."?config=".$confabsolute; + $cronref="perl ".$cronabsolute." config=".$confabsolute; + + //Ausgabe + echo headline($lang['fm_dump_header']); + if(!is_writable($config['paths']['backup'])) die('ERROR !
Backupdir is not writable
'); + + echo (isset($msg) && $msg!="")?"$msg
":""; + echo $autodel; + + //Auswahl + echo '
+ +       + +
'; + + echo '
'; + + //Dumpsettings + echo '
'.$lang['dump'].' (PHP)
'; + + echo br(3).'
'.br(); + echo ''; + echo $tbl_abfrage; + echo '
'; + + + echo '
'.$lang['fm_dumpsettings'].' (PHP)
'; + + echo ''.$lang['db'].': '. + (($config['multi_dump']==1) ? + 'Multidump ('.count($databases['multi']).' '.$lang['dbs'].')' + : + $databases['db_actual'].'  ('.$databases['Detailinfo']['tables']." Tables, ".$databases['Detailinfo']['records']." Records, ".byte_output($databases['Detailinfo']['size']).")").''; + echo '   '.$lang['praefix'].': '.(($config['multi_dump']==1) ? '-' : $databases['praefix'][$databases['db_selected_index']]).''; + echo '
'.$lang['gzip'].': '.(($config['compression']==1) ? $lang['activated'] : $lang['not_activated']).''; + echo '   '.$lang['multi_part'].': '.(($config['multi_part']==1) ? $lang['yes'] : $lang['no']).''; + if($config['multi_part']==1) { + echo '   '.$lang['multi_part_groesse'].': '.byte_output($config['multipart_groesse']); + } + echo '
'.$lang['backup_format'].': '; + $t=''; + if($config['backup_complete_inserts']==1) $t.=$lang['inserts_complete']." / "; + if($config['backup_extended_inserts']==1) $t.=$lang['inserts_extended']." / "; + if($config['backup_ignore_inserts']==1) $t.=$lang['inserts_ignore']." / "; + if($config['backup_delayed_inserts']==1) $t.=$lang['inserts_delayed']." / "; + if($config['backup_lock_tables']==1 && $config['backup_delayed_inserts']==0) $t.=$lang['lock_tables']." / "; + $t=($t=="") ? $lang['normal'] : substr($t,0,strlen($t)-3); + if($config['backup_downgrade']==1) $t.='   '.htmlspecialchars($lang['downgrade']); + + echo $t.'
'; + + if($config['send_mail']==1) { + $t=$config['email_recipient'].(($config['send_mail_dump']==1) ? $lang['withattach'] : $lang['withoutattach']); + } + echo ''.$lang['send_mail_form'].': '.(($config['send_mail']==1) ? $t : $lang['not_activated']); + echo ''; + + echo '
'.$lang['ftp_transfer'].': '.(($config['ftp_transfer']==1) ? $lang['activated'] : $lang['not_activated']); + if($config['ftp_transfer']==1) { + echo 'Host: '.$config['ftp_server'][$config['ftp_connectionindex']].' Port '.$config['ftp_port'][$config['ftp_connectionindex']].' User: '.$config['ftp_user'][$config['ftp_connectionindex']].' Dir: '.$config['ftp_dir'][$config['ftp_connectionindex']]; + } + + echo '

'; + + echo '
'; + + break; + + case "restore": + echo headline($lang['fm_restore_header'].$databases['db_actual'].$lang['fm_restore_header2']); + echo (isset($msg) && $msg!="")?"$msg":""; + echo $autodel; + + echo br(3).'
'.br(); + echo '
'.br(); + echo ''; + echo FileList(); + echo '
'.br(); + + break; + case "files": + $sysfedit=(isset($_POST['sysfedit'])) ? 1 : 0; + $sysfedit=(isset($_GET['sysfedit'])) ? $_GET['sysfedit'] : $sysfedit; + echo headline($lang['file_manage']); + echo (isset($msg) && $msg!="") ? $msg.'
' : ''; + echo $autodel; + + echo ''.br(); + echo br(3).'
'.br(); + echo br().''.br(); + echo br().''.br(); + echo br().''.br(); + echo br().''.br(); + + echo FileList().'
'.br(); + + echo '
'.$lang['fm_fileupload'].'
'.br(); + echo '
'.br(); + echo ''.br(); + echo ''.br(); + echo '
'.$lang['max_upload_size'].': '.$config['upload_max_filesize'].''; + echo '
'.$lang['max_upload_size_info']; + + echo '
'.br(); + + echo '
Tools
'; + echo ''; + echo '
'; + + break; + case "convert": + // Konverter + echo headline($lang['converter']); + echo '

'; + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'.$lang['convert_title'].'
'.$lang['convert_file'].''.FilelisteCombo($config['paths']['backup'],$selectfile).'
'.$lang['convert_filename'].':
'.$lang['compressed'].'

'; + if(isset($_POST['startconvert'])) { + $destfile.=($compressed==1) ? ".sql.gz" : ".sql"; + echo $lang['converting']." $selectfile ==> $destfile
"; + + if($selectfile!="" && file_exists($config['paths']['backup'].$selectfile) && strlen($destfile)>2) { + Converter($selectfile,$destfile,$compressed); + } + else echo $lang['convert_wrong_parameters']; + } + +} + +echo ''.br(3); +echo MSDFooter(); + + + +?> + diff --git a/mysqldumper/images/blank.gif b/mysqldumper/images/blank.gif new file mode 100644 index 0000000..076c753 Binary files /dev/null and b/mysqldumper/images/blank.gif differ diff --git a/mysqldumper/images/h1_logo.gif b/mysqldumper/images/h1_logo.gif new file mode 100644 index 0000000..d6a339b Binary files /dev/null and b/mysqldumper/images/h1_logo.gif differ diff --git a/mysqldumper/images/konqueror.png b/mysqldumper/images/konqueror.png new file mode 100644 index 0000000..3fb315d Binary files /dev/null and b/mysqldumper/images/konqueror.png differ diff --git a/mysqldumper/images/logo.gif b/mysqldumper/images/logo.gif new file mode 100644 index 0000000..7f5bac8 Binary files /dev/null and b/mysqldumper/images/logo.gif differ diff --git a/mysqldumper/images/mozilla.png b/mysqldumper/images/mozilla.png new file mode 100644 index 0000000..fc347eb Binary files /dev/null and b/mysqldumper/images/mozilla.png differ diff --git a/mysqldumper/images/msie.png b/mysqldumper/images/msie.png new file mode 100644 index 0000000..6dbe4d0 Binary files /dev/null and b/mysqldumper/images/msie.png differ diff --git a/mysqldumper/images/omniweb.png b/mysqldumper/images/omniweb.png new file mode 100644 index 0000000..6f07f16 Binary files /dev/null and b/mysqldumper/images/omniweb.png differ diff --git a/mysqldumper/images/opera.png b/mysqldumper/images/opera.png new file mode 100644 index 0000000..9b70988 Binary files /dev/null and b/mysqldumper/images/opera.png differ diff --git a/mysqldumper/images/safari.png b/mysqldumper/images/safari.png new file mode 100644 index 0000000..683f2ea Binary files /dev/null and b/mysqldumper/images/safari.png differ diff --git a/mysqldumper/images/schriftzug_logo.png b/mysqldumper/images/schriftzug_logo.png new file mode 100644 index 0000000..04989f6 Binary files /dev/null and b/mysqldumper/images/schriftzug_logo.png differ diff --git a/mysqldumper/inc/footer.php b/mysqldumper/inc/footer.php new file mode 100644 index 0000000..ec659f4 --- /dev/null +++ b/mysqldumper/inc/footer.php @@ -0,0 +1,15 @@ +CONFIG
".@print_r($config,true)."
": ""; +$database_array=(isset($database)) ? "DATABASE
".@print_r($database,true)."
": ""; +$dump_array=(isset($dump)) ? "DUMP
".@print_r($dump,true)."
": ""; +$restore_array=(isset($restore)) ? "RESTORE
".@print_r($restore,true)."
" : ""; + +echo '

'.$lang['authors'].':  + +Daniel Schlichtholz & Steffen Kamper - Infoboard: +'. +$config['homepage'].'

'; + +echo ''; + +?> diff --git a/mysqldumper/inc/functions.php b/mysqldumper/inc/functions.php new file mode 100644 index 0000000..073f30d --- /dev/null +++ b/mysqldumper/inc/functions.php @@ -0,0 +1,439 @@ +Help'; + } else { + return 'Help'; + } +} + +function DeleteFilesM($dir, $pattern = "*.*") +{ + $deleted = false; + $pattern = str_replace(array("\*","\?"), array(".*","."), preg_quote($pattern)); + if (substr($dir,-1) != "/") $dir.= "/"; + if (is_dir($dir)) + { $d = opendir($dir); + while ($file = readdir($d)) + { if (is_file($dir.$file) && ereg("^".$pattern."$", $file)) + { + if (unlink($dir.$file)) $deleted[] = $file; + } + } + closedir($d); + return $deleted; + } + else return 0; +} + +function SetDefault($load_default=false) +{ + global $config,$databases,$nl,$out,$lang; + + //Arrays löschen + $i=0; + $old_db=$databases['db_actual']; + //unset($databases); + $databases['Name']=Array(); + + $old_lang=$config['language']; + + if($load_default==true){ + @unlink($config['files']['parameter']); + include("./config.php"); + $config['language']=$old_lang; + include("language/".$config['language']."/lang.php"); + } + + //DB-Liste holen + MSD_mysql_connect(); + + $databases['db_selected_index']=-1; + + $res = mysql_query("SHOW DATABASES ;",$config['dbconnection']); + $numrows=mysql_numrows($res); + $a=0; + for($i=0;$i<$numrows;$i++) + { + $row = mysql_fetch_row($res); + $found_db=$row[0]; + + // Testverbindung aufbauen + $res2=mysql_query("SHOW TABLES FROM `$found_db`",$config['dbconnection']); + if (!$res2===false) + { + if($found_db==$old_db) $databases['db_selected_index']=$a; + $databases['Name'][$a]=$found_db; + $databases['praefix'][$a]=""; + $databases['command_before_dump'][$a] = ""; + $databases['command_after_dump'][$a] = ""; + $out.=$lang['saving_db_form']." ".$found_db." ".$lang['added']."$nl"; + $a++; + } + } + if($databases['db_selected_index']==-1) { + $databases['db_selected_index']=0; + $databases['db_actual']=$databases['Name'][$databases['db_selected_index']]; + } else $databases['db_actual']=$databases['Name'][$databases['db_selected_index']]; + $databases['db_actual_cronpraefix']=""; + $databases['db_actual_cronindex']=$databases['db_selected_index']; + + WriteParams(1,$config,$databases); + if($load_default==false) WriteLog("default settings loaded."); + + return $out; +} + +function WriteParams($as=0,$config,$databases) +{ + global $config_dontsave; + $nl="\n"; + FillMultiDBArrays(); + //Parameter zusammensetzen + $config['multipart_groesse']=$config['multipartgroesse1']*(($config['multipartgroesse2']==1) ? 1024 : 1024*1024); + $param=$pars_all=' $val){ + if(is_array($val)) { + foreach($val as $var2 => $val2){ + if ($config['magic_quotes_gpc']==0 || $as==1) { + $pars_all.='$config[\''.$var.'\']['.((is_int($var2)) ? $var2 : "'".$var2."'").'] = \''.addslashes($val2)."';$nl"; + } else { + $pars_all.='$config[\''.$var.'\']['.((is_int($var2)) ? $var2 : "'".$var2."'").'] = \''.$val2."';$nl"; + } + } + } else { + if ($config['magic_quotes_gpc']==0 || $as==1) { + if(!in_array($var,$config_dontsave)) $pars_all.='$config[\''.$var.'\'] = \''.addslashes($val)."';$nl"; + } else { + if(!in_array($var,$config_dontsave)) $pars_all.='$config[\''.$var.'\'] = \''.$val."';$nl"; + } + } + } + foreach($databases as $var => $val){ + if(is_array($val)) { + foreach($val as $var2 => $val2){ + if ($config['magic_quotes_gpc']==0 || $as==1) { + $pars_all.='$databases[\''.$var.'\']['.((is_int($var2)) ? $var2 : "'".$var2."'").'] = \''.addslashes($val2)."';$nl"; + } else { + $pars_all.='$databases[\''.$var.'\']['.((is_int($var2)) ? $var2 : "'".$var2."'").'] = \''.$val2."';$nl"; + } + } + } else { + if ($config['magic_quotes_gpc']==0 || $as==1) { + $pars_all.='$databases[\''.$var.'\'] = \''.addslashes($val)."';$nl"; + } else { + $pars_all.='$databases[\''.$var.'\'] = \''.$val."';$nl"; + } + } + } + + + + $param.='?>'; $pars_all.='?>'; + + //Datei öffnen und schreiben + $ret=true; + @chmod($config['files']['parameter'], 0777); + if ($fp=fopen($config['files']['parameter'], "wb")) + { + if (!fwrite($fp,$pars_all)) $ret=false; + if (!fclose($fp)) $ret=false; + } + else $ret=false; + + $ret=WriteCronScript($config,$databases); + + return $ret; +} + +function WriteCronScript($config,$databases) +{ + + global $nl, $cron_save_all_dbs, + $cron_db_array,$cron_dbpraefix_array,$cron_db_cbd_array,$cron_db_cad_array; + + $tomask=Array('@'=>'\@','$'=>'\$','\\'=>'\\\\'); + + if(!isset($databases['praefix'][$databases['db_selected_index']])) $databases['praefix'][$databases['db_selected_index']]=""; + if(!isset($databases['db_actual_cronindex'])) $databases['db_actual_cronindex']=$databases['db_selected_index']; + if(!isset($config['email_maxsize'])) $config['email_maxsize']=$config['email_maxsize1']*(($config['email_maxsize2']==1) ? 1024 : 1024*1024); + + if($config['cron_samedb']==0) { + $cron_dbname=$databases['db_actual']; + $cron_dbpraefix = $databases['praefix'][$databases['db_selected_index']]; + }else { + if($databases['db_actual_cronindex']>=0) { + $cron_dbname=$databases['Name'][$databases['db_actual_cronindex']]; + $cron_dbpraefix = $databases['db_actual_cronpraefix']; + + } else { + $cron_dbname=$databases['db_actual']; + $cron_dbpraefix = $databases['praefix'][$databases['db_selected_index']]; + } + } + + if($databases['db_actual_cronindex']<0) { + $csadb='$cron_save_all_dbs=1;'.$nl; + $csadb.='$cron_db_array=qw('.$cron_db_array.');'.$nl; + $csadb.='$cron_dbpraefix_array=qw('.$cron_dbpraefix_array.');'.$nl; + $csadb.='$dbpraefix="";'.$nl; + $csadb.='$command_beforedump_array="'.$cron_db_cbd_array.'";'.$nl; + $csadb.='$command_afterdump_array="'.$cron_db_cad_array.'";'.$nl; + } else { + $csadb='$cron_save_all_dbs=0;'.$nl; + $csadb.='$cron_db_array="";'.$nl; + $csadb.='$cron_dbpraefix_array="";'.$nl; + $csadb.='$dbpraefix="'.$cron_dbpraefix.'";'.$nl; + $csadb.='$command_beforedump_array="'.$databases['command_before_dump'][$databases['db_selected_index']].'";'.$nl; + $csadb.='$command_afterdump_array="'.$databases['command_after_dump'][$databases['db_selected_index']].'";'.$nl; + } + + + $r=str_replace("\\\\","/",$config['paths']['root']); + $r=str_replace("@","\@",$r); + $p1=$r.$config['paths']['backup']; + $p2=$r.$config['files']['perllog'].(($config['logcompression']==1) ? '.gz':''); + $p3=$r.$config['files']['perllogcomplete'].(($config['logcompression']==1) ? '.gz':''); + + $cronscript="#Vars - written at ".date("Y-m-d").$nl; + $cronscript.='$dbhost="'.$config['dbhost'].'";'.$nl; + $cronscript.='$dbname="'.$cron_dbname.'";'.$nl; + $cronscript.='$dbuser="'.$config['dbuser'].'";'.$nl; + $cronscript.='$dbpass="'.$config['dbpass'].'";'.$nl; + $cronscript.=$csadb; + $cronscript.='$compression='.$config['cron_compression'].';'.$nl; + $cronscript.='$backup_path="'.$p1.'";'.$nl; + $cronscript.='$logdatei="'.$p2.'";'.$nl; + $cronscript.='$completelogdatei="'.$p3.'";'.$nl; + $cronscript.='$nl="\n";'.$nl; + $cronscript.='$cron_printout='.$config['cron_printout'].';'.$nl; + $cronscript.='$cronmail='.$config['cron_mail'].';'.$nl; + $cronscript.='$cronmail_dump='.$config['cron_mail_dump'].';'.$nl; + $cronscript.='$cronmailto="'.strtr($config['email_recipient'],$tomask).'";'.$nl; + $cronscript.='$cronmailfrom="'.strtr($config['email_sender'],$tomask).'";'.$nl; + $cronscript.='$cronftp='.$config['cron_ftp'].';'.$nl; + $cronscript.='$ftp_server="'.$config['ftp_server'][$config['ftp_connectionindex']].'";'.$nl; + $cronscript.='$ftp_port='.$config['ftp_port'][$config['ftp_connectionindex']].';'.$nl; + $cronscript.='$ftp_user="'.$config['ftp_user'][$config['ftp_connectionindex']].'";'.$nl; + $cronscript.='$ftp_pass="'.strtr($config['ftp_pass'][$config['ftp_connectionindex']],$tomask).'";'.$nl; + $cronscript.='$ftp_dir="'.$config['ftp_dir'][$config['ftp_connectionindex']].'";'.$nl; + $cronscript.='$mp='.$config['multi_part'].';'.$nl; + $cronscript.='$multipart_groesse='.$config['multipart_groesse'].';'.$nl; + $cronscript.='$email_maxsize='.$config['email_maxsize'].';'.$nl; + $cronscript.='$auto_delete='.$config['auto_delete'].';'.$nl; + $cronscript.='$cron_del_files_after_days='.$config['del_files_after_days'].';'.$nl; + $cronscript.='$max_backup_files='.$config['max_backup_files'].';'.$nl; + $cronscript.='$max_backup_files_each='.$config['max_backup_files_each'].';'.$nl; + $cronscript.='$perlspeed='.$config['perlspeed'].';'.$nl; + $cronscript.='$optimize_tables_beforedump='.$config['optimize_tables_beforedump'].';'.$nl; + $cronscript.='$logcompression='.$config['logcompression'].';'.$nl; + $cronscript.='$log_maxsize='.$config['log_maxsize'].';'.$nl; + $cronscript.='$backup_complete_inserts='.$config['backup_complete_inserts'].';'.$nl; + $cronscript.='$backup_extended_inserts='.$config['backup_extended_inserts'].';'.$nl; + $cronscript.='$backup_delayed_inserts='.$config['backup_delayed_inserts'].';'.$nl; + $cronscript.='$backup_ignore_inserts='.$config['backup_ignore_inserts'].';'.$nl; + $cronscript.='$backup_lock_tables='.$config['backup_lock_tables'].';'.$nl; + $cronscript.='$complete_log='.$config['cron_completelog'].';'.$nl; + $cronscript.='$my_comment="";'.$nl; + $cronscript.='1;'; + + + //Datei öffnen und schreiben + $ret=true; + + + + $ext=($config['cron_extender']==0) ? "pl" : "cgi"; + + $sfile=$config['paths']['config'].$config['cron_configurationfile']; + + @chmod("$sfile",0777); + if ($fp=fopen($sfile, "wb")) + { + if (!fwrite($fp,$cronscript)) $ret=false; + if (!fclose($fp)) $ret=false; + } + else $ret=false; + + if(!file_exists($config['paths']['config']."mysqldumper.conf")) { + $sfile=$config['paths']['config']."mysqldumper.conf"; + if ($fp=fopen($sfile, "wb")) + { + if (!fwrite($fp,$cronscript)) $ret=false; + if (!fclose($fp)) $ret=false; + //chmod("$sfile",0755); + } + else $ret=false; + } + return $ret; + +} + +function LogFileInfo($logcompression) { + global $config; + + $l=Array();$sum=$s=$l['log_size']=$l['perllog_size']=$l['perllogcomplete_size']=$l['errorlog_size']=$l['log_totalsize']=0; + if($logcompression==1) { + $l['log']=$config['files']['log'].".gz"; + $l['perllog']=$config['files']['perllog'].".gz"; + $l['perllogcomplete']=$config['files']['perllogcomplete'].".gz"; + $l['errorlog']=$config['paths']['log']."error.log.gz"; + } else { + $l['log']=$config['files']['log']; + $l['perllog']=$config['files']['perllog']; + $l['perllogcomplete']=$config['files']['perllogcomplete']; + $l['errorlog']=$config['paths']['log']."error.log"; + } + $l['log_size']+=@filesize($l['log']);$sum+=$l['log_size']; + $l['perllog_size']+=@filesize($l['perllog']);$sum+=$l['perllog_size']; + $l['perllogcomplete_size']+=@filesize($l['perllogcomplete']);$sum+=$l['perllogcomplete_size']; + $l['errorlog_size']+=@filesize($l['errorlog']);$sum+=$l['errorlog_size']; + $l['log_totalsize']+=$sum; + + + return $l; +} + +function DeleteLog() +{ + global $config; + //Datei öffnen und schreiben + $log=date('d.m.Y H:i:s')." Log created.\n"; + if($config['logcompression']==1) { + $fp = @gzopen($config['files']['log'].'.gz', "wb"); + @gzwrite ($fp,$log); + @gzclose ($fp); + @chmod($config['files']['log'].'.gz',0755); + } else { + $fp = @fopen($config['files']['log'], "wb"); + @fwrite ($fp,$log); + @fclose ($fp); + @chmod($config['files']['log'],0755); + } +} + +function SwitchLogfileFormat() +{ + global $config; + $del=DeleteFilesM($config['paths']['log'],"*"); + DeleteLog(); +} + + +function CreateDirsFTP() { + + global $lang,$install_ftp_server,$install_ftp_port,$install_ftp_user_name,$install_ftp_user_pass,$install_ftp_path; + // Herstellen der Basis-Verbindung + echo '
'.$lang['connect_to'].' `'.$install_ftp_server.'` Port '.$install_ftp_port.' ...
'; + $conn_id = ftp_connect($install_ftp_server); + // Einloggen mit Benutzername und Kennwort + $login_result = ftp_login($conn_id, $install_ftp_user_name, $install_ftp_user_pass); + // Verbindung überprüfen + if ((!$conn_id) || (!$login_result)) { + echo $lang['ftp_notconnected']; + echo $lang['connwith']." $tinstall_ftp_server ".$lang['asuser']." $install_ftp_user_name ".$lang['notpossible']; + return 0; + } else { + + //Wechsel in betroffenes Verzeichnis + echo $lang['changedir'].' `'.$install_ftp_path.'` ...
'; + ftp_chdir($conn_id,$install_ftp_path); + // Erstellen der Verzeichnisse + echo $lang['dircr1'].' ...
'; + ftp_mkdir($conn_id,"work"); + ftp_site($conn_id, "CHMOD 0777 work"); + echo $lang['changedir'].' `work` ...
'; + ftp_chdir($conn_id,"work"); + echo $lang['indir'].' `'.ftp_pwd($conn_id).'`
'; + echo $lang['dircr5'].' ...
'; + ftp_mkdir($conn_id,"config"); + ftp_site($conn_id, "CHMOD 0777 config"); + echo $lang['dircr2'].' ...
'; + ftp_mkdir($conn_id,"backup"); + ftp_site($conn_id, "CHMOD 0777 backup"); + echo $lang['dircr3'].' ...
'; + ftp_mkdir($conn_id,"structure"); + ftp_site($conn_id, "CHMOD 0777 structure"); + echo $lang['dircr4'].' ...
'; + ftp_mkdir($conn_id,"log"); + ftp_site($conn_id, "CHMOD 0777 log"); + + // Schließen des FTP-Streams + ftp_quit($conn_id); + return 1; + } +} + +function ftp_mkdirs($config,$dirname) +{ + $dir=split("/", $dirname); + for ($i=0;$i"; + } else echo '
'.$lang['found_no_db'].' `'.$config['dbonly']."` !
"; + } else { + $db_list = @mysql_list_dbs($config['dbconnection']); + $i=0; + if($db_list && @mysql_num_rows($db_list)>0) { + $databases['db_selected_index'] = 0; + while ($row = @mysql_fetch_row($db_list)) + { + // Test-Select um zu sehen, ob Berechtigungen existieren + if(mysql_query("SHOW TABLES FROM `".$row[0]."`",$config['dbconnection'])) + { + $databases['Name'][$i]=$row[0]; + $databases['praefix'][$i] = ""; + $databases['command_before_dump'][$i] = ""; + $databases['command_after_dump'][$i] = ""; + + if($printout==1) echo $lang['found_db'].' `'.$row[0].'`
'; + } + } + $databases['db_actual']=$databases['Name'][0]; + $databases['db_selected_index']=0; + } else { + if($printout==1) echo $lang['dbonlyneed'].'
'; + } + } +} + +?> \ No newline at end of file diff --git a/mysqldumper/inc/functions_dump.php b/mysqldumper/inc/functions_dump.php new file mode 100644 index 0000000..d6539c7 --- /dev/null +++ b/mysqldumper/inc/functions_dump.php @@ -0,0 +1,475 @@ +'.$lang['startdump'].'`'.$databases['Name'][$dump['dbindex']].'`'.(($databases['praefix'][$dump['dbindex']]!="") ?' ('.$lang['withpraefix'].' '.$databases['praefix'][$dump['dbindex']].')' : '').'... '; + ExecuteCommand('b'); + if($dump['part']==1) + { + $dump['table_offset']=0; + $dump['countdata']=0; + } + // Seitenerstaufruf -> Backupdatei anlegen + + $dump['data']=$statuszeile.$mysql_commentstring.' Dump created at '.$cur_time.$nl.$nl; + $dump['structure']=$mysql_commentstring.' Status:0:0::'.$databases['Name'][$dump['dbindex']]; + $dump['structure'].=":php:".MSD_VERSION.$nl; + $dump['structure'].=$mysql_commentstring.' Dump by MySQLDumper '.MSD_VERSION.' ('.$config['homepage'].')'.$nl; + $dump['structure'].=$mysql_commentstring.' Dump created on '.$cur_time.$nl.$mysql_commentstring.' This file only contains the structure of the database without data \n\n'; + + } + else + { + if($config['multi_part']!=0) { + WriteLog('Continue Multipart-Dump with File '.($dump['part']-$dump['part_offset']).' (last file was '.$last_groesse.' Bytes)'); + $dump['data']=$statuszeile.$mysql_commentstring.' This is part '.($dump['part']-$dump['part_offset']).' of the backup.'.$nl.$nl.$dump['data']; + + } + } + WriteToDumpFile(); + $dump['part']++; +} + +function GetStatusLine($kind="php") +{ + /*AUFBAU der Statuszeile: + -- Status:tabellenzahl:datensätze:Multipart:Datenbankname:script:scriptversion:Kommentar:MySQLVersion:Backupflags:SQLBefore:SQLAfter:EXTINFO + Aufbau Backupflags (1 Zeichen pro Flag, 0 oder 1, 2=unbekannt) + (complete inserts)(extended inserts)(ignore inserts)(delayed inserts)(downgrade)(lock tables)(optimize tables) + */ + + global $databases,$config, $dump,$mysql_commentstring; + + $t_array=explode("|",$databases['db_actual_tableselected']); + $t=0; + $r=0; + $t_zeile="$mysql_commentstring\n$mysql_commentstring TABLE-INFO\n"; + MSD_mysql_connect(); + $res=mysql_query("SHOW TABLE STATUS FROM `".$databases['Name'][$dump['dbindex']]."`"); + $numrows=mysql_num_rows($res); + for($i=0;$i<$numrows;$i++) { + $erg=mysql_fetch_array($res); + if(($databases['db_actual_tableselected']=="" || ($databases['db_actual_tableselected']!="" && (in_array($erg[0],$t_array)))) && (substr($erg[0],0,strlen($databases['praefix'][$dump['dbindex']]))==$databases['praefix'][$dump['dbindex']])) { + $t++;$r+=$erg['Rows']; + $t_zeile.="$mysql_commentstring TABLE|".$erg['Name']."|".$erg['Rows']."|".($erg['Data_length']+$erg['Index_length'])."|".$erg['Update_time']."\n"; + } + } + //$dump['totalrecords']=$r; + $flags=$config['backup_complete_inserts'].$config['backup_extended_inserts'].$config['backup_ignore_inserts'].$config['backup_delayed_inserts'].$config['backup_downgrade'].$config['backup_lock_tables'].$config['optimize_tables_beforedump']; + + $mp=($config['multi_part']==1) ? $mp="MP_".($dump['part']-$dump['part_offset']) : "MP_0"; + $statusline="$mysql_commentstring Status:$t:$r:$mp:".$databases['Name'][$dump['dbindex']].":$kind:".MSD_VERSION.":".$dump['kommentar'].":"; + $statusline.=MSD_MYSQL_VERSION.":$flags:::EXTINFO\n".$t_zeile."$mysql_commentstring"." EOF TABLE-INFO\n$mysql_commentstring\n\n"; + return $statusline; +} + +// Liest die Eigenschaften der Tabelle aus der DB und baut die CREATE-Anweisung zusammen +function get_def($db, $table,$withdata=1) +{ + global $config,$nl,$mysql_commentstring; + + $def = "\n\n$mysql_commentstring\n$mysql_commentstring Create Table `$table`\n$mysql_commentstring\n\nDROP TABLE IF EXISTS `$table`;\n"; + mysql_select_db($db); + $result = mysql_query('SHOW CREATE TABLE `'.$table.'`',$config['dbconnection']); + $row=mysql_fetch_row($result); + $def .= (($config['backup_downgrade']==1) ? DownGrade($row[1],false) : $row[1].';')."\n\n"; + + if($withdata==1) { + $def.="$mysql_commentstring\n$mysql_commentstring Data for Table `$table`\n$mysql_commentstring\n\n"; + if($config['backup_delayed_inserts']==0) $def.="/*!40000 ALTER TABLE `$table` DISABLE KEYS */;".$nl; + if($config['backup_lock_tables']==1 && $config['backup_delayed_inserts']==0) $def.="LOCK TABLES `$table` WRITE;\n\n"; + } + return $def; +} + + +// Liest die Daten aus der DB aus und baut die INSERT-Anweisung zusammen +function get_content($db, $table) +{ + global $config,$nl,$dump,$buffer; + + $content=''; + $delayed=(isset($config['backup_delayed_inserts']) && $config['backup_delayed_inserts']==1) ? 'DELAYED ' : ''; + $complete=(isset($config['backup_complete_inserts']) && $config['backup_complete_inserts']==1) ? Fieldlist($db,$table).' ':''; + $ignore=(isset($config['backup_ignore_inserts']) && $config['backup_ignore_inserts']==1) ? 'IGNORE ':''; + + $table_ready=0; + $query='SELECT * FROM `'.$table.'` LIMIT '.$dump['zeilen_offset'].','.($dump['restzeilen']+1); + mysql_select_db($db); + $result = mysql_query($query,$config['dbconnection']); + $ergebnisse=mysql_num_rows($result); + $num_felder=mysql_num_fields($result); + $first=1; + + if ($ergebnisse>$dump['restzeilen']) + { + $dump['zeilen_offset']+=$dump['restzeilen']; + $ergebnisse--; + $dump['restzeilen']=0; + } + else + { + $dump['table_offset']++; + $dump['zeilen_offset']=0; + $dump['restzeilen']=$dump['restzeilen']-$ergebnisse; + $table_ready=1; + } + $ax=0; + for ($x=0;$x<$ergebnisse;$x++) + { + $row=mysql_fetch_row($result); + $ax++; + + if($config['backup_extended_inserts']==0 || ($config['backup_extended_inserts']==1 && $first==1 && $ax==1) ) { + $insert = 'INSERT '.$delayed.$ignore.'INTO `'.$table.'` '.$complete.'VALUES ('; + $first=0; + } else $insert='('; + + + for($j=0; $j<$num_felder;$j++) + { + if(!isset($row[$j])) $insert .= 'NULL,'; + else if($row[$j] != '') $insert.= '\''.mysql_escape_string($row[$j]).'\','; + else $insert .= '\'\','; + } + $insert = ereg_replace(',$','',$insert); + if(strlen($dump['data'])>400000 || $x==($ergebnisse-1)) { + $ax=0;$first=1; + } + $insert .= ($config['backup_extended_inserts']==0 || $x==($ergebnisse-1) || $ax==0) ? ");\n" : '),'; + $dump['data'] .= $insert; + $dump['countdata']++; + if(strlen($dump['data'])>$config['memory_limit'] || ($config['multi_part']==1 && strlen($dump['data'])+$buffer>$config['multipart_groesse']) ) { + WriteToDumpFile(); + } + } + + if($table_ready==1 && $config['backup_lock_tables']==1 && $config['backup_delayed_inserts']==0) $dump['data'].="\nUNLOCK TABLES;"; + if($table_ready==1 && $config['backup_delayed_inserts']==0) $dump['data'].="\n/*!40000 ALTER TABLE `$table` ENABLE KEYS */;\n\n"; + mysql_free_result($result); +} + +function WriteToDumpFile() +{ + global $config,$dump,$buffer; + $dump['filesize']=0; + + $df=$config['paths']['backup'].$dump['backupdatei']; + $sf=$config['paths']['structure'].$dump['backupdatei_structure']; + + if ($config['compression']==1) + { + if($dump['data']!='') { + $fp = gzopen ($df,'ab'); + gzwrite ($fp,$dump['data']); gzclose ($fp); + } + if($dump['structure']!='') { + $fp = gzopen ($sf,'ab'); + gzwrite ($fp,$dump['structure']); gzclose ($fp); + } + } + else + { + if($dump['data']!='') { + $fp = fopen ($df,'ab'); + fwrite ($fp,$dump['data']);fclose ($fp); + } + if($dump['structure']!='') { + $fp = fopen ($sf,'ab'); + fwrite ($fp,$dump['structure']); fclose ($fp); + } + } + $dump['data']=$dump['structure']=''; + if(!isset($dump['fileoperations'])) $dump['fileoperations']=0; + $dump['fileoperations']++; + + if ($config['multi_part']==1) clearstatcache(); + $dump['filesize']=filesize($df); + if ($config['multi_part']==1 && $dump['filesize']+$buffer>$config['multipart_groesse']) + new_file($dump['filesize']); // Wenn maximale Dateigroesse erreicht -> neues File starten +} + +function ExecuteCommand($when) +{ + global $config,$databases,$dump,$out,$lang; + + if($when=='b') { // before dump + $cd=$databases['command_before_dump'][$dump['dbindex']]; + $cap='before Dump'; $lf='
'; + } else { + $cd=$databases['command_after_dump'][$dump['dbindex']]; + $cap='after Dump'; $lf=''; + } + + if($cd!='') { + //jetzt ausführen + if(substr(strtolower($cd),0,7)!='system:') { + @mysql_select_db($databases['Name'][$dump['dbindex']]); + if(strpos($cd,';')) { + $cad=explode(';',$cd); + for($i=0;$iERROR executing Query '.$cap.'
'; + } else { + WriteLog("executing Query $cap ($cd) was successful"); + $out.=$lf.'executing Query '.$cap.' was successful
'; + } + } elseif(substr(strtolower($cd),0,7)=="system:") { + //$result=@system(substr($cd,7),$returnval); + $cap=substr($cd,7); + $result=1; + if(!$result) { + WriteLog("Error while executing System Command $cap"); + $dump['errors']++; + $out.=$lf.'ERROR executing System Command '.$cap.'
'; + } else { + WriteLog("executing System Command $cap was successful. [$returnval]"); + $out.=$lf.'executing System Command '.$cap.' was successful
'; + } + } + } + +} + +function DoEmail() +{ + global $config,$dump,$databases,$email,$lang,$out,$REMOTE_ADDR; + + $header=""; + if($config['cron_use_sendmail']==1) { + //sendmail + if(ini_get("sendmail_path")!=$config['cron_sendmail']) @ini_set("SMTP",$config['cron_sendmail']); + if(ini_get("sendmail_from")!=$config['email_sender']) @ini_set("SMTP",$config['email_sender']); + } else { + //SMTP + } + if(ini_get("SMTP")!=$config['cron_smtp']) @ini_set("SMTP",$config['cron_smtp']); + if(ini_get("smtp_port")!=25) @ini_set("smtp_port",25); + + + if($config['multi_part']==0) { + $file = $dump['backupdatei']; + $file_name=(strpos("/",$file)) ? substr($file,strrpos("/",$file)) : $file; + $file_type = filetype($config['paths']['backup'].$file); + $file_size = filesize($config['paths']['backup'].$file); + if(($config['email_maxsize']>0 && $file_size>$config['email_maxsize']) || $config['send_mail_dump']==0) { + //anhang zu gross + $subject = "Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y H:i",time()); + $header.= "FROM:".$config['email_sender']."\n"; + $header.= "MIME-version: 1.0\n"; + $header .= "X-Mailer: PHP/" . phpversion(). "\n"; + $header .= "X-Sender-IP: $REMOTE_ADDR\n"; + $header .= "Content-Type: text/html"; + if($config['send_mail_dump']!=0) { + $msg_body = sprintf(addslashes($lang['emailbody_toobig']),byte_output($config['email_maxsize']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")
"); + } else { + $msg_body = sprintf(addslashes($lang['emailbody_noattach']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")"); + } + $msg_body.=''.$file.''; + $email_log="Email sent to '".$config['email_recipient']."'"; + $email_out=$lang['email_was_send']."`".$config['email_recipient']."`
"; + } else { + //alles ok, anhang generieren + $msg_body = sprintf(addslashes($lang['emailbody_attach']),$databases['Name'][$dump['dbindex']],"$file (".byte_output(filesize($config['paths']['backup'].$file)).")"); + $subject = "Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y",time()); + $fp = fopen($config['paths']['backup'].$file, "r"); + $contents = fread($fp, $file_size); + $encoded_file = chunk_split(base64_encode($contents)); + fclose($fp); + $header.= "FROM:".$config['email_sender']."\n"; + $header.= "MIME-version: 1.0\n"; + $header.= "Content-type: multipart/mixed; "; + $header.= "boundary=\"Message-Boundary\"\n"; + $header.= "Content-transfer-encoding: 7BIT\n"; + $header.= "X-attachments: $file_name"; + $body_top = "--Message-Boundary\n"; + $body_top.= "Content-type: text/html\n"; + $body_top.= "Content-transfer-encoding: 7BIT\n"; + $body_top.= "Content-description: Mail message body\n\n"; + $msg_body = $body_top . $msg_body; + $msg_body.= "\n\n--Message-Boundary\n"; + $msg_body.= "Content-type: $file_type; name=\"$file\"\n"; + $msg_body.= "Content-Transfer-Encoding: BASE64\n"; + $msg_body.= "Content-disposition: attachment; filename=\"$file\"\n\n"; + $msg_body.= "$encoded_file\n"; + $msg_body.= "--Message-Boundary--\n"; + $email_log="Email was sent to '".$config['email_recipient']."' with '".$dump['backupdatei']."'."; + $email_out=$lang['email_was_send']."`".$config['email_recipient']."`".$lang['with']."`".$dump['backupdatei']."`.
"; + } + } else { + //Multipart + $mp_sub="Backup '".$databases['Name'][$dump['dbindex']]."' - ".date("d\.m\.Y",time()); + $subject = $mp_sub; + $header.= "FROM:".$config['email_sender']."\n"; + $header.= "MIME-version: 1.0\n"; + $header .= "X-Mailer: PHP/" . phpversion(). "\n"; + $header .= "X-Sender-IP: $REMOTE_ADDR\n"; + $header .= "Content-Type: text/html"; + $dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],"part_"))."part_"; + $dateiendung=($config['compression']==1)?".sql.gz":".sql"; + $mpdatei=Array(); + $mpfiles=""; + for ($i=1;$i<($dump['part']-$dump['part_offset']);$i++) { + $mpdatei[$i-1]=$dateistamm.$i.$dateiendung; + $sz=byte_output(@filesize($config['paths']['backup'].$mpdatei[$i-1])); + $mpfiles.=$mpdatei[$i-1]." (".$sz.")
"; + } + $msg_body = ($config['send_mail_dump']==1) ? sprintf(addslashes($lang['emailbody_mp_attach']),$databases['Name'][$dump['dbindex']],$mpfiles) : sprintf(addslashes($lang['emailbody_mp_noattach']),$databases['Name'][$dump['dbindex']],$mpfiles); + $email_log="Email was sent to '".$config['email_recipient']."'"; + $email_out=$lang['email_was_send']."`".$config['email_recipient']."`
"; + } + if (@mail($config['email_recipient'], stripslashes($subject), $msg_body, $header)) { + $out.= ''.$email_out.''; + WriteLog("$email_log"); + } else { + $out.=''.$lang['mailerror'].'
'; + WriteLog("Email to '".$config['email_recipient']."' failed !"); + ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: '.stripslashes($subject),$lang['mailerror']); + $dump['errors']++; + } + + if(isset($mpdatei) && $config['send_mail_dump']==1) { // && ($config['email_maxsize']==0 || ($config['email_maxsize']>0 && $config['multipartgroesse2']<=$config['email_maxsize']))) { + for($i=0;$i"; + + if (@mail($config['email_recipient'], stripslashes($subject), $msg_body, $header)) { + $out.= ''.$email_out.''; + WriteLog("$email_log"); + } else { + $out.=''.$lang['mailerror'].'
'; + WriteLog("Email to '".$config['email_recipient']."' failed !"); + ErrorLog("Email ",$databases['Name'][$dump['dbindex']],'Subject: '.stripslashes($subject),$lang['mailerror']); + $dump['errors']++; + } + } + } +} + + + +function DoFTP() +{ + global $config,$dump,$out; + + if($config['multi_part']==0) { + SendViaFTP($dump['backupdatei'],1); + } else { + $dateistamm=substr($dump['backupdatei'],0,strrpos($dump['backupdatei'],"part_"))."part_"; + $dateiendung=($config['compression']==1)?".sql.gz":".sql"; + for ($i=1;$i<($dump['part']-$dump['part_offset']);$i++) { + $mpdatei=$dateistamm.$i.$dateiendung; + SendViaFTP($mpdatei,$i); + } + } + $out.=''."file sent via FTP (".$dump['backupdatei']." => ".$config['ftp_server'][$config['ftp_connectionindex']].")

"; +} + +function SendViaFTP($source_file,$conn_msg=1) +{ + global $config,$out,$lang; + flush(); + if($conn_msg==1) $out.=''.$lang['filesendftp']."(".$config['ftp_server'][$config['ftp_connectionindex']]." - ".$config['ftp_user'][$config['ftp_connectionindex']].")
"; + + + // Herstellen der Basis-Verbindung + if($config['ftp_useSSL']==0) + $conn_id = ftp_connect($config['ftp_server'][$config['ftp_connectionindex']], $config['ftp_port'][$config['ftp_connectionindex']],$config['ftp_timeout']); + else + $conn_id = ftp_ssl_connect($config['ftp_server'][$config['ftp_connectionindex']], $config['ftp_port'][$config['ftp_connectionindex']],$config['ftp_timeout']); + // Einloggen mit Benutzername und Kennwort + $login_result = ftp_login($conn_id, $config['ftp_user'][$config['ftp_connectionindex']], $config['ftp_pass'][$config['ftp_connectionindex']]); + + // Verbindung überprüfen + if ((!$conn_id) || (!$login_result)) { + $out.= ''.$lang['ftpconnerror'].$config['ftp_server'][$config['ftp_connectionindex']].$lang['ftpconnerror1'].$config['ftp_user'][$config['ftp_connectionindex']].$lang['ftpconnerror2'].'
'; + exit; + } else { + if($conn_msg==1) $out.= ''.$lang['ftpconnected1'].$config['ftp_server'][$config['ftp_connectionindex']].$lang['ftpconnerror1'].$config['ftp_user'][$config['ftp_connectionindex']].'
'; + } + + // Upload der Datei + $dest=$config['ftp_dir'][$config['ftp_connectionindex']].$source_file; + $source=$config['paths']['backup'].$source_file; + $upload = @ftp_put($conn_id, $dest,$source , FTP_BINARY); + + // Upload-Status überprüfen + if (!$upload) { + $out.= ''.$lang['ftpconnerror3']."
($source -> $dest)

"; + } else { + $out.= ''.$lang['file'].' '.$source_file.''.$lang['ftpconnected2'].$config['ftp_server'][$config['ftp_connectionindex']].$lang['ftpconnected3'].'
'; + WriteLog("'$source_file' sent via FTP."); + } + + // Schließen des FTP-Streams + @ftp_quit($conn_id); +} +?> \ No newline at end of file diff --git a/mysqldumper/inc/functions_files.php b/mysqldumper/inc/functions_files.php new file mode 100644 index 0000000..6a82298 --- /dev/null +++ b/mysqldumper/inc/functions_files.php @@ -0,0 +1,350 @@ +'; + $r.=''; + + $dh = opendir($fpath); + while (false !== ($filename = readdir($dh))) + { + if ($filename != "." && $filename != ".." && !is_dir($fpath.$filename)) { + $r.='
'; + $r.='
'."\n"; + $r.=''."\n"; + $r.=''."\n"; + $r.=''."\n"; + $r.=''."\n"; + $r.=''."\n"; + + $vi= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + $vi.= ''."\n"; + + $formvi=str_replace("<","<",$vi); + $formvi=str_replace(">",">",$formvi); + + //Form-vars + $r.=$vi.''; + $r.=''; + $r.=''; + + $r.= ''; + + + $r.= "

'.$subject.'

Absender
Name
Art des Fehlers
Anzeige des Fehlers
zusätzliche Bemerkungen
MySQLDump-Version'.MSD_VERSION.'
MySQL-Version'.MSD_MYSQL_VERSION.'
PHP-Version'.phpversion().'
PHP-Extensions'.implode(" ",get_loaded_extensions()).'
safe_mode'.(($config['safe_mode']==1) ? "on" : "off").'
magic_quotes'.(($config['magic_quotes_gpc']==1) ? "on" : "off").'
Variable rootdir'.addslashes($config['paths']['root']).'
Server PHP_SELF'.$_SERVER['PHP_SELF'].'
Server Path'. addslashes(str_replace(';',";
",str_replace('\\','/',$_SERVER['PATH']))).'
Server Script-Filename'.$_SERVER['SCRIPT_FILENAME'].'
Server Script-Name'.$_SERVER['SCRIPT_NAME'].'
Global PHP_SELF'.$PHP_SELF.'
Global Path'. addslashes($PATH).'
Global Path-Translated'. addslashes($PATH_TRANSLATED).'
Global Script-Filename'.addslashes($SCRIPT_FILENAME).'
Global Script-Name'.addslashes($SCRIPT_NAME).'


Home".MSDFooter(); + return $r; +} + +function TesteFTP($ftp_server,$ftp_port,$ftp_user_name,$ftp_user_pass,$ftp_dir) +{ + global $lang,$config; + if(!isset($config['ftp_timeout'])) $config['ftp_timeout']=60; + + if($ftp_port=="" || $ftp_port==0) $ftp_port=21; + $pass=-1; + if(!extension_loaded("ftp")) { + $s=''.$lang['noftppossible'].'+++'; + } else $pass=0; + + if($pass==0) { + if($ftp_server=="" || $ftp_user_name=="" || $ftp_user_pass=="") { + $s=''.$lang['wrongconnectionpars'].''; + } else $pass=1; + } + + + if($pass==1) { + $s=$lang['connect_to'].' `'.$ftp_server.'` Port '.$ftp_port.'
'; + + if($config['ftp_useSSL']==0) { + $conn_id = @ftp_connect($ftp_server,$ftp_port,$config['ftp_timeout']); + } else { + $conn_id = @ftp_ssl_connect($ftp_server,$ftp_port,$config['ftp_timeout']); + } + if ($conn_id) $login_result = @ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); + if(!$conn_id || (!$login_result)) { + $s.=''.$lang['conn_not_possible'].''; + } else $pass=2; + } + + if($pass==2) { + $s.='
Login ok
'.$lang['changedir'].' `'.$ftp_dir.'` ... '; + $dirc=@ftp_chdir($conn_id,$ftp_dir); + if(!$dirc) { + $s.='
'.$lang['changedirerror'].''; + } else $pass=3; + @ftp_close($conn_id); + } + if($pass==3) $s.='

'.$lang['ftp_ok'].''; + return $s; +} + + + +function Realpfad($p) { + global $config; + if(!isset($config['disabled'])) $config['disabled']=ini_get("disable_functions"); + if(strpos($config['disabled'],"realpath")) + $s=getcwd(); + else + $s=realpath($p); + $s=str_replace("\\","/",$s); + if(substr($s,-1)!="/") $s.="/"; + return $s; +} + +function GetPerlConfigs() { + global $config; + $default=$config['cron_configurationfile']; + $dh = opendir($config['paths']['config']); + $r=""; + while (false !== ($filename = readdir($dh))) + { + if ($filename != "." && $filename != ".." && !is_dir($config['paths']['config'].$filename) && substr($filename,-5)==".conf") { + $f=substr($filename,0,strlen($filename)-5); + $r.=''.$end."\n"; + } elseif($k=="radio") { + $r.=$start.'   '.$lang[$filename].$end."\n"; + } + } + } + return $r; +} + +function headline($title,$mainframe=1) { + global $config,$lang; + $s=""; + if($config['interface_server_caption']==1) { + if($config['interface_server_caption_position']==$mainframe) { + $s.='
'.$lang['server'].': '.$_SERVER['SERVER_NAME'].'
'; + } + } + if ($mainframe==1) { + $s.='
'.$title.'
'; + $s.='
'; + } + return $s; +} + +function PicCache($rpath="./") { + global $BrowserIcon,$config; + + $t='
'; + + $dh=opendir($config['files']['iconpath']); + while (false !== ($filename = readdir($dh))) + { + if ($filename != "." && $filename != ".." && !is_dir($config['files']['iconpath'].$filename)) { + $t.=''; + } + } + $t.='
'; + return $t; +} + +function MSDHeader($kind=0,$onloadFunction="") +{ + global $config, $databases,$lang,$frameset_restore; + //kind 0=main 1=menu 2=help + $d=($kind==2) ? "../../" : "./"; + $r=''."\n\n\n"; + + if ($kind==0) { + //Main without caching + $r.=''; + } else { + $r.=''; + } + $r.=''."\n"; + $r.=''."\n"; + $r.='MySqlDumper'."\n"; + $r.=''."\n"; + $r.=''."\n"; + + + if($frameset_restore==1) $r.=''; + + + $r.="\n'; + + return $r; +} +function MSDFooter($rfoot="",$enddiv=1) +{ + global $config, $databases,$dump,$restore,$lang; + $f= ''; + + if($enddiv==1) $f.= '
'; + + $f.=$rfoot.''; + + return $f; +} + +function save_bracket($str) +{ + // Wenn Klammer zu am Ende steht, diese behalten + $str=trim($str); + if (substr($str,-1)==')') $str=')'; + else $str=''; + return $str; +} + +function DownGrade($s,$show=true) +{ +// if (MSD_NEW_VERSION && strpos(strtolower($s),"collate ") && ($show) ) { +// return $s; +// } else { + $tmp=explode(",",$s); +//echo "
";print_r($tmp);echo "
"; + + for($i=0;$i"; + if(substr(strtoupper($tmp2[$j]),0,7)=="ENGINE=") $tmp2[$j]="TYPE=".substr($tmp2[$j],7); + if(substr(strtoupper($tmp2[$j]),0,8)=="CHARSET=") { $tmp2[$j]=""; + $tmp2[$j-1]=save_bracket($tmp2[$j-1]);} + if(substr(strtoupper($tmp2[$j]),0,8)=="COLLATE=") + { + $tmp2[$j]=save_bracket($tmp2[$j]); + if (isset($tmp2[$j+1])) $tmp2[$j+1]=save_bracket($tmp2[$j+1]); + + $tmp2[$j-1]=""; + } + + } + $tmp[$i]=implode(" ",$tmp2); + } + + // collate entfernen + if(strpos($t,"collate")) + { + $tmp2=explode(" ",$tmp[$i]); + $end=false; + + for($j=0;$j".$t.""); + + return $t; +// } +} + +function MySQL_Ticks($s) { + $klammerstart=$end=0; + $inner_s_start=strpos($s,"("); + $inner_s_end=strrpos($s,")"); + $inner_s=substr($s,$inner_s_start+1,$inner_s_end-(1+$inner_s_start)); + $pieces=explode(",",$inner_s); + for($i=0;$i diff --git a/mysqldumper/inc/functions_restore.php b/mysqldumper/inc/functions_restore.php new file mode 100644 index 0000000..a7a1a9f --- /dev/null +++ b/mysqldumper/inc/functions_restore.php @@ -0,0 +1,497 @@ +'.$anz."
[offene Klammern: $klammerstart] --$rit
"; + + } + return $anz; +} + +function get_sqlbefehl() +{ + global $restore,$config,$databases,$lang; + + //Init + $restore['fileEOF']=false; + $restore['EOB']=false; + $complete_sql=''; + $sqlparser_status=0; + if(!isset($restore['eintraege_ready'])) $restore['eintraege_ready']=0; + + //Parsen + WHILE ($sqlparser_status!=100 && !$restore['fileEOF'] && !$restore['EOB'] ) + { + //nächste Zeile lesen + $zeile= ($restore['compressed']) ? gzgets($restore['filehandle']) : fgets($restore['filehandle']); + + /******************* Setzen des Parserstatus *******************/ + // herausfinden um was für einen Befehl es sich handelt + IF ($sqlparser_status==0) + { + + //Vergleichszeile, um nicht bei jedem Vergleich strtoupper ausführen zu müssen + $zeile2=strtoupper(trim($zeile)); + + // Am Ende eines MySQLDumper-Backups angelangt? + if(substr($zeile2,0,6)=='-- EOB' || substr($zeile2,0,5)=='# EOB') + { + $restore['EOB']=true; + $zeile='--';$zeile2='--'; + $sqlparser_status=100; + } + + // Kommenatr? + if ( (substr($zeile2,0,2)=='--') || (substr($zeile2,0,1)=='#') ) + { + $zeile='';$zeile2=''; $sqlparser_status=0; + } + + //Einfache Anweisung finden die mit Semikolon beendet werden + if(substr($zeile2,0,11)=='LOCK TABLES') $sqlparser_status=5; + if(substr($zeile2,0,6)=='COMMIT') $sqlparser_status=5; + if(substr($zeile2,0,5)=='BEGIN') $sqlparser_status=5; + if(substr($zeile2,0,13)=='UNLOCK TABLES') $sqlparser_status=5; + if(substr($zeile2,0,4)=='SET ') $sqlparser_status=5; + if(substr($zeile2,0,6)=='START ') $sqlparser_status=5; + if(substr($zeile2,0,3)=='/*!') $sqlparser_status=5; //MySQL-Condition oder Kommentar + + if(substr($zeile2,0,12)=='CREATE TABLE') $sqlparser_status=2; //Createaktion + if(substr($zeile2,0,12)=='CREATE INDEX') $sqlparser_status=4; //Indexaktion + + //Kommentar + if ( ($sqlparser_status!=5) && (substr($zeile2,0,2)=='/*')) $sqlparser_status=6; + + // Befehle, die nicht ausgeführt werden sollen + if (substr($zeile2,0,4)=='USE ') $sqlparser_status=7; + if (substr($zeile2,0,14)=='DROP DATABASE ') $sqlparser_status=7; + if(substr($zeile2,0,10)=='DROP TABLE') $sqlparser_status=1; //Löschaktion + + if (substr($zeile2,0,7)=='INSERT ') + { + $sqlparser_status=3; //Datensatzaktion + $restore['actual_table']=strtolower(get_tablename_aus_insert($zeile)); + + // Pruefen ob die Spaltenanzahl bekannt ist und wenn nicht setzen + if(!isset($restore['num_table_fields'][$restore['actual_table']])) + { + $restore['num_table_fields'][$restore['actual_table']]=get_num_rows($restore['actual_table']); + } + } + // Fortsetzung von erweiterten Inserts + if ($restore['flag']==1) $sqlparser_status=3; + + if ( ($sqlparser_status==0) && (trim($complete_sql)>'') && ($restore['flag']==-1) ) + { + // Unbekannten Befehl entdeckt + v($restore); + echo "
Sql: ".$complete_sql; + echo "
Erweiterte Inserts: ".$restore['erweiterte_inserts']; + die('
'.$lang['unknown_sqlcommand'].': '.$zeile); + } + /******************* Ende von Setzen des Parserstatus *******************/ + } + + $last_char=substr(rtrim($zeile),-1); + // Zeilenumbrüche erhalten - sonst werden Schlüsselwörter zusammengefügt + // z.B. 'null' und in der nächsten Zeile 'check' wird zu 'nullcheck' + $complete_sql.=$zeile."\n"; + + if($sqlparser_status==1) + { //Löschaktion + if($last_char==';') $sqlparser_status=100; //Befehl komplett + } + + if($sqlparser_status==2) + { + // Createanweisung ist beim Finden eines ; beendet + if($last_char==';' ) + { + if($config['minspeed']>0) $restore['anzahl_zeilen']=$config['minspeed']; + + //Spaltenanzahl fuer diese Tabelle merken + $restore['actual_table']=get_tablename($complete_sql); + + $complete_sql=del_inline_comments($complete_sql); //Inline-Kommentare entfernen + + //Create ausfuehren und Anzahl der Spalten speichern + $restore['actual_fieldcount']=submit_create_action($complete_sql); + $restore['num_table_fields'][$restore['actual_table']]=$restore['actual_fieldcount']; + + // Zeile verwerfen und naechsten Befehl suchen + $complete_sql=''; + $sqlparser_status=0; + } + } + + if($sqlparser_status==3) + { + //INSERT + // Anzahl der Felder ermitteln wenn unbekannt + if(!isset($restore['num_table_fields'][$restore['actual_table']])) + { + $restore['num_table_fields'][$restore['actual_table']]=get_num_rows($restore['actual_table']); + } + + + $AnzahlFelder=SQL_Is_Complete($complete_sql,$restore['num_table_fields'][$restore['actual_table']],DEBUG); + + // einen vollständigen Insert ermittelt + if($AnzahlFelder==$restore['num_table_fields'][$restore['actual_table']]) + { + $sqlparser_status=100; + $complete_sql=trim($complete_sql); + + // letzter Ausdruck des erweiterten Inserts erreicht? + if(substr($complete_sql,-2)==');') + { + $restore['flag']=-1; + } + + // Wenn am Ende der Zeile ein Klammer Komma -> erweiterter Insert-Modus -> Steuerflag setzen + if(substr($complete_sql,-2)=='),') + { + // letztes Komme gegen Semikolon tauschen + $complete_sql=substr($complete_sql,0,-1).';'; + $restore['erweiterte_inserts']=1; + $restore['flag']=1; + } + + if (substr($complete_sql,0,7)!='INSERT ') + { + $complete_sql=$restore['insert_syntax'].' VALUES '.$complete_sql.';'; + } + else + { + // INSERT Syntax ermitteln und merken + $ipos=strpos(strtoupper($complete_sql),'VALUES'); + if (!$ipos===false) $restore['insert_syntax']=substr($complete_sql,0,$ipos); + else $restore['insert_syntax']='INSERT INTO `'.$restore['actual_table'].'`'; + } + + if($AnzahlFelder>$restore['num_table_fields'][$restore['actual_table']] && $restore['erweiterte_inserts']==0) + { + if(!isset($restore['table_create'][$restore['actual_table']])) + { + global $lang; + include('./inc/functions_sql.php'); + $restore['table_create'][$restore['actual_table']]=GetCreateTable($databases['db_actual'],$restore['actual_table']); + } + + echo ''; + echo '

Parser-Fehler : zuviele gezählt in Tabelle '.$restore["actual_table"].' ('.$AnzahlFelder.' statt '.$restore["num_table_fields"][$restore["actual_table"]].')'; + echo '
Aktuelle Tabelle: '.$restore['actual_table']; + echo '

CREATE-Anweisung

'; + echo '

INSERT-Anweisung


'; + echo '

'.$zeile; + die; + } + } + } + + // Index + if($sqlparser_status==4) + { //Createindex + if($last_char==';' ) + { + if($config['minspeed']>0) {$restore['anzahl_zeilen']=$config['minspeed'];} + $complete_sql=del_inline_comments($complete_sql); + $sqlparser_status=100; //Befehl komplett + } + } + + // Kommentar oder Condition + if($sqlparser_status==5) + { //Anweisung + if($last_char==';' ) + { + if($config['minspeed']>0) {$restore['anzahl_zeilen']=$config['minspeed'];} + $complete_sql=del_inline_comments($complete_sql); + $sqlparser_status=100; //Befehl komplett + } + } + + // Mehrzeiliger oder Inline-Kommentar + if($sqlparser_status==6) + { + if(!strrpos($zeile,'*/')===false) + { + $complete_sql=trim(del_inline_comments($complete_sql)); + $sqlparser_status=0; + } + } + + // Befehle, die verworfen werden sollen + if($sqlparser_status==7) + { //Anweisung + if($last_char==';' ) + { + if($config["minspeed"]>0) {$restore["anzahl_zeilen"]=$config["minspeed"];} + $complete_sql=''; + $sqlparser_status=0; + } + } + + if ( ($restore['compressed']) && (gzeof($restore['filehandle'])) ) $restore['fileEOF']=true; + if ( (!$restore['compressed']) && (feof($restore['filehandle'])) ) $restore['fileEOF']=true; + + } + return trim($complete_sql); +} + +function submit_create_action($sql) +{ + //Führt eine Create-Anweisung durch und ermittelt danach die Anzahl der aktuellen Spalten + // und legt diese im Array ab + global $restore; + $tablename=get_tablename($sql); + if (DEBUG) + { + echo "
Tabellenname: ".$tablename; + echo "
Create: ".$sql; + } + $res=mysql_query($sql); + if (!$res===false) + { + if (DEBUG) echo "
Create-Anweisung erfolgreich ausgeführt."; + $restore['actual_table']=$tablename; + $restore['table_ready']++; + } + else + { + //erster Versuch die Tabelle anzulegen hat nicht geklappt + // versuchen wir es mal mit der alten Syntax + $res=mysql_query(downgrade($sql)); + if (!$res===false) + { + if (DEBUG) echo "
Create-Anweisung nach Downgrade erfolgreich ausgeführt."; + $restore['actual_table']=$tablename; + $restore['table_ready']++; + } + else + { + SQLError($sql,'Couldn\'t create table: '.$tablename); + die(); + } + } + return get_num_rows($tablename); +} + +function get_num_rows($tablename) +{ + //Anzahl der Tabellenspalten ermitteln + $sql='SHOW COLUMNS FROM `'.$tablename.'`'; + $res=mysql_query($sql); + if ($res) + { + $num_rows=mysql_num_rows($res); + } + else + { + v($restore); + die('Couldn\'t read rowcount for table '.$tablename.'!
Restore:'.$restore['actual_table']); + } + return $num_rows; +} + +function del_inline_comments($sql) +{ + $sql=str_replace("\n",'
',$sql); + + //Inline-Kommentare entfernen + preg_match_all("/(\/\*(.+)\*\/)/U",$sql,$array); + if (is_array($array[0])) + { + if (DEBUG) + { + v($array); + echo"

vorher:
".$sql."

"; + } + $sql=str_replace($array[0],'',$sql); + if (DEBUG) echo"Nachher: :
".$sql."

"; + } + $sql=trim(str_replace('
',"\n",$sql)); + //Wenn nach dem Entfernen nur noch ein ; übrigbleibt -> entfernen + if ($sql==';') $sql=''; + return $sql; +} + +function lock_table() +{ + global $config,$restore; + if ($config["lock_tables"]==1 && (isset($restore["actual_table"])) && ($restore["actual_table"]<>"unbekannt") ) + { + $sql="LOCK TABLES `".$restore["actual_table"]."` WRITE"; + $res=MSD_query($sql) || die(SQLError("Kein Lock ausgeführt!",mysql_error())); + } +} + +function stri_replace($original,$patterns) +{ + $finalremove=$original; + $piece_front=''; + $piece_back=''; + $piece_replace=''; + + for ($x=0; $x < count($patterns); $x++) + { + $safety=0; + while(strstr(strtolower($finalremove),strtolower($patterns[$x]))) + { + $safety=$safety+1; + if ($safety >= 100000) { break; } + + $occ=strpos(strtolower($finalremove),strtolower($patterns[$x])); + $piece_front=substr($finalremove,0,$occ); + $piece_back=substr($finalremove,($occ+strlen($patterns[$x]))); + $finalremove=$piece_front . $piece_replace . $piece_back; + } + } + return $finalremove; +} + + +// extrahiert auf einfache Art den Tabellennamen aus dem "Create"-Befehl +function get_tablename($t) +{ + global $restore; + $ersetzen=array('CREATE TABLE','IF NOT EXISTS'); + $t=trim(stri_replace($t,$ersetzen)); + $t=trim(str_replace('(',' ',$t)); + $w=explode(' ',$t); + $tn=$w[0]; + if(substr($tn,0,1)=='`') $tn=substr($tn,1,strlen($tn)-2); + return $tn; +} + +// extrahiert auf einfache Art den Tabellennamen aus dem "Insert"-Befehl +function get_tablename_aus_insert($t) +{ + $t=substr(strtolower($t),strpos(strtolower($t), 'into ')+5); + $w=explode(' ',$t); + $tn=$w[0]; + if(substr($tn,0,1)=='`') $tn=substr($tn,1,strlen($tn)-2); + return $tn; +} + +function SQL_Is_Complete($s,$expected=0,$debug=0) +{ + global $restore; + if ($debug) echo "
Zu analysieren:".$s."
"; + $anz=$f_begin=$f_end=$restore["erw_anz"]=0; + $Backslash=chr(92); + $s=trim(strtoupper(($s))); + if(substr($s,-2)==");" || substr($s,-2)=="),") $s=substr($s,0,strlen($s)-2); + if(substr($s,-1)==")") $s=substr($s,0,strlen($s)-1); + if(strpos($s," VALUES")) { + $i=strpos($s," VALUES")+7; + $s=substr($s,$i); + } + $i=strpos($s,"(")+1; + $s=substr($s,$i); + + $tb=explode(",",$s); + for ($i=0;$i0 && $anz==$expected-1 && substr($v,-1)==")") { + $v=substr($v,0,strlen($v)-1); // ) entfernen + //if($i+12) { + + $f_end=1; + } elseif (($B_Delimiter % 2)==1 && strlen($v)>2) { + //ist mit `'` maskiert + $f_end=0; + } elseif(($B_Esc % 2)==1) { + //ist mit Backslash maskiert + $f_end=0; + } else { + + $f_end=1; + } + } + } + if($debug==1) echo "$f_begin/$f_end Feld $i: ".htmlspecialchars($tb[$i])."- $anz ($B_Ticks / $B_Esc)
"; + if($f_begin==1 && $f_end==1) { + $anz++; + $f_begin=$f_end=0; + if($anz==$expected) { + $restore["erw_anz"]++; + if($debug==1) echo "
".$restore["erw_anz"].".Insert - (".$anz." Felder)
"; + $anz=0; + } + } + + } + if($anz==0 && $expected>0 && $restore["erw_anz"]>0) $anz=$expected; + + return $anz; +} + +?> \ No newline at end of file diff --git a/mysqldumper/inc/functions_sql.php b/mysqldumper/inc/functions_sql.php new file mode 100644 index 0000000..fbc39bd --- /dev/null +++ b/mysqldumper/inc/functions_sql.php @@ -0,0 +1,1124 @@ +0) { + $SQL_ARRAY=file($sf); + } +} +function WriteSQL() +{ + global $SQL_ARRAY,$config; + $sf=$config['paths']['config'].'sql_statements'; + $str=""; + for($i=0;$i'.$nl; + $s.=''.$nl; + if(count($SQL_ARRAY)>0) { + for($i=0;$i'.SQL_Name($i).''.$nl; + } + } + $s.=''.$nl.$nl; + return $s; +} + +function Table_ComboBox() +{ + global $db,$config,$lang,$nl; + $tabellen = mysql_query("SHOW TABLES FROM `$db`",$config['dbconnection']); + $num_tables = mysql_num_rows($tabellen); + $s=$nl.$nl.''.$nl.$nl; + return $s; +} +function TableComboBox($default='') +{ + global $db,$config,$lang,$nl; + $tabellen = mysql_list_tables($db,$config['dbconnection']); + $num_tables = mysql_num_rows($tabellen); + $s=''.$nl; + for($i=0;$i<$num_tables;$i++) { + $t=mysql_tablename($tabellen,$i); + $s.=''.$nl; + } + return $s; +} +function DB_Exists($db) +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $erg=false; + $dbs=mysql_list_dbs($config['dbconnection']); + while ($row = mysql_fetch_object($dbs)) { + if(strtolower($row->Database)==strtolower($db)) { + $erg=true;break; + } + } + return $erg; +} +function Table_Exists($db,$table) +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $erg=false; + $sqlt="SHOW TABLES FROM `$db`"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + + if($res) { + $row = mysql_fetch_row($res); + if(strtolower($row[0])==strtolower($table)) { + $erg=true; + } + } else die("ERROR"); + return $erg; +} + +function DB_Empty($dbn) +{ + $r="DROP DATABASE `$dbn`;\nCREATE DATABASE `$dbn`;"; + MSD_DoSQL($r); + +} + +function DB_Copy($source,$destination,$drop_source=0,$insert_data=1) +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $SQL_Array=$t=""; + if(!DB_Exists($destination)) $SQL_Array.="CREATE DATABASE `$destination` ;\n"; + $SQL_Array.="USE `$destination` ;\n"; + $tabellen = mysql_list_tables($source,$config['dbconnection']); + $num_tables = mysql_num_rows($tabellen); + for($i=0;$i<$num_tables;$i++) { + $table=mysql_tablename($tabellen,$i); + $sqlt="SHOW CREATE TABLE `$source`.`$table`"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + $row=mysql_fetch_row($res); + $c=$row[1]; if(substr($c,-1)==";") $c=substr($c,0,strlen($c)-1); + $SQL_Array.=($insert_data==1) ? "$c SELECT * FROM `$source`.`$table` ;\n" : "$c ;\n"; + } + if($drop_source==1) $SQL_Array.="DROP DATABASE `$source` ;"; + + mysql_select_db($destination); + MSD_DoSQL($SQL_Array); + +} +function Table_Copy($source,$destination,$insert_data,$destinationdb="") +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $SQL_Array=$t=""; + $sqlc="SHOW CREATE TABLE $source"; + $res=MSD_query($sqlc) or die(SQLError($sqlc,mysql_error())); + $row=mysql_fetch_row($res); + $c=$row[1]; + $a1=strpos($c,"`"); + $a2=strpos($c,"`",$a1+1); + $c=substr($c,0,$a1+1).$destination.substr($c,$a2); + if(substr($c,-1)==";") $c=substr($c,0,strlen($c)-1); + $SQL_Array.=($insert_data==1) ? "$c SELECT * FROM $source ;\n" : "$c ;\n"; + //echo "
$SQL_Array
"; + MSD_DoSQL($SQL_Array); + +} +function MSD_DoSQL($sqlcommands,$limit="") +{ + + global $config,$out,$numrowsabs,$numrows,$num_befehle,$time_used,$sql; + + if(!isset($sql['parser']['sql_commands'])) $sql['parser']['sql_commands']=0; + if(!isset($sql['parser']['sql_errors'])) $sql['parser']['sql_errors']=0; + + $sql['parser']['time_used']=getmicrotime(); + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $out=$sqlcommand=""; + $allSQL=explode(';',preg_replace('/\r\n|\n/', '', $sqlcommands)); + $sql_queries=count($allSQL); + + if(!isset($allSQL[$sql_queries-1])) $sql_queries--; + if($sql_queries==1) { + SQLParser($allSQL[0]); + $sql['parser']['sql_commands']++; + $out.=Stringformat(($sql['parser']['sql_commands']),4).": ". $allSQL[0]."\n"; + $result =MSD_query($allSQL[0]) or die(SQLError($allSQL[0],mysql_error())); + + } else { + + for($i=0;$i<$sql_queries; $i++) { + $allSQL[$i]=trim(rtrim($allSQL[$i])); + + if($allSQL[$i]!="") { + $sqlcommand.=$allSQL[$i]; + $sqlcommand=SQLParser($sqlcommand); + //echo "$i: ".htmlentities($sqlcommand)."
"; + if($sql['parser']['start']==0 && $sql['parser']['end']==0 && $sqlcommand!="") { + //sql complete + $sql['parser']['sql_commands']++; + $out.=Stringformat(($sql['parser']['sql_commands']),4).": ". $sqlcommand."\n"; + $result =MSD_query($sqlcommand) or die(SQLError($sqlcommand,mysql_error())); + $sqlcommand=""; + } + } + } + } + $sql['parser']['time_used']=getmicrotime()-$sql['parser']['time_used']; +} + +function SQLParser($command,$debug=0) +{ + global $sql; + $sql['parser']['start']=$sql['parser']['end']=0; + $sql['parser']['sqlparts']=0; + if(!isset($sql['parser']['drop'])) $sql['parser']['drop']=0; + if(!isset($sql['parser']['create'])) $sql['parser']['create']=0; + if(!isset($sql['parser']['insert'])) $sql['parser']['insert']=0; + if(!isset($sql['parser']['update'])) $sql['parser']['update']=0; + if(!isset($sql['parser']['comment'])) $sql['parser']['comment']=0; + $Backslash=chr(92); + $s=rtrim(trim(($command))); + + //Was ist das f�r eine Anfrage ? + if(substr($s,0,1)=="#" || substr($s,0,2)=="--") { + $sql['parser']['comment']++; + $s=""; + } elseif(strtoupper(substr($s,0,5))=="DROP ") { + $sql['parser']['drop']++; + } elseif(strtoupper(substr($s,0,7))=="CREATE ") { + //Hier nur die Anzahl der Klammern z�hlen + $sql['parser']['start']=1; + $kl1=substr_count($s,"("); + $kl2=substr_count($s,")"); + if($kl2-$kl1==0) { + $sql['parser']['start']=0; + $sql['parser']['create']++; + } + } elseif(strtoupper(substr($s,0,7))=="INSERT " || strtoupper(substr($s,0,7))=="UPDATE ") { + + if(strtoupper(substr($s,0,7))=="INSERT ") $sql['parser']['insert']++; else $sql['parser']['update']++; + $i=strpos(strtoupper($s)," VALUES")+7; + $st=substr($s,$i); + $i=strpos($st,"(")+1; + $st=substr($st,$i); + $st=substr($st,0,strlen($st)-2); + + $tb=explode(",",$st); + for ($i=0;$i2) { + + $sql['parser']['end']=1; + } elseif (($B_Delimiter % 2)==1 && strlen($v)>2) { + //ist mit `'` maskiert + $sql['parser']['end']=0; + } elseif(($B_Esc % 2)==1) { + //ist mit Backslash maskiert + $sql['parser']['end']=0; + } else { + + $sql['parser']['end']=1; + } + } + } + if($debug==1) echo "".$sql['parser']['start']."/".$sql['parser']['end']." Feld $i: ".htmlspecialchars($tb[$i])."- ".$sql['parser']['sqlparts']." ($B_Ticks / $B_Esc)
"; + if($sql['parser']['start']==1 && $sql['parser']['end']==1) { + $sql['parser']['sqlparts']++; + $sql['parser']['start']=$sql['parser']['end']=0; + } + } + } + return $s; +} + +function SQLOutput($sqlcommand,$meldung="") +{ + global $sql,$lang; + $s= '
'.$lang['sql_output'].'
'; + if($meldung!="") $s.='

'.$meldung.'

'; + + if(isset($sql['parser']['sql_commands'])) { + $s.=''.$sql['parser']['sql_commands'].'
'.$lang['sql_commands_in'].round($sql['parser']['time_used'],4).$lang['sql_commands_in2'].'

'; + $s.=$lang['sql_out1'].''.$sql['parser']['drop'].' DROP-, '; + $s.=''.$sql['parser']['create'].' CREATE-, '; + $s.=''.$sql['parser']['insert'].' INSERT-, '; + $s.=''.$sql['parser']['update'].' UPDATE-'.$lang['sql_out2'].'
'; + $s.=$lang['sql_out3'].''.$sql['parser']['comment'].' '.$lang['sql_out4'].'
'; + if($sql['parser']['sql_commands']<5000) + $s.='
'.Highlight_SQL($sqlcommand).'
'; + else $s.=$lang['sql_out5']."
"; + }elseif($sqlcommand!="")$s.='
'.$lang['sql_output'].'
'.Highlight_SQL($sqlcommand).'
'; + return $s.''; +} + + + +function GetCreateTable($db,$tabelle) +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $res=mysql_query("SHOW CREATE TABLE `$db`.`$tabelle`"); + if($res) { + $row=mysql_fetch_array($res); + return $row['Create Table']; + } else return mysql_error(); + +} + +function KindSQL($sql) +{ + if (preg_match('@^((-- |#)[^\n]*\n|/\*.*?\*/)*(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@im', $sql)) { + return 2; + } elseif (preg_match('@^((-- |#)[^\n]*\n|/\*.*?\*/)*(DROP|CREATE)[[:space:]]+(IF EXISTS[[:space:]]+)?(TABLE|DATABASE)[[:space:]]+(.+)@im', $sql)) { + return 1; + } +} + + + + +function GetPostParams() +{ + global $db,$dbid,$tablename,$context,$limitstart,$order,$orderdir,$sql; + $db=$_POST['db']; + $dbid=$_POST['dbid']; + $tablename=$_POST['tablename']; + $context=$_POST['context']; + $limitstart=$_POST['limitstart']; + $order=$_POST['order']; + $orderdir=$_POST['orderdir']; + $sql['sql_statement']=(isset($_POST['sql_statement'])) ? stripslashes(urldecode($_POST['sql_statement'])) : "SELECT * FROM `$tablename`"; + +} + +function ComboCommandDump($when,$index) +{ + global $SQL_ARRAY,$nl,$databases,$lang; + + if(count($SQL_ARRAY)==0) { + $r=''.$lang['sql_befehle'].''; + if($when==0) + $r.=''; + else + $r.=''; + } else { + if($when==0) { + $r=''; + $csql=$databases['command_after_dump'][$index]; + } + + $r.=''; + if(count($SQL_ARRAY)>0) { + for($i=0;$i'.SQL_Name($i).''.$nl; + } + } + + $r.=''; + } + return $r; +} + +function EngineCombo($default="") +{ + global $config; + if(!$config['dbconnection']) MSD_mysql_connect(); + + $r=''; + if(!MSD_NEW_VERSION) { + //BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + } else { + $res=mysql_query("SHOW ENGINES"); + $num = mysql_num_rows($res); + for($i=0;$i<$num;$i++) { + $row=mysql_fetch_array($res); + $r.=''; + } + } + return $r; +} + +function CharsetCombo($default="") +{ + global $config; + if(!MSD_NEW_VERSION) { return ""; + } else { + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + $res=mysql_query("SHOW Charset"); + $num = mysql_num_rows($res); + $r=''; + for($i=0;$i<$num;$i++) { + $row=mysql_fetch_array($res); + $r.=''; + } + return $r; + } +} + +function GetCollationArray() +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + + $res=mysql_query("SHOW Collation"); + $num = mysql_num_rows($res); + $r=Array(); + for($i=0;$i<$num;$i++) { + $row=mysql_fetch_array($res); + $r[$i]['Collation']=$row['Collation']; + $r[$i]['Charset']=$row['Charset']; + $r[$i]['Id']=$row['Id']; + $r[$i]['Default']=$row['Default']; + $r[$i]['Compiled']=$row['Compiled']; + $r[$i]['Sortlen']=$row['Sortlen']; + } + return $r; +} + +function CollationCombo($default="",$withcharset=0) +{ + if(!MSD_NEW_VERSION) { + return ""; + } else { + $r=GetCollationArray(); + sort($r); + $s=""; + $s=''; + $group=""; + for($i=0;$i0) $s.=''; + $s.=''; + } + $s.=''; + } + return $s.''; + } +} +function AttributeCombo($default="") +{ + $s=''; + $s.=''; + $s.=''; + return $s; + +} + +function simple_bbcode_conversion($a) +{ + global $config; + $tag_start='
'; + $tag_end='
'; + + //replacements + $a=nl2br($a); + + $a=preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/si","$2",$a); + $a=preg_replace("/\[urltargetself=(.*?)\](.*?)\[\/urltargetself\]/si","$2",$a); + $a=preg_replace("/\[url\](.*?)\[\/url\]/si","$1",$a); + $a=preg_replace("/\[ed2k=\+(.*?)\](.*?)\[\/ed2k\]/si","$2",$a); + $a=preg_replace("/\[ed2k=(.*?)\](.*?)\[\/ed2k\]/si","$2",$a); + + $a=preg_replace("/\[center\](.*?)\[\/center\]/si", "
$1
", $a); + $a=preg_replace("/\[size=([1-2]?[0-9])\](.*?)\[\/size\]/si", "$2", $a); + $a=preg_replace("/\[size=([1-2]?[0-9]):(.*?)\](.*?)\[\/size(.*?)\]/si", "$3", $a); + $a=preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/si", "$2", $a); + $a=preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/si", "$2", $a); + $a=preg_replace("/\[color=(.*?):(.*?)\](.*?)\[\/color(.*?)\]/si", "$3", $a); + $a=preg_replace("/\[img\](.*?)\[\/img\]/si", "", $a); + $a=preg_replace("/\[b\](.*?)\[\/b\]/si", "$1", $a); + $a=preg_replace("/\[b(.*?)\](.*?)\[\/b(.*?)\]/si", "$2", $a); + $a=preg_replace("/\[u\](.*?)\[\/u\]/si", "$1", $a); + $a=preg_replace("/\[u(.*?)\](.*?)\[\/u(.*?)\]/si", "$2", $a); + $a=preg_replace("/\[i\](.*?)\[\/i\]/si", "$1", $a); + $a=preg_replace("/\[i(.*?)\](.*?)\[\/i(.*?)\]/si", "$2", $a); + $a=preg_replace("/\[quote\](.*?)\[\/quote\]/si", "

$1

", $a); + $a=preg_replace("/\[quote:(.*?)\](.*?)\[\/quote(.*?)\]/si", "

$2

", $a); + $a=preg_replace("/\[code:(.*?)\](.*?)\[\/code(.*?)\]/si", "

$2

", $a); + $a=preg_replace("/\[hide\](.*?)\[\/hide\]/si", "
$1
", $a); + + $a=preg_replace("/[[:space:]]http:\/\/(.*?)[[:space:]]/si","$1",$a); + + + + + return $tag_start.$a.$tag_end; + +} + +function ExtractTablename($q) +{ + $offset=0; + $p=strtoupper($q); + $i=strpos($p,"FROM")+5; + $p=substr($p,$i); + if(substr($p,0,1)=="("){ + $offset=2; + echo "$offset
"; + } + if(strpos($p," ",$offset)) { + $j=strpos($p," ",$offset); + $p=substr($p,$offset,$j); + } + $t=substr($q,$i+$offset,strlen($p)-$offset); + if(substr($t,-1)==",") { + //Achtung, keine eindeutige Tabelle + $t=''; + } + if(substr($t,0,1)=="`" && substr($t,-1)=="`") $t=substr($t,1,strlen($t)-2); + return $t; +} + +function ExtractTablenameFromSQL($q) +{ + + $p=strtoupper($q); + $first=substr($p,0,strpos($p," ")); + switch($first) { + case "SHOW": + return ""; + break; + case "SELECT": + $p=substr($q,strpos($p,"FROM")+5); + $p=explode(" ",$p); + $t=$p[0]; + if(strpos($t,".")) $t=substr($t, strpos($t,".")+1); + return str_replace("`","",$t); + case "DROP": + case "INSERT": + case "UPDATE": + break; + default: + return $first; + } +} + +function GetOptionsCombo($arr,$default) +{ + global $feldtypen,$feldattribute,$feldnull,$feldextras,$feldkeys,$feldrowformat; + $r=""; + foreach ($arr as $s) { + $r.=''."\n"; + } + return $r; +} + + +function FillFieldinfos($db,$tabelle) +{ + global $config; + + $fields_infos=Array(); + + $t=GetCreateTable($db,$tabelle); + $sqlf="SHOW FULL FIELDS FROM `$db`.`$tabelle`;"; + $res=MSD_query($sqlf) or die(SQLError($sqlf,mysql_error())); + $anz_fields=mysql_num_rows($res); + + for($i=0;$i<$anz_fields;$i++) { + $row=mysql_fetch_array($res); + if(MSD_NEW_VERSION) $fields_infos[$i]['collate']=$row['Collation']; + if(MSD_NEW_VERSION) $fields_infos[$i]['comment']=$row['Comment']; + $fields_infos[$i]['privileges']=$row['Privileges']; + } + $fields_infos['_primarykey_']=""; + $flds=$keys=$ukeys=$fkeys=0; + $fields_infos['_createtable_']=$t; + $tmp=explode("\n",$t); + for($i=1;$i"; + + if(substr($t,0,12)=="PRIMARY KEY ") { + $t=str_replace("`","",$t); + $fields_infos['_primarykey_']=substr($t,strpos($t,"(")+1,strpos($t,")")-strpos($t,"(")-1); + } elseif (substr($t,0,4)=="KEY ") { + $t=str_replace("`","",$t); + $att=explode(" ",$t); + $fields_infos['_key_'][$keys]['name']=$att[1]; + $att[2]=str_replace("(","",$att[2]); + $att[2]=str_replace(")","",$att[2]); + $fields_infos['_key_'][$keys]['columns']=$att[2]; + $keys++; + } elseif (substr($t,0,11)=="UNIQUE KEY ") { + $t=str_replace("`","",$t); + $att=explode(" ",$t); + $fields_infos['_uniquekey_'][$ukeys]['name']=$att[2]; + $att[3]=str_replace("(","",$att[3]); + $att[3]=str_replace(")","",$att[3]); + $fields_infos['_uniquekey_'][$ukeys]['columns']=$att[3]; + $ukeys++; + } elseif (substr($t,0,13)=="FULLTEXT KEY ") { + $t=str_replace("`","",$t); + $att=explode(" ",$t); + $fields_infos['_fulltextkey_'][$fkeys]['name']=$att[2]; + $att[3]=str_replace("(","",$att[3]); + $att[3]=str_replace(")","",$att[3]); + $fields_infos['_fulltextkey_'][$fkeys]['columns']=$att[3]; + $fkeys++; + } else { + + $att=explode(" ",$t); + + if(substr($att[0],0,1)=="`" && substr($att[0],-1)=="`") { + $fields_infos[$flds]['name']=str_replace("`","",$att[0]); + $s=1; + } else { + $fields_infos[$flds]['name']=str_replace("`","",$att[0])." "; + for($ii=1;$i"; + $s++; + } + } + + $flds++; + } + } + //echo substr($tmp[count($tmp)-1],2)."
"; + $ext=explode(" ",substr($tmp[count($tmp)-1],2)); + $s="";$haltchar="="; + for($i=0;$i"; + + if($ok[0]==0 && $nk[0]==1) { + if($restriction!="drop_only") $s.="ADD PRIMARY KEY (`$fld`), "; + } elseif ($ok[0]==1 && $nk[0]==0) { + $s.="DROP PRIMARY KEY, "; + } + if($ok[1]==0 && $nk[1]==1) { + if($restriction!="drop_only") $s.="ADD UNIQUE INDEX `$fld` (`$fld`), "; + } elseif ($ok[1]==1 && $nk[1]==0) { + $s.="DROP INDEX `$fld`, "; + } + if($ok[2]==0 && $nk[2]==1) { + if($restriction!="drop_only") $s.="ADD INDEX `$fld` (`$fld`), "; + } elseif ($ok[2]==1 && $nk[2]==0) { + $s.="DROP INDEX `$fld`, "; + } + if($ok[3]==0 && $nk[3]==1) { + if($restriction!="drop_only") $s.="ADD FULLTEXT INDEX `$fld` (`$fld`($size)), "; + } elseif ($ok[3]==1 && $nk[3]==0) { + $s.="DROP FULLTEXT INDEX `$fld`, "; + } + } + if($s!="") $s=substr($s,0,strlen($s)-2); + return $s; +} + +function CheckCSVOptions() +{ + global $sql; + if(!isset($sql['export']['trenn'])) $sql['export']['trenn']=";"; + if(!isset($sql['export']['enc'])) $sql['export']['enc']="\""; + if(!isset($sql['export']['esc'])) $sql['export']['esc']="\\"; + if(!isset($sql['export']['ztrenn'])) $sql['export']['ztrenn']="\\r\\n"; + if(!isset($sql['export']['null'])) $sql['export']['null']="NULL"; + if(!isset($sql['export']['namefirstline'])) $sql['export']['namefirstline']=0; + if(!isset($sql['export']['format'])) $sql['export']['format']=0; + if(!isset($sql['export']['sendfile'])) $sql['export']['sendfile']=0; + if(!isset($sql['export']['tables'])) $sql['export']['tables']=Array(); + if(!isset($sql['export']['compressed'])) $sql['export']['compressed']=0; + if(!isset($sql['export']['htmlstructure'])) $sql['export']['htmlstructure']=0; + if(!isset($sql['export']['xmlstructure'])) $sql['export']['xmlstructure']=0; + + if(!isset($sql['import']['trenn'])) $sql['import']['trenn']=";"; + if(!isset($sql['import']['enc'])) $sql['import']['enc']="\""; + if(!isset($sql['import']['esc'])) $sql['import']['esc']="\\"; + if(!isset($sql['import']['ztrenn'])) $sql['import']['ztrenn']="\\r\\n"; + if(!isset($sql['import']['null'])) $sql['import']['null']="NULL"; + if(!isset($sql['import']['namefirstline'])) $sql['import']['namefirstline']=0; + if(!isset($sql['import']['format'])) $sql['import']['format']=0; + + +} + +function ExportCSV() { + global $sql,$config; + $t=""; + $time_start = time(); + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + for($table=0;$table$config['memory_limit']) { + CSVOutput($t); + $t=""; + } + $time_now = time(); + if ($time_start >= $time_now + 30) { + $time_start = $time_now; + header('X-MSDPing: Pong'); + } + } + } + } + CSVOutput($t,1); +} + +function CSVOutput($str,$last=0) +{ + global $sql,$config; + if($sql['export']['sendfile']==0) { + //Display + echo $str; + } else { + if($sql['export']['header_sent']=="") { + if($sql['export']['compressed']==1 & !function_exists('gzencode')) $sql['export']['compressed']=0; + if($sql['export']['format']<4) { + $file=$sql['export']['db'].(($sql['export']['compressed']==1) ? ".csv.gz" : ".csv"); + } elseif($sql['export']['format']==4) { + $file=$sql['export']['db'].(($sql['export']['compressed']==1) ? ".xml.gz" : ".xml"); + } elseif($sql['export']['format']==5) { + $file=$sql['export']['db'].(($sql['export']['compressed']==1) ? ".html.gz" : ".html"); + } + $mime=($sql['export']['compressed']==0) ? "x-type/subtype" : "application/x-gzip"; + + header('Content-Disposition: attachment; filename="' . $file . '"'); + header('Pragma: no-cache'); + header('Content-Type: '.$mime); + header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + $sql['export']['header_sent']=="1"; + } + if($sql['export']['compressed']==1) + echo gzencode($str); + else + echo $str; + + } +} + +function DoImport() { + global $sql,$lang; + $r=''; + $zeilen=count($sql['import']['csv'])-$sql['import']['namefirstline']; + $sql['import']['first_zeile']=explode($sql['import']['trenn'],$sql['import']['csv'][0]); + $importfelder=count($sql['import']['first_zeile']); + + if($sql['import']['tablecreate']==0) { + $res=MSD_query("show fields FROM ".$sql['import']['table']); + $tabellenfelder=mysql_num_rows($res); + if($importfelder!=$tabellenfelder) { + $r.='
'.sprintf($lang['csv_fieldcount_nomatch'],$tabellenfelder,$importfelder); + } else { + $ok=1; + } + } else { + $ok=ImportCreateTable(); + if($ok==0) { + $r.='
'.sprintf($lang['csv_errorcreatetable'],$sql['import']['table']); + } + } + if($ok==1) { + $insert=""; + if($sql['import']['emptydb']==1 && $sql['import']['tablecreate']==0) { + MSD_DoSQL("TRUNCATE ".$sql['import']['table'].";"); + } + $sql['import']['lines_imported']=0; + $enc=($sql['import']['enc']=="") ? "'" : ""; + $zc=""; + for($i=$sql['import']['namefirstline'];$i<$zeilen+$sql['import']['namefirstline'];$i++) { + //Importieren + $insert="INSERT INTO ".$sql['import']['table']." VALUES("; + if($sql['import']['createindex']==1) $insert .="'', "; + $zc.=trim(rtrim($sql['import']['csv'][$i])); + echo "Zeile $i: $zc
"; + if($zc!="" && substr($zc,-1)==$enc) { + $zeile=explode($sql['import']['trenn'],$zc); + for($j=0;$j<$importfelder;$j++) { + $a=($zeile[$j]=="" && $enc=="") ? "''" : $zeile[$j]; + $insert.=$enc.$a.$enc.(($j==$importfelder-1) ? ");\n" : ","); + } + //MSD_DoSQL($insert); + $sql['import']['lines_imported']++; + $zc=""; + } + + } + $r.=sprintf($lang['csv_fieldslines'],$importfelder,$sql['import']['lines_imported']); + } + + $r.='
'; + return $r; + +} + +function ImportCreateTable() { + global $sql,$lang,$db,$config; + $tbl=Array(); + $tabellen = mysql_list_tables($db,$config['dbconnection']); + $num_tables = mysql_num_rows($tabellen); + for($i=0;$i<$num_tables;$i++) { + $tbl[]=strtolower(mysql_tablename($tabellen,$i)); + } + $i=0; + $sql['import']['table']=$sql['import']['table'].$i; + while(in_array($sql['import']['table'],$tbl)) { + $sql['import']['table']=substr($sql['import']['table'],0,strlen($sql['import']['table'])-1).++$i; + } + $create="CREATE TABLE `".$sql['import']['table']."` (".(($sql['import']['createindex']==1) ? '`import_id` int(11) unsigned NOT NULL auto_increment, ' : ''); + if($sql['import']['namefirstline']) { + for($i=0;$i'."\n"; + $level++; + $time_start = time(); + + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + for($table=0;$table'."\n"; + $sqlt="SHOW Fields FROM `".$sql['export']['db']."`.`".$sql['export']['tables'][$table]."`;"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + if($res) { + $numfields=mysql_num_rows($res); + if($sql['export']['xmlstructure']==1){ + $t.=str_repeat($tab,$level++).''."\n"; + for($feld=0;$feld<$numfields;$feld++) { + $row=mysql_fetch_array($res); + $t.=str_repeat($tab,$level++).''."\n"; + $t.=str_repeat($tab,$level).''.$row['Field'].''."\n"; + $t.=str_repeat($tab,$level).''.$row['Type'].''."\n"; + $t.=str_repeat($tab,$level).''.$row['Null'].''."\n"; + $t.=str_repeat($tab,$level).''.$row['Key'].''."\n"; + $t.=str_repeat($tab,$level).''.$row['Default'].''."\n"; + $t.=str_repeat($tab,$level).''.$row['Extra'].''."\n"; + $t.=str_repeat($tab,--$level).''."\n"; + } + $t.=str_repeat($tab,--$level).''."\n"; + } + } + $t.=str_repeat($tab,$level++).''."\n"; + $sqlt="SELECT * FROM `".$sql['export']['db']."`.`".$sql['export']['tables'][$table]."`;"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + if($res) { + $numrows=mysql_numrows($res); + for($data=0;$data<$numrows;$data++) { + $t.=str_repeat($tab,$level)."\n"; + $level++; + $row=mysql_fetch_row($res); + for($feld=0;$feld<$numfields;$feld++) { + $t.=str_repeat($tab,$level).''.$row[$feld].''."\n"; + } + $t.=str_repeat($tab,--$level)."\n"; + $sql['export']['lines']++; + if(strlen($t)>$config['memory_limit']) { + CSVOutput($t); + $t=""; + } + $time_now = time(); + if ($time_start >= $time_now + 30) { + $time_start = $time_now; + header('X-MSDPing: Pong'); + } + } + } + $t.=str_repeat($tab,--$level).''."\n"; + $t.=str_repeat($tab,--$level).''."\n"; + } + $t.=str_repeat($tab,--$level).''."\n"; + CSVOutput($t,1); +} + +function ExportHTML() { + global $sql,$config,$lang; + + $header=implode("",file($config['paths']['config'].'html_template')); + $header=str_replace("{TITLE}",'MSD HTML-Export',$header); + $footer="\n\n\n"; + $content=""; + $content.='

Datenbank '.$sql['export']['db'].'

'; + + $time_start = time(); + + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + for($table=0;$table'."\n"; + $fsql="show fields from `".$sql['export']['tables'][$table]."`"; + $dsql="select * from `".$sql['export']['tables'][$table]."`"; + //Struktur + $res=MSD_query($fsql) or die(SQLError($fsql,mysql_error())); + if($res) { + $field=$fieldname=$fieldtyp=Array(); + $structure="\n"; + $numfields=mysql_numrows($res); + for($feld=0;$feld<$numfields;$feld++) { + $row=mysql_fetch_row($res); + $field[$feld]=$row[0]; + + if($feld==0) { + $structure.="\n"; + for($i=0;$iname; + $fieldtyp[$i]=$str->type; + $structure.="\n"; + } + $structure.="\n\n"; + } + for($i=0;$i".(($row[$i]!="") ? $row[$i] : " ")."\n"; + } + $structure.="\n"; + } + $structure.="
".$str->name."
\n"; + } + if($sql['export']['htmlstructure']==1) $content.="

Struktur

\n".$structure; + //Daten + + $res=MSD_query($dsql) or die(SQLError($dsql,mysql_error())); + if($res) { + $anz=mysql_num_rows($res); + $content.="

Daten ($anz Datensätze)

\n"; + $content.="\n"; + for($feld=0;$feld\n"; + for($i=0;$i\n"; + } + $content.="\n"; + } + } + for($d=0;$d<$anz;$d++) { + $row=mysql_fetch_row($res); + $content.="\n"; + for($i=0;$i\n"; + } + $content.="\n"; + } + } + $content.="
"; + + + } + + + + + CSVOutput($header.$content.$footer); +} + +?> \ No newline at end of file diff --git a/mysqldumper/inc/header.php b/mysqldumper/inc/header.php new file mode 100644 index 0000000..f286c5a --- /dev/null +++ b/mysqldumper/inc/header.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/mysqldumper/inc/mysql.php b/mysqldumper/inc/mysql.php new file mode 100644 index 0000000..bf17af7 --- /dev/null +++ b/mysqldumper/inc/mysql.php @@ -0,0 +1,120 @@ + "http://dev.mysql.com/doc/mysql/de/Column_types.html"); + +function MSD_mysql_connect() +{ + global $config,$databases; + + $port=(isset($config['dbport']) && !empty($config['dbport'])) ? ":".$config['dbport'] : ""; + $socket=(isset($config['dbsocket']) && !empty($config['dbsocket'])) ? ":".$config['dbsocket'] : ""; + $config['dbconnection'] = @mysql_connect($config['dbhost'].$port.$socket,$config['dbuser'],$config['dbpass']) or die(SQLError("Datenbankverbindung",mysql_error())); + if(!defined('MSD_MYSQL_VERSION')) GetMySQLVersion(); + return true; +} + +function GetMySQLVersion() +{ + $res=MSD_query("select version()"); + $row = mysql_fetch_array($res); + $version=$row[0]; + $new=(substr($version,0,3)>=4.1); + if(!defined('MSD_MYSQL_VERSION')) define('MSD_MYSQL_VERSION', $version); + if(!defined('MSD_NEW_VERSION')) define('MSD_NEW_VERSION',$new); + return $version; +} + +function MSD_query($query) +{ + global $config; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + return @mysql_query($query, $config['dbconnection']); + +} + +function MSD_mysql_error() +{ + global $config,$databases; + +} + +function SQLError($sql,$error) +{ + global $lang,$mysql_errorhelp_ref,$config; + echo '
+ + + +
MySQL-ERROR   +'.$lang['MySQLErrorDoc'].'
'.$lang['sql_error1'].'

'.Highlight_SQL($sql).'
'.$lang['sql_error2'].'

'.$error.'
+
'; + +} + +function Highlight_SQL($sql) +{ + global $sql_keywords; + + $end=""; + $tickstart=false; + $a=@token_get_all(""); + foreach($a as $token) { + if(!is_array($token)) { + if($token=="`") $tickstart=!$tickstart; + $end.=$token; + } else { + if($tickstart) $end.=$token[1]; else { + switch(token_name($token[0])) { + case "T_STRING": + case "T_AS": + case "T_FOR": + + $end.=(in_array(strtoupper($token[1]),$sql_keywords)) ? "".$token[1]."": $token[1]; + break; + case "T_IF": + case "T_LOGICAL_AND": + case "T_LOGICAL_OR": + case "T_LOGICAL_XOR": + $end.=(in_array(strtoupper($token[1]),$sql_keywords)) ? "".$token[1]."": $token[1]; + break; + case "T_CLOSE_TAG": + case "T_OPEN_TAG": + break; + default: + $end.=$token[1]; + } + } + } + } + $end=preg_replace("/`(.*?)`/si", "`$1`", $end); + return $end; +} + +function Fieldlist($db,$tbl) +{ + $fl=''; + $res=MSD_query("SHOW FIELDS FROM `$db`.`$tbl`;"); + if($res) { + $fl='('; + for($i=0;$i diff --git a/mysqldumper/inc/runtime.php b/mysqldumper/inc/runtime.php new file mode 100644 index 0000000..9c7198a --- /dev/null +++ b/mysqldumper/inc/runtime.php @@ -0,0 +1,149 @@ +30) $config['max_execution_time']=30;; +$config['upload_max_filesize']=ini_get('upload_max_filesize'); +$config['safe_mode']=ini_get('safe_mode'); +$config['magic_quotes_gpc']=ini_get('magic_quotes_gpc'); +$config['disabled']=ini_get('disable_functions'); +$config['phpextensions']=implode(', ',get_loaded_extensions()); +$m=str_replace('M','',get_cfg_var('memory_limit')); +$config['ram']=(empty($m)) ? 0 : $m; + +//Ist zlib möglich? +$p1=explode(', ',$config['phpextensions']); +$p2=explode(',',str_replace(' ','',$config['disabled'])); +//Buggy PHP-Version ? +$p3=explode('.',PHP_VERSION); +$buggy=($p3[0]==4 && $p3[1]==3 && $p3[2]<3); +$config['zlib']=(!$buggy) && (in_array('zlib',$p1) && (!in_array('gzopen',$p2) || !in_array('gzwrite',$p2) || !in_array('gzgets',$p2) || !in_array('gzseek',$p2) || !in_array('gztell',$p2))); + +//Tuning-Ecke +$config['tuning_add']=1.1; +$config['tuning_sub']=0.9; +$config['time_buffer']=0.75; //max_zeit=$config['max_execution_time']*$config['time_buffer'] +$config['perlspeed']=10000; //Anzahl der Datensätze, die in einem Rutsch gelesen werden + + +//Bausteine +$meta=br().br().' '.br().''.br(2); +//$preload_restore=''; +//$preload_dump=''; +$config['homepage']='http://www.mysqldumper.de/board/'; +$languagepacks_ref='http://www.mysqldumper.de/board/viewforum.php?f=24'; +$stylepacks_ref='http://www.mysqldumper.de/board/viewforum.php?f=25'; + +$nl="\n"; +$mysql_commentstring='--'; + +//config-Variablen, die nicht gesichert werden sollen +$config_dontsave=Array('max_execution_time','safe_mode','magic_quotes_gpc','disabled', +'phpextensions','ram','zlib','tuning_add','tuning_sub','time_buffer','perlspeed', +'dbconnection','version'); + +//Initialisierungen +//0 schaltet frameset-restore aus +$frameset_restore=0; + +function v($t) +{ + echo '
'; + if (is_array($t)) + { + echo '
';
+		print_r($t);
+		echo '
'; + } + else echo $t; +} +?> \ No newline at end of file diff --git a/mysqldumper/inc/sqllib.php b/mysqldumper/inc/sqllib.php new file mode 100644 index 0000000..ba0cf28 --- /dev/null +++ b/mysqldumper/inc/sqllib.php @@ -0,0 +1,55 @@ + diff --git a/mysqldumper/inc/tabellenabfrage.php b/mysqldumper/inc/tabellenabfrage.php new file mode 100644 index 0000000..5f13c89 --- /dev/null +++ b/mysqldumper/inc/tabellenabfrage.php @@ -0,0 +1,86 @@ +'.$row['Name'].''; + $tbl_zeile.=''.$row['Rows'].' '.$lang['datawith'].' '.byte_output($row['Data_length']+$row['Index_length']).', '.$lang['lastbufrom'].' '.$row['Update_time'].''; + } +} else { + //Restore - Header aus Backupfile lesen + $button_name='restore_tbl'; + $button_caption=""; + $gz = (substr($filename,-3))=='.gz' ? 1 : 0; + if ($gz) + { + $fp = gzopen ($fpath.$filename, "r"); + $statusline=gzgets($fp,40960); + $offset= gztell($fp); + } else { + $fp = fopen ($fpath.$filename, "r"); + $statusline=fgets($fp,5000); + $offset= ftell($fp); + } + //Header auslesen + $sline=ReadStatusline($statusline); + $anzahl_tabellen=$sline[0]; + $anzahl_eintraege=$sline[1]; + $part=($sline[2]=="") ? 0 : substr($sline[2],3); + $EXTINFO= $sline[6]; + if($EXTINFO=="") { + $tbl_zeile.=''.$lang['not_supported'].''; + } else { + for($i=0;$i<$anzahl_tabellen;$i++) { + if ($gz) + { + gzseek($fp,$offset); + $statusline=gzgets($fp,40960); + $offset= gztell($fp); + } else { + fseek($fp,$offset); + $statusline=fgets($fp,5000); + $offset= ftell($fp); + } + $s=explode("|",$statusline); + $tbl_zeile.=''.$s[1].''; + $tbl_zeile.=''.$s[2].' '.$lang['datawith'].' '.byte_output($s[3]).', '.$lang['lastbufrom'].' '.$s[4].''; + } + if($gz) gzclose ($fp); else fclose ($fp); + } +} + +$buttons='' +.'' +.'' +.'' +.'
'; + +echo '
'.$tblr.' - '.$lang['tableselection'].'
'.$lang['db'].': '.$databases['db_actual'].'
'; +echo '
'; +echo '
'; +echo ''; + +echo $buttons; +echo $tbl_zeile; +echo $buttons; + +echo '
'; +//echo '




'; +echo '


'; + +?> diff --git a/mysqldumper/index.php b/mysqldumper/index.php new file mode 100644 index 0000000..59d919c --- /dev/null +++ b/mysqldumper/index.php @@ -0,0 +1,27 @@ + + + + + + + +MySQLDumper + + + + + + + + \ No newline at end of file diff --git a/mysqldumper/install.php b/mysqldumper/install.php new file mode 100644 index 0000000..2d00c94 --- /dev/null +++ b/mysqldumper/install.php @@ -0,0 +1,730 @@ + $getval){ ${$getvar} = $getval; } +foreach($_POST as $postvar => $postval){ ${$postvar} = $postval; } + +if(!isset($language)) $language="en"; + +//Übergabe der Parameter über FORM +if (isset($_POST['dbhost'])) +{ + $config['dbhost']=$dbhost; + $config['dbuser']=$dbuser; + $config['dbpass']=$dbpass; + $config['dbport']=$dbport; + $config['dbsocket']=$dbsocket; +} +else +{ + // Wenn Connection-String existiert -> Verbindungsdaten aus connstr auslesen + if (isset($connstr) && !empty($connstr)) + { + $p=explode("|",$connstr); + $dbhost=$config['dbhost']=$p[0]; + $dbuser=$config['dbuser']=$p[1]; + $dbpass=$config['dbpass']=$p[2]; + $dbport=$config['dbport']=$p[3]; + $dbsocket=$config['dbsocket']=$p[4]; + } + else $connstr=""; +} + +//Variabeln +$phase=(isset($phase)) ? $phase : 0; +$connstr="$dbhost|$dbuser|$dbpass|$dbport|$dbsocket"; +$delfiles=Array(); + +include_once('./inc/functions.php'); +include_once('./inc/mysql.php'); +include_once('./inc/runtime.php'); + +$config['language']=$language; +include('./language/lang_list.php'); +include('language/'.$language.'/lang_install.php'); +$img_ok='ok'; +$img_failed='failed'; +$href="install.php?language=$language&phase=$phase&connstr=$connstr"; + +?> + + + + + + + + MySQLDumper - Installation + + + + + + + + +9 && $phase<12) { + $Anzeige=$lang['install'].' - '.$lang['step'].' '.($phase-7); +} elseif ($phase>19 && $phase<100) { + $Anzeige=$lang['tools']; +} else { + $Anzeige=$lang['uninstall'].' - '.$lang['step'].' '.($phase-99); +} + +echo '
+

'.$lang['install_tomenu'].'

+
'; +echo '

+'.$Anzeige.' +

'; + +echo '

Version '.MSD_VERSION.' '.MSD_VERSION_ADD.'
'.$lang['install_forcescript'].'

+'; + + +switch ($phase) { + + case 0: // Anfang - Sprachauswahl + if(file_exists("config.php") && file_exists($config['paths']['config']."parameter.php"))zipConfig(); + + echo '
'; + echo ''; + echo '
LanguageTools
'; + echo GetLanguageCombo("radio","radio","language",""); + echo '
","
'; + + + foreach($lang['languages'] as $key) { + echo("\n
'.$lang['tools1'][$key].'

'); + if(file_exists($config['paths']['config']."config.gz")) echo ''.$lang['tools2'][$key].'

'; + if(file_exists($config['paths']['config']."parameter.php")) echo ''.$lang['tools3'][$key].'

'; + if(file_exists("config.php") && file_exists($config['paths']['config']."parameter.php")) echo ''.$lang['tools4'][$key].''; + echo("
"); + } + + echo("\n
"); + echo ''; + break; + case 1: // checken + if(isset($trychmod) && $trychmod==1) @chmod("config.php","0777"); + echo '
'.$lang['dbparameter'].'
'; + if(!is_writable("config.php")) { + echo '

'.$lang['confignotwritable'].'

'; + echo ''.$lang['tryagain'].''; + echo '     '.$lang['install_tomenu'].''; + } else { + $tmp=file("config.php"); + $stored=0; + + if (!isset($_POST['dbconnect'])) + { + // Erstaufruf - Daten aus config.php auslesen + for($i=0;$i'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + if(isset($dbconnect)) + { + echo ''; + echo ''; + } + echo '
'.$lang['db_host'].':
'.$lang['db_user'].':
'.$lang['db_pass'].':
'; + echo $lang['port'].':  '.$lang['install_help_port'].'
'.$lang['socket'].':  '.$lang['install_help_socket'].'
'.$lang['testconnection'].':
'.$lang['dbconnection'].'
'; + MSD_mysql_connect(); + + if(!$config['dbconnection']) { + echo '

'.$lang['connectionerror'].'

 '; + } else { + echo '

'.$lang['connection_ok'].'

'; + $connection="ok"; + $connstr="$dbhost|$dbuser|$dbpass|$dbport|$dbsocket"; + echo ''; + SearchDatabases(1); + } + echo '

'; + + if(isset($connection) && $connection=="ok" && !empty($databases['Name'])) { + + echo '
'; + echo ' + + + + + '; + echo '
'; + } + } + break; + case 2: // + echo '
MySQLDumper - '.$lang['confbasic'].'
'; + $tmp=@file("config.php"); + $stored=0; + for($i=0;$i'.$lang['import12'].'

'; + } else { + if(ini_get('safe_mode')==1) { + $nextphase=(extension_loaded("ftp")) ? 10 : 9; + } else $nextphase=$phase+2; + echo $lang['install_step2finished']; + echo '

 

'; + echo '
'; + echo '

 

'; + echo '
'; + } + + break; + case 3: // + if(ini_get('safe_mode')==1) $nextphase=10; else $nextphase=$phase+1; + echo '
'.$lang['editconf'].'
'; + echo '
+
   +    + '; + echo ''; + echo '
'; + + break; + case 4: //Verzeichnisse + + if(isset($_POST['submit'])) { + $ret=true; + if ($fp=fopen("config.php", "wb")) + { + if (!fwrite($fp,stripslashes(stripslashes($_POST['configfile'])))) $ret=false; + if (!fclose($fp)) $ret=false; + } + else $ret=false; + if($ret==false) { + echo '
'.$lang['errorman'].' config.php '.$lang['manuell'].'.'; + die; + } + } + + echo '
'.$lang['createdirs'].'
'; + + SetFileRechte("work/");@chmod("work",0777); + SetFileRechte("work/config/");@chmod("work/config",0777); + SetFileRechte("work/log/");@chmod("work/log",0777); + SetFileRechte("work/backup/");@chmod("work/backup",0777); + SetFileRechte("work/structure/");@chmod("work/structure",0777); + $iw[0]=IsWritable("work"); + $iw[1]=IsWritable("work/config"); + $iw[2]=IsWritable("work/log"); + $iw[3]=IsWritable("work/backup"); + $iw[4]=IsWritable("work/structure"); + + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) + echo ''; + echo '
'.$lang['dir'].''.$lang['rechte'].''.$lang['status'].'
work'.Rechte("work").''.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.Rechte("work/config").''.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.Rechte("work/log").''.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.Rechte("work/backup").''.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.Rechte("work/structure").''.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'

'; + break; + case 5: + echo '
'.$lang['laststep'].'
'; + + echo '

'.$lang['installfinished'].'

'; + SetDefault(true); + include("language/".$language."/lang_install.php"); + + if(file_exists($config['paths']['config']."config.gz")) { + echo '

'.$lang['import1'].''; + } + echo '

'.$lang['import2'].''; + + break; + case 9: + + clearstatcache(); + $iw[0]=IsWritable("work"); + $iw[1]=IsWritable("work/config"); + $iw[2]=IsWritable("work/log"); + $iw[3]=IsWritable("work/backup"); + $iw[4]=IsWritable("work/structure"); + echo '
'.$lang['ftpmode'].'
'; + echo '

'.$lang['safemodedesc'].'

'; + + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) + echo ''; + echo '
'.$lang['idomanual'].'
'.$lang['dofrom'].'
'.Realpfad('./').'
work'.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'
'; + + break; + case 10: //safe_mode FTP + $config['ftp_useSSL']=0; + clearstatcache(); + $iw[0]=IsWritable("work"); + $iw[1]=IsWritable("work/config"); + $iw[2]=IsWritable("work/log"); + $iw[3]=IsWritable("work/backup"); + $iw[4]=IsWritable("work/structure"); + if(!isset($install_ftp_port) || $install_ftp_port<1) $install_ftp_port=21; + echo '
'.$lang['ftpmode'].'
'; + echo '

'.$lang['safemodedesc'].'

'; + + echo ' +
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) + echo ''; + echo '
'.$lang['idomanual'].'
'.$lang['dofrom'].'
'.Realpfad('./').'
work'.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'.$lang['ftpmode2'].'
FTP-Server
FTP-Port
FTP-User
FTP-'.$lang['pass'].'
'.$lang['info_scriptdir'].'
+
'; + if(isset($ftp_connect)) { + echo '
'; + $tftp=TesteFTP($install_ftp_server,$install_ftp_port,$install_ftp_user_name,$install_ftp_user_pass,$install_ftp_path); + echo $tftp; + echo ' '; + if(substr($tftp,-9)=="") { + echo '
+ '; + echo ' + + + + '; + echo '
'; + } + echo '
'; + } + //echo ''; + + //echo ''; + + + break; + + case 11: //FTP-Create Dirs + echo '
'.$lang['ftpmode'].'
'; + if(CreateDirsFTP()==1) { + SetDefault(true); + echo DirectoryWarnings(); + echo '
'.$lang['installfinished']; + + if(is_writable($config['paths']['config'])) { + if(file_exists($config['paths']['config']."config.gz")) { + echo '

'.$lang['import1'].''; + } + echo '
'.$lang['import2'].''; + } + } + break; + case 20: //import + echo '
'.$lang['import'].'
'; + + $import=importConfig($config['paths']['config']."config.gz"); + if($import==0) { + echo '
'.$lang['import3'].'
'; + SetDefault(true); + echo '
'.$lang['import4'].'
'; + echo ''.$lang['import5'].'    '.$lang['import6'].''; + } elseif($import==1) { + echo '

'.$lang['import11'].'

'; + } elseif($import==2) { + echo '

'.$lang['import12'].'

'; + } + break; + + + + break; + case 21: //upload + import + echo '
'.$lang['import2'].'
'; + echo '
'; + echo '
'; + echo ''; + echo '
'; + + break; + case 22: //posting from upload + echo '
'.$lang['import7'].'
'; + $backlink=''.$lang['import8'].''; + if (isset($_POST['upload'])) + { + $error=false; + if (!($_FILES['upfile']['name'])) { + echo "".$lang['fm_uploadfilerequest'].'

'.$backlink; + exit; + } + + if (file_exists($config['paths']['config'].$_FILES['upfile']['name'])) unlink($config['paths']['config'].$_FILES['upfile']['name']); + + if ($_FILES['upfile']['name']!='config.gz') + { + echo "".$lang['import9']."

".$backlink; + exit; + } + if (move_uploaded_file($_FILES['upfile']['tmp_name'],$config['paths']['config'].$_FILES['upfile']['name'])) + { + chmod($config['paths']['config'].$upfile_name,0755); + + } else { + echo "".$lang['fm_uploadmoveerror']."
".$backlink; + exit; + } + } + echo '
'.$lang['import10'].'
'; + $import=importConfig($config['paths']['config']."config.gz"); + if($import==0) { + echo '
'.$lang['import3'].'
'; + SetDefault(true); + echo '
'.$lang['import4'].'
'; + echo ''.$lang['import5'].'    '.$lang['import6'].''; + } elseif($import==1) { + echo '

'.$lang['import11'].'

'; + } elseif($import==2) { + echo '

'.$lang['import12'].'

'; + } + break; + case 100: //uninstall + echo '
'.$lang['ui1'].'
'; + echo zipConfig().'

'; + echo '
'.$lang['ui2'].'
'; + echo ''.$lang['ui3'].'     '; + echo ''.$lang['ui4'].''; + break; + case 101: + echo '
'.$lang['ui5'].'
'; + $paths=Array(); + $w=substr($config['paths']['work'],0,strlen($config['paths']['work'])-1); + if(is_dir($w)) $res = rec_rmdir ($w); else $res=0; + // wurde das Verzeichnis korrekt gelöscht + if($res==0) { + // das Verzeichnis wurde korrekt gelöscht + echo '

'.$lang['ui6'].'

'; + echo $lang['ui7']."
\"".Realpfad("./")."\"
".$lang['manuell'].".

"; + echo ''.$lang['ui8'].''; + + }else { + echo '

'.$lang['ui9'].'"'.$paths[count($paths)-1].'"'; + + } + break; + } + +?> + +

+ + + + +Download Config from '.$config['paths']['config'].''; + +} + +function importConfig($importfile) +{ + global $config; + + $cf1=Array(); + $imp1=Array(); + $sql1=Array(); + $tmp=Array(); + + if(!file_exists($importfile)) exit; + $tmp=file("config.php"); + $imp=gzfile($importfile); + + for($i=0;$i diff --git a/mysqldumper/js/script.js b/mysqldumper/js/script.js new file mode 100644 index 0000000..41648fe --- /dev/null +++ b/mysqldumper/js/script.js @@ -0,0 +1,248 @@ +var NS = (document.layers); +var IE = (document.all); + +function setMenuActive(id) { + for(var i=1;i<9;i++) { + var objid='m' + i; + if(id==objid) { + parent.frames[0].document.getElementById(objid).className='active'; + } else { + parent.frames[0].document.getElementById(objid).className=''; + } + } +} + +//Filemanagement +function GetSelectedFilename() +{ + var a=""; + var obj=document.getElementsByName("file[]"); + var anz=0; + if(!obj.length) + { + if(obj.checked){a=obj.value;} + } + else + { + for (i=0; i0) { + document.getElementById('sqlstring'+i).value = obj.options[obj.selectedIndex].value; + document.getElementById('sqlname'+i).value = obj.options[obj.selectedIndex].text; + } +} + +function DisplayExport(s) { + document.getElementById("export_working").InnerHTML=s; +} +function SelectedTableCount() { + var obj=document.getElementsByName('f_export_tables[]')[0]; + var anz=0; + for (var i=0; i +
+

Über dieses Projekt

+Die Idee für dieses Projekt kam von Daniel Schlichtholz.

Er eröffnete 2004 das Forum MySQLDumper, und schon bald fanden sich Hobby-Programmierer, die neue Skripte schrieben und die von Daniel erweiterten.
Innerhalb kürzester Zeit entstand aus dem kleinen Backupskript ein stattliches Projekt.

Wenn Du Vorschläge zur Verbesserung hast, dann wende Dich an das MySQLDumper-Forum http://www.mysqldumper.de/board.

Wir wünschen Dir viel Vergnügen mit diesem Projekt.

Das MySQLDumper-Team

+ +
MySQLDumper +Daniel Schlichtholz - Steffen Kamper
+Perlscript mit Unterstützung von Detlev Richter
+Logo - René Schulze +
+
+ +

MySQLDumper Hilfe

+ + +

Download

+Dieses Script erhaltet Ihr auf der Homepage von MySQLDumper.
+Es empfiehlt sich, die Homepage regelmäßig zu besuchen, um Updates und +Hilfestellungen zu erlangen.
+Die Adresse lautet: +http://www.mysqldumper.de + +

Systemvoraussetzung

+Das Script arbeitet auf jedem Server (Windows, Linux, ...)
+mit PHP >= Version 4.3.4 mit GZip-Unterstützung, MySQL (ab Version 3.23), JavaScript (muss aktiviert sein). + +

Installation

+Die Installation geht einfach von statten. +Entpackt das Archiv in einen beliebigen Ordner.
+Ladet alle Dateien auf Euren Webserver hoch. (z. B. in die unterste Ebene in [Server Webverzeichnis/]MySQLDumper)
+... fertig!
+Ihr könnt MySQLDumper nun im Webbrowser durch "http://mein-webserver/MySQLDumper" aufrufen,
+um die Installation abzuschließen. Folgt einfach den Instruktionen.
+
Hinweis:
Falls auf Eurem Server der PHP-Safemode eingeschaltet ist, darf das Script keine +Verzeichnisse erstellen.
+Dies müsst Ihr dann von Hand nachholen, da MySqlDump die Daten geordnet in +Verzeichnissen ablegt.
+Das Script bricht mit einer entsprechenden Anweisung ab!
+Nachdem Ihr die Verzeichnisse (dem Hinweis entsprechend) erstellt habt, läuft es normal und ohne Einschränkungen.
+ +

Perlskript Anleitung

+Die Meisten haben ein cgi-bin Verzeichnis, in dem Perl ausgeführt werden kann.
+Dies ist meist per Browser über http://www.domain.de/cgi-bin/ erreichbar.
+
+Für diesen Fall bitte folgende Schritte durchführen:

+ +1. Rufe im MySQLDumper die Seite Backup auf und klicke auf "Backup Perl".
+2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht.
+3. Öffne die Datei "crondump.pl" im Editor.
+4. Trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen).
+5. Speichere crondump.pl .
+6. Kopiere crondump.pl, sowie perltest.pl und simpletest.pl ins cgi-bin-Verzeichnis (Ascii-Modus im FTP).
+7. Gebe den Dateien die Rechte 755.
+7b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen).
+8. Rufe die Konfiguration im MySQLDumper auf.
+9. Wähle die Seite Cronscript.
+10. Ändere Perl Ausführungspfad in /cgi-bin/ .
+10b. Wenn die Scripte .pl haben, ändere die Dateiendung auf .cgi .
+11. Speichere die Konfiguration.

+ +Fertig, die Skripte lassen sich nun von der Backupseite aufrufen.

+ +Wer Perl in allen Verzeichnissen ausführen kann, dem reichen folgende Schritte:

+ +1. Rufe im MySQLDumper die Seite Backup auf.
+2. Kopiere den Pfad, der hinter Eintrag in crondump.pl für $absolute_path_of_configdir: steht.
+3. Öffne die Datei "crondump.pl" im Editor.
+4. Trage den kopierten Pfad dort bei absolute_path_of_configdir ein (keine Leerzeichen).
+5. Speichere crondump.pl .
+6. gebe den Datein die Rechte 755.
+6b. Wenn die Endung cgi gewünscht ist, ändere bei allen 3 Dateien die Endung von pl -> cgi (umbenennen).
+(ev. 10b+11 von oben)
+
+ +Windowsuser müssen bei allen Scripten die erste Zeile ändern, dort steht der Pfad von Perl. Beispiel:
+statt: #!/usr/bin/perl -w
+jetzt: #!C:\perl\bin\perl.exe -w
+ +

Bedienung

    + +
    Menü
    +In der obigen Auswahlliste stellt Ihr die Datenbank ein.
    +Alle Aktionen beziehen sich auf die hier eingestellte Datenbank. + +
    Startseite
    +Hier erfahrt Ihr Einiges über Euer System, die verschiedenen, installierten +Versionen und Details über die konfigurierten Datenbanken.
    +Wenn Ihr auf den Datenbanknamen klickt, so seht Ihr eine Auflistung der Tabellen +mit der Anzahl der Einträge, der Größe und das letzte Aktualisierungsdatum. + +
    Konfiguration
    +Hier könnt Ihr eure Konfiguration bearbeiten, abspeichern oder die Ausgangskonfiguration +wieder herstellen. + + +
    Verwaltung
    +Hier werden die eigenlichen Aktionen durchgeführt.
    +Es werden Dir alle Dateien im Backup-Verzeichnis angezeigt. +Für die Aktionen "Restore" und "Delete" muss eine Datei selektiert sein. +
      +
    • Restore: Hiermit wird die Datenbank mit der ausgewählten Backupdatei aktualisiert.
    • +
    • Delete: Hiermit kannst Du die selektierte Backupdatei löschen.
    • +
    • Neues Backup starten: Hier startest Du ein neues Backup (Dump) nach den in der Konfiguration eingestellten Parametern.
    • +
    + +
    Log
    +Hier kannst Du die Logeinträge sehen und löschen. +
    Credits / Hilfe
    +diese Seite. +
+

Unsere Sponsoren

+Die Sponsoren finden Sie auch auf der Sponsorenseite
+ \ No newline at end of file diff --git a/mysqldumper/language/de/lang.php b/mysqldumper/language/de/lang.php new file mode 100644 index 0000000..81f47bb --- /dev/null +++ b/mysqldumper/language/de/lang.php @@ -0,0 +1,130 @@ +Achtung: Fortsetzung im Safe-Modus nicht möglich!Folgende Verzeichnisse müssen manuell im Scriptverzeichnisses angelegt werden:
\ No newline at end of file diff --git a/mysqldumper/language/de/lang_config_overview.php b/mysqldumper/language/de/lang_config_overview.php new file mode 100644 index 0000000..598dc43 --- /dev/null +++ b/mysqldumper/language/de/lang_config_overview.php @@ -0,0 +1,113 @@ +nicht per Email verschickt."; +$lang['no_del_files']="Es gibt keine Altersbegrenzung der Backupdateien."; +$lang['no_number_of_files']="Es gibt keine Begrenzung der Anzahl von Backupdateien."; +$lang['save_success']="Die Einstellungen wurden erfolgreich gespeichert."; +$lang['save_error']="Die Einstellungen konnten nicht gespeichert werden!"; +$lang['config_databases']="Datenbanken"; +$lang['config_dumprestore']="Backup / Wiederherstellung"; +$lang['config_email']="Email-Benachrichtigung"; +$lang['config_autodelete']="automatisches Löschen"; +$lang['config_interface']="Interface"; +$lang['config_cron']="Crondump-Einstellungen für das PHP-Script"; +$lang['multi_part_groesse']="maximale Dateigröße"; +$lang['help_multipart']="Bei eingeschaltetem Multipart werden mehrere Backupdateien erzeugt, deren Maximalgröße sich nach der unteren Einstellung richtet"; +$lang['help_multipartgroesse']="Die maximale Größe der einzelnen Backupdateien kann hier bei eingeschaltetem Multipart bestimmt werden"; +$lang['empty_db_before_restore']="Datenbank vor Wiederherstellung löschen"; +$lang['allpars']="alle Parameter"; +$lang['cron_timelimit']="Zeitlimit für das PHP-Cronjob-Script"; +$lang['cron_perlpath']="Pfad zu perl(.exe)"; +$lang['cron_extender']="Dateiendung des Scripts"; +$lang['cron_savepath']="Konfigurationsdatei"; +$lang['cron_printout']="Textausgabe"; +$lang['config_cronperl']="Crondump-Einstellungen für das Perlscript"; +$lang['cron_mail']="Backup per Mail senden"; +$lang['cron_mailprg']="Mailprogramm"; +$lang['cron_mailto']="Mailadresse"; +$lang['cron_ftp']="Backup per FTP senden"; +$lang['optimize']="Tabellen vor dem Backup optimieren"; +$lang['help_optimize']="Wenn die Option aktiviert ist, werden vor jedem Backup alle Tabellen optimiert"; +$lang['help_ftptimeout']="Die Zeit, die bei keiner Übertragung zum Timeout führt, Default 90 Sekunden."; +$lang['ftp_timeout']="Verbindungs-Timeout"; +$lang['help_ftpssl']=""; +$lang['config_askload']="Sollen die Einstellungen wirklich mit den Anfangseinstellungen überschrieben werden?"; +$lang['load']="Anfangseinstellungen +laden"; +$lang['load_success']="Die Anfangseinstellungen wurden geladen."; +$lang['cron_samedb']="Aktuelle Datenbank benutzen"; +$lang['cron_crondbindex']="Datenbank und Tabellen-Präfix
für den Cronjob"; +$lang['withattach']=" mit Anhang"; +$lang['withoutattach']=" ohne Anhang"; +$lang['multidumpconf']="=Multidump Einstellungen="; +$lang['multidumpall']="=alle Datenbanken="; +$lang['gzip']="GZip-Kompression"; +$lang['backup_dir']="Backup-Verzeichnis"; +$lang['db_only']="nur mit folgender Datenbank verbinden"; +$lang['send_mail_form']="Email senden"; +$lang['send_mail_dump']="Backup anhängen"; +$lang['email_adress']="Email-Adresse"; +$lang['email_subject']="Absender der Email"; +$lang['email_maxsize']="maximale Größe des Anhangs"; +$lang['age_of_files']="Alter der Dateien (in Tagen)"; +$lang['number_of_files_form']="Anzahl von Backupdateien"; +$lang['language']="Sprache"; +$lang['list_db']="Konfigurierte Datenbanken:"; +$lang['config_ftp']="FTP-Transfer der Backupdatei"; +$lang['ftp_transfer']="FTP-Transfer"; +$lang['ftp_server']="Server"; +$lang['ftp_port']="Port"; +$lang['ftp_user']="User"; +$lang['ftp_pass']="Passwort"; +$lang['ftp_dir']="Upload-Ordner"; +$lang['ftp_ssl']="Sichere SSL-FTP-Verbindung"; +$lang['ftp_useSSL']="benutze SSL-Verbindung"; +$lang['sqlboxheight']="Höhe der SQL-Box"; +$lang['sqllimit']="Anzahl der Datensätze pro Seite"; +$lang['bbparams']="Einstellung für BB-Code"; +$lang['bbtextcolor']="Textfarbe"; +$lang['config_expert']="Experten-Einstellungen"; +$lang['exp_chmod']="CHMod für das Arbeitsverzeichnis"; +$lang['help_commands']="Man kann vor und nach dem Backup einen Befehl ausführen lassen. +Dies kann eine SQL-Anweisung sein oder ein Systembefehl (z. B. ein Script)"; +$lang['withalldbs']="bei jeder Datenbank"; +$lang['cbd']="Befehl vor dem Backup"; +$lang['cad']="Befehl nach dem Backup"; +$lang['exec']="ausführen"; +$lang['commkind']="Art des Befehls"; +$lang['command']="Befehl"; +$lang['wrong_connectionpars']="Verbindungsparameter stimmen nicht!"; +$lang['connectionpars']="Verbindungs-Parameter"; +$lang['extendedpars']="erweiterte Parameter"; +$lang['dbonly']="Nur diese Datenbank"; +$lang['fade_in_out']="ein-/ausblenden"; +$lang['db_backuppars']="Datenbanken Backup-Einstellungen"; +$lang['general']="allgemein"; +$lang['maxsize']="max. Größe"; +$lang['backup_format']="Backup-Format"; +$lang['inserts_complete']="vollständige Inserts"; +$lang['inserts_extended']="erweiterte Inserts"; +$lang['inserts_delayed']="verzögerte Inserts"; +$lang['inserts_ignore']="fehlerübergehende Inserts"; +$lang['lock_tables']="Tabellen sperren"; +$lang['errorhandling_restore']="Fehlerbehandlung bei Wiederherstellung"; +$lang['ehrestore_continue']="fortfahren und Fehler protokollieren"; +$lang['ehrestore_stop']="anhalten"; +$lang['automatic']="automatisch"; +$lang['in_mainframe']="im Hauptframe"; +$lang['in_leftframe']="im linken Frame"; +$lang['width']="Breite"; +$lang['sql_befehle']="SQL-Befehle"; +$lang['download_languages']="andere Sprachen herunterladen"; +$lang['download_styles']="andere Themen herunterladen"; +$lang['connect_to']="Verbinde mit"; +$lang['changedir']="Wechsle in das Verzeichnis "; +$lang['changedirerror']="Konnte nicht in das Verzeichnis wechseln!"; +$lang['ftp_ok']="Die Verbindung wurde erfolgreich hergestellt."; +$lang['install']="Installation"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_dump.php b/mysqldumper/language/de/lang_dump.php new file mode 100644 index 0000000..b2f5818 --- /dev/null +++ b/mysqldumper/language/de/lang_dump.php @@ -0,0 +1,61 @@ +%s` gefunden werden."; +$lang['dump_endergebnis']="Es wurden %s Tabellen mit insgesamt %s Datensätzen gesichert.
"; +$lang['mailerror']="Leider ist beim Verschicken der Email ein Fehler aufgetreten!"; +$lang['emailbody_attach']="In der Anlage findest Du die Sicherung Deiner MySQL-Datenbank.
Sicherung der Datenbank `%s` +

Folgene Datei wurde erzeugt:

%s

Viele Grüße

MySQLDumper
Die Sicherungen werden nicht als Anhang mitgeliefert!
Sicherung der Datenbank `%s` +

Folgene Dateien wurden erzeugt:

%s


Viele Grüße

MySQLDumper
Die Sicherungen werden in seperaten Mails als Anhang geliefert!
Sicherung der Datenbank `%s` +

Folgene Dateien wurden erzeugt:

%s


Viele Grüße

MySQLDumper


Viele Grüße

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_toobig']="Die Sicherung überschreitet die Maximalgröße von %s und wurde daher nicht angehängt.
Sicherung der Datenbank `%s` +

Folgende Datei wurde erzeugt:

%s +

Viele Grüße

MySQLDumper
Sicherung der Datenbank `%s` +

Folgene Datei wurde erzeugt:

%s +

Viele Grüße

MySQLDumper
www.mysqldumper.de"; +$lang['email_only_attachment']=" ... nur der Anhang"; +$lang['tableselection']="Tabellenauswahl"; +$lang['selectall']="alle deselektieren"; +$lang['deselectall']="alle selektieren"; +$lang['startdump']="Backup starten"; +$lang['datawith']="Datensätze mit"; +$lang['lastbufrom']="letztes Update vom"; +$lang['startrestore']="Wiederherstellung starten"; +$lang['not_supported']="Dieses Backup unterstützt diese Funktion nicht."; +$lang['multidump']="Multidump: Es wurden %d Datenbanken gesichert."; +$lang['filesendftp']="versende File via FTP... bitte habe etwas Geduld. "; +$lang['ftpconnerror']="FTP-Verbindung nicht hergestellt! Verbindung mit "; +$lang['ftpconnerror1']=" als Benutzer "; +$lang['ftpconnerror2']=" nicht möglich"; +$lang['ftpconnerror3']="FTP-Upload war fehlerhaft! "; +$lang['ftpconnected1']="Verbunden mit "; +$lang['ftpconnected2']=" auf "; +$lang['ftpconnected3']=" geschrieben"; +$lang['nr_tables_selected']="- mit %s gewählten Tabellen"; +$lang['nr_tables_optimized']="Es sind %s Fehler aufgetreten: ansehen

"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_filemanagement.php b/mysqldumper/language/de/lang_filemanagement.php new file mode 100644 index 0000000..c97b1bd --- /dev/null +++ b/mysqldumper/language/de/lang_filemanagement.php @@ -0,0 +1,84 @@ +\""; +$lang['fm_restore_header2']="\"
"; +$lang['fm_dump_header']="Backup"; +$lang['DoCronButton']="Perl-Cronscript ausführen"; +$lang['DoPerlTest']="Perl-Module testen"; +$lang['DoSimpleTest']="Perl testen"; +$lang['cronperldesc']="Dies geht nur, wenn Perl ausgeführt werden kann.
Das Script liegt unter "; +$lang['perloutput1']="Eintrag in crondump.pl für absolute_path_of_configdir"; +$lang['perloutput2']="Aufruf im Browser oder für externen Cronjob"; +$lang['perloutput3']="Aufruf in der Shell oder für die Crontab"; +$lang['converter']="Backup-Konverter"; +$lang['convert_file']="zu konvertierendes File"; +$lang['convert_filename']="Name des Zielfiles (ohne Endung)"; +$lang['converting']="Konvertierung"; +$lang['convert_fileread']="Datei '%s' wird eingelesen"; +$lang['convert_finished']="Konvertierung abgeschlossen, '%s' wurde erzeugt."; +$lang['no_msd_backupfile']="Dateien anderer Programme"; +$lang['max_upload_size']="Maximale Dateigröße"; +$lang['max_upload_size_info']="Wenn Deine Backupdatei größer als das angegebene Limit ist, dann musst Du sie per FTP-Upload in den \"work/backup\"-Ordner hochladen.
+Danach kannst Du sie zum Wiederherstellen im MySQLDumper auswählen."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_help.php b/mysqldumper/language/de/lang_help.php new file mode 100644 index 0000000..3f85607 --- /dev/null +++ b/mysqldumper/language/de/lang_help.php @@ -0,0 +1,59 @@ + \ No newline at end of file diff --git a/mysqldumper/language/de/lang_install.php b/mysqldumper/language/de/lang_install.php new file mode 100644 index 0000000..7a0f78e --- /dev/null +++ b/mysqldumper/language/de/lang_install.php @@ -0,0 +1,100 @@ +die Installation ist abgeschlossen --> starte MySQLDumper
"; +$lang['install_forcescript']="MySQLDumper ohne Installation starten"; +$lang['install_tomenu']="zum Hauptmenü"; +$lang['installmenu']="Hauptmenü"; +$lang['step']="Schritt"; +$lang['install']="Installation"; +$lang['uninstall']="Deinstallation"; +$lang['tools']="Tools"; +$lang['editconf']="Konfiguration bearbeiten"; +$lang['osweiter']="ohne Speichern weiter"; +$lang['errorman']="Fehler beim Schreiben der Konfiguration!
Bitte editieren Sie das File "; +$lang['manuell']="manuell"; +$lang['createdirs']="erstelle Verzeichnisse"; +$lang['check0']=" ...ok Rechte: "; +$lang['check1']="prüfe Arbeitsverzeichnis ... "; +$lang['check2']="prüfe Backupverzeichnis ... "; +$lang['check3']="prüfe Strukturverzeichnis ... "; +$lang['check4']="prüfe Logverzeichnis ... "; +$lang['check5']="prüfe Konfigurationsverzeichnis ... "; +$lang['check6']="Ich habe die Verzeichnisse manuell erstellt, "; +$lang['check7']="Die Verzeichnisse wurden erstellt. speichere die Konfiguration ..."; +$lang['bitteweiter']="bitte weiter"; +$lang['install_continue']="mit der Installation fortfahren"; +$lang['connecttomysql']=" zu MySQL verbinden "; +$lang['dbparameter']="Datenbank-Parameter"; +$lang['confignotwritable']="Das File "; +$lang['dbconnection']="Datenbank-Verbindung"; +$lang['connectionerror']="Fehler: Konnte keine Verbindung herstellen."; +$lang['connection_ok']="Datenbank-Verbindung wurde hergestellt."; +$lang['saveandcontinue']="speichern und Installation fortsetzen"; +$lang['confbasic']="Grundeinstellungen"; +$lang['install_step2finished']="Datenbankeinstellungen wurden gesichert.

Sie können mit der Standardkonfiguration die Installation fortsetzen oder die Konfiguration bearbeiten."; +$lang['install_step2_1']="Installation mit Standardkonfiguration fortsetzen"; +$lang['laststep']="Abschluss der Installation"; +$lang['ftpmode']="Verzeichnisse per FTP erzeugen (safe_mode)"; +$lang['safemodedesc']="Da PHP mit der Option "; +$lang['idomanual']="ich erstelle die Verzeichnisse manuell"; +$lang['dofrom']="ausgehend von"; +$lang['ftpmode2']="erstelle die Verzeichnisse per FTP"; +$lang['connect']="verbinden"; +$lang['dirs_created']="Die Verzeichnisse wurden ordnungsgemäß erstellt."; +$lang['connect_to']="verbinde zu"; +$lang['changedir']="Wechsel ins Verzeichnis"; +$lang['changedirerror']="Wechsel ins Verzeichnis nicht möglich"; +$lang['ftp_ok']="FTP-Parameter sind ok"; +$lang['createdirs2']="Verzeichnisse erstellen"; +$lang['ftp_notconnected']="FTP-Verbindung nicht hergestellt!"; +$lang['connwith']="Verbindung mit"; +$lang['asuser']="als Benutzer"; +$lang['notpossible']="nicht möglich"; +$lang['dircr1']="erstelle Arbeitsverzeichnis"; +$lang['dircr2']="erstelle Backupverzeichnis"; +$lang['dircr3']="erstelle Strukturverzeichnis"; +$lang['dircr4']="erstelle Logverzeichnis"; +$lang['dircr5']="erstelle Konfigurationsverzeichnis"; +$lang['indir']="bin im Verzeichnis"; +$lang['test']="teste"; +$lang['check']="überprüfen"; +$lang['disabledfunctions']="Abgeschaltete Funktionen"; +$lang['noftppossible']="Es stehen keine FTP-Funktionen zur Verfügung!"; +$lang['nogzpossible']="Es stehen keine Kompressions-Funktionen zur Verfügung!"; +$lang['ui1']="Es werden alle Arbeitsverzeichnisse incl. den darin enthaltenen Backups gelöscht."; +$lang['ui2']="Sind Sie sicher, dass Sie das möchten ?"; +$lang['ui3']="Nein, sofort abbrechen"; +$lang['ui4']="ja, bitte fortfahren"; +$lang['ui5']="lösche Arbeitsverzeichnis"; +$lang['ui6']="alles wurde erfolgreich gelöscht."; +$lang['ui7']="Bitte löschen Sie das Skriptverzeichnis"; +$lang['ui8']="eine Ebene nach oben"; +$lang['ui9']="Ein Fehler trat auf, löschen war nicht möglich

Fehler bei Verzeichnis "; +$lang['import']="Konfiguration importieren"; +$lang['import1']="Einstellungen aus \"config.gz\" importieren"; +$lang['import2']="Einstellungen hochladen und importieren"; +$lang['import3']="Die Konfiguration wurde geladen..."; +$lang['import4']="Die Konfiguration wurde gesichert."; +$lang['import5']="MySQLDumper starten"; +$lang['import6']="Installations-Menü"; +$lang['import7']="Konfiguration uploaden"; +$lang['import8']="zurück zum Upload"; +$lang['import9']="Dies ist keine Konfigurationssicherung!"; +$lang['import10']="Die Konfiguration wurde erfolgreich hochgeladen..."; +$lang['import11']="Fehler: Es gab Probleme beim Schreiben der sql_statements"; +$lang['import12']="Fehler: Es gab Probleme beim Schreiben der config.php"; +$lang['expert']="erweitert"; +$lang['install_help_port']="(leer = Standardport)"; +$lang['install_help_socket']="(leer = Standardsocket)"; +$lang['tryagain']="nochmal versuchen"; +$lang['socket']="Socket"; +$lang['port']="Port"; +$lang['found_no_db']="FEHLER: nicht gefundene Datenbank:"; +$lang['found_db']="gefundene DB: "; +$lang['cron_completelog']=""; +$lang['fm_fileupload']="Datei hochladen"; +$lang['pass']="Passwort"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_log.php b/mysqldumper/language/de/lang_log.php new file mode 100644 index 0000000..bf12c75 --- /dev/null +++ b/mysqldumper/language/de/lang_log.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/mysqldumper/language/de/lang_main.php b/mysqldumper/language/de/lang_main.php new file mode 100644 index 0000000..39630a3 --- /dev/null +++ b/mysqldumper/language/de/lang_main.php @@ -0,0 +1,75 @@ +"; +$lang['htaccess10']="Die Passwörter sind nicht identisch oder leer!
"; +$lang['htaccess11']="Soll der Verzeichnisschutz jetzt erstellt werden?"; +$lang['htaccess12']="Der Verzeichnisschutz wurde erstellt."; +$lang['htaccess13']="Inhalt der Datei"; +$lang['htaccess14']="Es ist ein Fehler bei der Erstellung des Verzeichnisschutzes aufgetreten!
Bitte erzeuge die Dateien manuell mit folgendem Inhalt:"; +$lang['htaccess15']="Dringend empfohlen!"; +$lang['htaccess16']=".htaccess editieren"; +$lang['htaccess17']=".htaccess erstellen und editieren"; +$lang['htaccess18']=".htaccess erstellen in "; +$lang['htaccess19']=" neu laden "; +$lang['htaccess20']="Skript ausführen"; +$lang['htaccess21']="Handler zufügen"; +$lang['htaccess22']="Ausführbar machen"; +$lang['htaccess23']="Verzeichnis-Listing"; +$lang['htaccess24']="Error-Dokument"; +$lang['htaccess25']="Rewrite aktivieren"; +$lang['htaccess26']="Deny / Allow"; +$lang['htaccess27']="Redirect"; +$lang['htaccess28']="Error-Log"; +$lang['htaccess29']="weitere Beispiele und Dokumentation"; +$lang['htaccess30']="Provider"; +$lang['htaccess31']="allgemein"; +$lang['htaccess32']="Achtung! Die .htaccess hat eine direkte Auswirkung auf den Browser.
Bei falscher Anwendung sind die Seiten nicht mehr erreichbar."; +$lang['phpbug']="Bug in zlib! Keine Kompression möglich"; +$lang['disabledfunctions']="Abgeschaltete Funktionen"; +$lang['nogzpossible']="Da Zlib nicht installiert ist, stehen keine Gzip-Funktionen zur Verfügung."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_restore.php b/mysqldumper/language/de/lang_restore.php new file mode 100644 index 0000000..cabb5fc --- /dev/null +++ b/mysqldumper/language/de/lang_restore.php @@ -0,0 +1,25 @@ +%d Tabellen angelegt."; +$lang['file_missing']="konnte Datei nicht finden"; +$lang['restore_db']="Datenbank '%s' auf Server '%s'."; +$lang['restore_complete']="%s Tabellen wurden angelegt."; +$lang['restore_run1']="
Es wurden bisher %s von %s Datensätzen erfolgreich eingetragen."; +$lang['restore_run2']="
Momentan wird die Tabelle '%s' mit Datensätzen gefüllt.

"; +$lang['restore_complete2']="%s Datensätze wurden eingetragen."; +$lang['restore_tables_completed']="Es wurden bisher %d von %d Tabellen angelegt."; +$lang['restore_total_complete']="
Herzlichen Glückwunsch.

Die Datenbank wurde komplett wiederhergestellt.
Alle Daten aus der Backupdatei wurden erfolgreich in die Datenbank eingetragen.

Alles fertig. :-)"; +$lang['db_no_connection']="Keine Verbindung zur Datenbank möglich!"; +$lang['db_select_error']="
Fehler:
Auswahl der Datenbank '"; +$lang['db_select_error2']="' fehlgeschlagen!"; +$lang['file_open_error']="Fehler: Die Datei konnte nicht geöffnet werden."; +$lang['restore_entryerror']="Fehler beim Eintrag des Befehls:"; +$lang['progress_over_all']="Fortschritt gesamt"; +$lang['back_to_overview']="Datenbank-Übersicht"; +$lang['restore_run0']="
Es wurden bisher %s Datensätze erfolgreich eingetragen."; +$lang['unknown_sqlcommand']="Unbekannter SQL-Befehl:"; +$lang['notices']="Hinweise"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/de/lang_sql.php b/mysqldumper/language/de/lang_sql.php new file mode 100644 index 0000000..6e7aa77 --- /dev/null +++ b/mysqldumper/language/de/lang_sql.php @@ -0,0 +1,168 @@ +%s Zeilen exportiert"; +$lang['csv_fieldcount_nomatch']="Die Anzahl der Tabellenfelder stimmen nicht mit den zu importierenden Daten überein (%d statt %d)."; +$lang['csv_fieldslines']="%d Felder ermittelt, insgesamt %d Zeilen"; +$lang['csv_errorcreatetable']="Fehler beim Erstellen der Tabelle `%s`!"; +$lang['fm_uploadfilerequest']="Bitte gib eine Datei an."; +$lang['csv_nodata']="Keine Daten zum Importieren gefunden!"; +$lang['sqllib_generalfunctions']="allgemeine Funktionen"; +$lang['sqllib_resetauto']="Auto-Wert zurücksetzen"; +$lang['sqllib_boards']="Boards"; +$lang['sqllib_deactivateboard']="Board deaktivieren"; +$lang['sqllib_activateboard']="Board aktivieren"; +$lang['sqllib_boardoffline']="Board offline setzen"; +$lang['sqllib_boardonline']="Board online setzen"; +$lang['sql_notablesselected']="Es sind keine Tabellen selektiert!"; +$lang['tools']="Tools"; +$lang['tools_toolbox']="Datenbank auswählen / Datenbankfunktionen / Im- und Export "; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/help.php b/mysqldumper/language/en/help.php new file mode 100644 index 0000000..9a74f63 --- /dev/null +++ b/mysqldumper/language/en/help.php @@ -0,0 +1,151 @@ + +
+

About this project

+The idea for this project comes from Daniel Schlichtholz.

In 2004 he created a forum called MySQLDumper and soon, programmers who wrote new scripts, supplemented Daniel's scripts.
After a short time the small backup-script developed into a stately project.

If you have any improvement suggestions you can visit the MySQLDumper-Forum: http://www.mysqldumper.de.

We wish you a lot of fun with this project.

The MySQLDumper-Team

+
MySQLDumper +Daniel Schlichtholz - Steffen Kamper
+Perlscript with Support from Detlev Richter
+Logo - René Schulze +
+ + + +

MySQLDumper Help

+ + +

Download

+This Script is available on the Homepage of MySQLDumper.
+It is recommanded to visit the Homepage frequently to get the latest information, updates and help.
+The address is +http://www.mysqldumper.de/board + + +

System Mandatories

+The Script works with nearly any server (Windows, Linux, ...)
+and PHP >= Version 4.3.4 with GZip-Library, MySQL (>= 3.23), JavaScript (must be enabled). + +

Installation

+The installation is very easy. +Unpack the archive in any folder, +which is accessible from the Webserver
+(e.g. in the root directory [Server rootdir/]MySQLDumper)
+change config.php to chmod 777
+... all done!
+you can start MySQLDumper in your Browser by typing "http://webserver/MySQLDumper" +to complete the setup, just follow the instructions. + +
Note:
If your webserver runs with the option safemode=ON MySqlDump mustn't create directories.
+You will have to do that yourself.
+MySqlDump breaks in that case and tells you what to do.
+After you created the directories MySqlDump will function normally.

+ +

Guidance for the Perl script

+ +Most have a cgi-bin directory, in which Perl can be executed.
+This is usually by Browser over http://www.domain.de/cgi-bin/ available.

+ +Make the following steps for this case please.

+ +1. Call in MySQLDumper the page Backup and click "Backup Perl"
+2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir:
+3. open the file "crondump.pl" in the editor
+4. paste the copied path there with absolute_path_of_configdir (no blanks)
+5. Save crondump.pl
+6. copy crondump.pl, as well as perltest.pl and simpletest.pl to the cgi-bin directory (ASCII mode in the ftp-client!)
+7. chmod 755 to the scripts.
+7b. If the ending cgi is desired, change the ending of all 3 files pl - > cgi (rename)
+8. Call in the MySQLDumper the page Configuration
+9. click on Cronscript
+10. changes Perl execution path to /cgi-bin/
+10b. if the Scripts are renamed to *.cgi , change Fileextension to cgi
+11 save the Configuration

+ +Ready ! The scripts are available from the Page "Backup"

+ +When you can execute Perl anywhere, only following step are needed:

+ +1. Call in MySQLDumper the page Backup.
+2. Copy the path, that stands behind entry in crondump.pl for $absolute_path_of_configdir:
+3. open the file "crondump.pl" in the editor
+4. paste the copied path there with absolute_path_of_configdir (no blanks)
+5. Save crondump.pl
+ +6. chmod 755 to the scripts.
+6b. If the ending cgi is desired, change the ending of all 3 files pl - > cgi (rename)
+(ev. 10b+11 from above)

+ + +Windowsuser must change the first line of all Perlscripts, to the path of Perl.

+ +Example:
+ +instead of: #!/usr/bin/perl w
+now #!C:\perl\bin\perl.exe w
+ +

Operating

+

Our Sponsores

+The Sponsores can be found also at our
Sponsorepage
+ + diff --git a/mysqldumper/language/en/lang.php b/mysqldumper/language/en/lang.php new file mode 100644 index 0000000..aea40f9 --- /dev/null +++ b/mysqldumper/language/en/lang.php @@ -0,0 +1,130 @@ +Attention:Program can't continue in Safe-Mode!Create the following directories manually in the MySQLDumper directory:
\ No newline at end of file diff --git a/mysqldumper/language/en/lang_config_overview.php b/mysqldumper/language/en/lang_config_overview.php new file mode 100644 index 0000000..cb89cdf --- /dev/null +++ b/mysqldumper/language/en/lang_config_overview.php @@ -0,0 +1,111 @@ + for the Cron job"; +$lang['withattach']=" with attach"; +$lang['withoutattach']=" without attach"; +$lang['multidumpconf']="=Multidump Configuration="; +$lang['multidumpall']="=all Databases="; +$lang['gzip']="GZip compression"; +$lang['backup_dir']="Directory for Backup files"; +$lang['db_only']="only connect to this database"; +$lang['send_mail_form']="Send email report"; +$lang['send_mail_dump']="Attach backup"; +$lang['email_adress']="Email address"; +$lang['email_subject']="Sender address of the email"; +$lang['email_maxsize']="Maximum size of attachment"; +$lang['age_of_files']="Delete by age of files (in days)"; +$lang['number_of_files_form']="Delete by number of files"; +$lang['language']="Language"; +$lang['list_db']="Configured Databases:"; +$lang['config_ftp']="FTP Transfer of Backup file"; +$lang['ftp_transfer']="FTP Transfer"; +$lang['ftp_server']="Server"; +$lang['ftp_port']="Port"; +$lang['ftp_user']="User"; +$lang['ftp_pass']="Password"; +$lang['ftp_dir']="Upload directory"; +$lang['ftp_ssl']="Secure SSL FTP connection"; +$lang['ftp_useSSL']="use SSL Connection"; +$lang['sqlboxheight']="Height of SQL-Box"; +$lang['sqllimit']="Count of records each page"; +$lang['bbparams']="Configuration for BB-Code"; +$lang['bbtextcolor']="Text color"; +$lang['config_expert']="Expert Configuration"; +$lang['exp_chmod']="CHMod for Work directory"; +$lang['help_commands']="You can execute a command before and after the backup.\nThis command can be a SQL-Construct or a System Command (e.g. a script)"; +$lang['withalldbs']="with every database"; +$lang['cbd']="Command before Backup"; +$lang['cad']="Command after Backup"; +$lang['exec']="Execute"; +$lang['commkind']="Kind of Command"; +$lang['command']="Command"; +$lang['wrong_connectionpars']="Connection parameters are wrong !"; +$lang['connectionpars']="Connection Parameter"; +$lang['extendedpars']="Extended Parameter"; +$lang['dbonly']="Only this Database"; +$lang['fade_in_out']="Display on/off"; +$lang['db_backuppars']="Database Backup Parameter"; +$lang['general']="General"; +$lang['maxsize']="max. Size"; +$lang['backup_format']="Backup Format"; +$lang['inserts_complete']="Complete Inserts"; +$lang['inserts_extended']="Extended Inserts"; +$lang['inserts_delayed']="Delayed Inserts"; +$lang['inserts_ignore']="Error ignoring Inserts"; +$lang['lock_tables']="Lock Tables"; +$lang['errorhandling_restore']="Error Handling while restoring"; +$lang['ehrestore_continue']="continue and log errors"; +$lang['ehrestore_stop']="stop"; +$lang['automatic']="automatic"; +$lang['in_mainframe']="in main frame"; +$lang['in_leftframe']="in left frame"; +$lang['width']="Width"; +$lang['sql_befehle']="SQL Commands"; +$lang['download_languages']="download other languages"; +$lang['download_styles']="download other themes"; +$lang['connect_to']=""; +$lang['changedir']="Changing to Directory"; +$lang['changedirerror']="Couldn`t change directory!"; +$lang['ftp_ok']="Connection successful."; +$lang['install']="Installation"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_dump.php b/mysqldumper/language/en/lang_dump.php new file mode 100644 index 0000000..1328b63 --- /dev/null +++ b/mysqldumper/language/en/lang_dump.php @@ -0,0 +1,62 @@ +%s` "; +$lang['dump_endergebnis']="The file contains %s tables with %s records.
"; +$lang['mailerror']="Sending of email failed!"; +$lang['emailbody_attach']="The Attachment contains the backup of your MySQL-Database.
Backup of Database `%s` +

Following File was created:

%s

Kind regards

MySQLDumper
The Backup files are not attached to this email!
Backup of Database `%s` +

Following Files were created:

%s +

Kind regards

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_mp_attach']="A Multipart Backup was created.
The Backup files are attached to separate emails.
Backup of Database `%s` +

Following Files were created:

%s

Kind regards

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_footer']="`

Kind regards

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_toobig']="The Backup file exceeded the maximum size of %s and was not attached to this email.
Backup of Database `%s` +

Following File was created:

%s +

Kind regards

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_noattach']="Files are not attached to this email!
Backup of Database `%s` +

Following File was created:

%s +

Kind regards

MySQLDumper
www.mysqldumper.de"; +$lang['email_only_attachment']=" ... attachment only."; +$lang['tableselection']="Table selection"; +$lang['selectall']="Select All"; +$lang['deselectall']="Select None"; +$lang['startdump']="Start Backup"; +$lang['datawith']="Records with"; +$lang['lastbufrom']="last update from"; +$lang['startrestore']="Start Restore"; +$lang['not_supported']="This backup doesn't support this function."; +$lang['multidump']="Multidump: Backup of %d Databases done."; +$lang['filesendftp']="send file via FTP... please be patient. "; +$lang['ftpconnerror']="FTP connection not established! Connection with "; +$lang['ftpconnerror1']=" as user "; +$lang['ftpconnerror2']=" not possible"; +$lang['ftpconnerror3']="FTP Upload failed! "; +$lang['ftpconnected1']="Connected with "; +$lang['ftpconnected2']=" on "; +$lang['ftpconnected3']=" transfer successful"; +$lang['nr_tables_selected']="- with %s selected tables"; +$lang['nr_tables_optimized']="%s erros occured: view

"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_filemanagement.php b/mysqldumper/language/en/lang_filemanagement.php new file mode 100644 index 0000000..9821a32 --- /dev/null +++ b/mysqldumper/language/en/lang_filemanagement.php @@ -0,0 +1,82 @@ +\""; +$lang['fm_restore_header2']="\""; +$lang['fm_dump_header']="Backup"; +$lang['DoCronButton']="Run the Perl Cron script"; +$lang['DoPerlTest']="Test Perl Modules"; +$lang['DoSimpleTest']="Test Perl"; +$lang['cronperldesc']="This only works if you have Perl and the rights to use it
The address of the script is "; +$lang['perloutput1']="Entry in crondump.pl for absolute_path_of_configdir"; +$lang['perloutput2']="URL for the browser or for external Cron job"; +$lang['perloutput3']="Commandline in the Shell or for the Crontab"; +$lang['converter']="Backup Converter"; +$lang['convert_file']="File to be converted"; +$lang['convert_filename']="Name of destination file (without extension)"; +$lang['converting']="Converting"; +$lang['convert_fileread']="Read file '%s'"; +$lang['convert_finished']="Conversion finished, '%s' was written successfully."; +$lang['no_msd_backupfile']="Backups of other scripts"; +$lang['max_upload_size']="Maximum filesize"; +$lang['max_upload_size_info']="If your Dumpfile is bigger than the above mentioned limit, you must upload it via FTP into the directpry \"work/backup\".
+After that you will find it in the filemanagement and can select it to start a restore."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_help.php b/mysqldumper/language/en/lang_help.php new file mode 100644 index 0000000..e4b317f --- /dev/null +++ b/mysqldumper/language/en/lang_help.php @@ -0,0 +1,51 @@ + \ No newline at end of file diff --git a/mysqldumper/language/en/lang_install.php b/mysqldumper/language/en/lang_install.php new file mode 100644 index 0000000..389c1b1 --- /dev/null +++ b/mysqldumper/language/en/lang_install.php @@ -0,0 +1,100 @@ +Installation completed --> start MySQLDumper
"; +$lang['install_forcescript']="Start MySQLDumper without installation"; +$lang['install_tomenu']="Back to main menu"; +$lang['installmenu']="Main menu"; +$lang['step']="Step"; +$lang['install']="Installation"; +$lang['uninstall']="Uninstall"; +$lang['tools']="Tools"; +$lang['editconf']="Edit configuration"; +$lang['osweiter']="Continue without saving"; +$lang['errorman']="Error while saving the Configuration!
Please edit the File "; +$lang['manuell']="manually"; +$lang['createdirs']="Create Directories"; +$lang['check0']=" ...ok Rights: "; +$lang['check1']="checking work-directory ... "; +$lang['check2']="checking backup-directory ... "; +$lang['check3']="checking structure-directory ... "; +$lang['check4']="checking log-directory ... "; +$lang['check5']="checking configuration-directory ... "; +$lang['check6']="I have created the directories manually, "; +$lang['check7']="Directories were created. Saving configuration ..."; +$lang['bitteweiter']="please continue"; +$lang['install_continue']="Continue with installation"; +$lang['connecttomysql']="Connect to MySQL "; +$lang['dbparameter']="Database Parameters"; +$lang['confignotwritable']="The file "; +$lang['dbconnection']="Database Connection"; +$lang['connectionerror']="Error: unable to connect."; +$lang['connection_ok']="Database connection was established."; +$lang['saveandcontinue']="Save and continue installation"; +$lang['confbasic']="Basic Parameter"; +$lang['install_step2finished']="Database parameters were saved.

You may continue installation with the default settings or edit configuration."; +$lang['install_step2_1']="Continue installation with the default settings"; +$lang['laststep']="Installation Finish"; +$lang['ftpmode']="Create necessary directories in safe-mode"; +$lang['safemodedesc']="Because PHP is running in "; +$lang['idomanual']="I create the dirs myself"; +$lang['dofrom']="starting from"; +$lang['ftpmode2']="create the dirs with FTP"; +$lang['connect']="connect"; +$lang['dirs_created']="The directories are created and correctly permissioned."; +$lang['connect_to']="connect to"; +$lang['changedir']="change to dir"; +$lang['changedirerror']="change to dir was not possible"; +$lang['ftp_ok']="FTP parameter are ok"; +$lang['createdirs2']="Create directories"; +$lang['ftp_notconnected']="FTP connection not established!"; +$lang['connwith']="Connection with"; +$lang['asuser']="as user"; +$lang['notpossible']="not possible"; +$lang['dircr1']="create workdir"; +$lang['dircr2']="create backupdir"; +$lang['dircr3']="create structurdir"; +$lang['dircr4']="create logdir"; +$lang['dircr5']="create configurationdir"; +$lang['indir']="now in dir"; +$lang['test']="test"; +$lang['check']="Check my directories"; +$lang['disabledfunctions']="Disabled Functions"; +$lang['noftppossible']="You don't have FTP functions !"; +$lang['nogzpossible']="You don't have compression functions !"; +$lang['ui1']="All working directories which can contain backups will be deleted."; +$lang['ui2']="Are you sure you want that?"; +$lang['ui3']="no, cancel immediately"; +$lang['ui4']="yes, please continue"; +$lang['ui5']="delete working directories"; +$lang['ui6']="all was deleted successfully."; +$lang['ui7']="Please delete the script directory"; +$lang['ui8']="one level up"; +$lang['ui9']="An error occured, deleting was not possible

Error with directory "; +$lang['import']="Import Configuration"; +$lang['import1']="Import settings from \"config.gz\""; +$lang['import2']="Upload and import settings"; +$lang['import3']="Configuration was loaded ..."; +$lang['import4']="Configuration was saved."; +$lang['import5']="Start MySQLDumper"; +$lang['import6']="Installation Menu"; +$lang['import7']="Upload configuration"; +$lang['import8']="back to upload"; +$lang['import9']="This is not a configuration backup !"; +$lang['import10']="Configuration was uploaded successfully ..."; +$lang['import11']="Error: There were problems writing sql_statements"; +$lang['import12']="Error: There were problems writing config.php"; +$lang['expert']="Extended display"; +$lang['install_help_port']="(empty = Default Port)"; +$lang['install_help_socket']="(empty = Default Socket)"; +$lang['tryagain']="Try again"; +$lang['socket']="Socket"; +$lang['port']="Port"; +$lang['found_no_db']="ERROR: the following DB was not found:"; +$lang['found_db']="found db"; +$lang['cron_completelog']=""; +$lang['fm_fileupload']="Upload file"; +$lang['pass']="Password"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_log.php b/mysqldumper/language/en/lang_log.php new file mode 100644 index 0000000..2c2cd91 --- /dev/null +++ b/mysqldumper/language/en/lang_log.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/mysqldumper/language/en/lang_main.php b/mysqldumper/language/en/lang_main.php new file mode 100644 index 0000000..3c99bc6 --- /dev/null +++ b/mysqldumper/language/en/lang_main.php @@ -0,0 +1,75 @@ +"; +$lang['htaccess10']="The Passwords are not identical or empty !
"; +$lang['htaccess11']="Should the directory protection be written now ?"; +$lang['htaccess12']="The directory protection was created."; +$lang['htaccess13']="Contents of file:"; +$lang['htaccess14']="There was an error while creating the directory protection !
Please create the 2 files manually with following content:"; +$lang['htaccess15']="Urgently recommended !"; +$lang['htaccess16']="Edit .htaccess"; +$lang['htaccess17']="Create and edit .htaccess"; +$lang['htaccess18']="Create .htaccess in "; +$lang['htaccess19']="Reload "; +$lang['htaccess20']="Execute script"; +$lang['htaccess21']="Add handler"; +$lang['htaccess22']="Make executable"; +$lang['htaccess23']="Directory Listing"; +$lang['htaccess24']="Error Document"; +$lang['htaccess25']="Activate rewrite"; +$lang['htaccess26']="Deny / Allow"; +$lang['htaccess27']="Redirect"; +$lang['htaccess28']="Error Log"; +$lang['htaccess29']="More examples and documentation"; +$lang['htaccess30']="Provider"; +$lang['htaccess31']="General"; +$lang['htaccess32']="Attention! The .htaccess directly affects the browser's behavior.
With incorrect content, these pages may no longer be accessible."; +$lang['phpbug']="Bug in zlib ! No Compression possible"; +$lang['disabledfunctions']="Disabled Functions"; +$lang['nogzpossible']="Because Zlib is not installed, you cannot use GZip-Functions."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_restore.php b/mysqldumper/language/en/lang_restore.php new file mode 100644 index 0000000..1eee8a1 --- /dev/null +++ b/mysqldumper/language/en/lang_restore.php @@ -0,0 +1,25 @@ +%d tables were created."; +$lang['file_missing']="couldn't find file"; +$lang['restore_db']="Database '%s' on '%s'."; +$lang['restore_complete']="%s tables created."; +$lang['restore_run1']="
Up to now %s of %s records were successfully added."; +$lang['restore_run2']="
Now the table '%s' is restoring.

"; +$lang['restore_complete2']="%s records inserted."; +$lang['restore_tables_completed']="Up to now %d of %d tables were created."; +$lang['restore_total_complete']="
Congratulations.

The restoration of the database is done.
All data from the Backup file was restored.

Everything is done. :-)"; +$lang['db_no_connection']="Connection to database failed!"; +$lang['db_select_error']="
Error:
Selection of database "; +$lang['db_select_error2']=" failed!"; +$lang['file_open_error']="Error: could not open file."; +$lang['restore_entryerror']="Error: command can't be done:"; +$lang['progress_over_all']="Overall Progress"; +$lang['back_to_overview']="Database Overview"; +$lang['restore_run0']="
up to now %s records were successfully added."; +$lang['unknown_sqlcommand']="unknown SQL-Command"; +$lang['notices']="Notices"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/en/lang_sql.php b/mysqldumper/language/en/lang_sql.php new file mode 100644 index 0000000..15b956e --- /dev/null +++ b/mysqldumper/language/en/lang_sql.php @@ -0,0 +1,161 @@ +%s lines exported"; +$lang['csv_fieldcount_nomatch']="The count of fields doesn't match with that of the data to import (%d instead of %d)."; +$lang['csv_fieldslines']="%d fields recognized, totally %d lines"; +$lang['csv_errorcreatetable']="Error while creating table `%s` !"; +$lang['fm_uploadfilerequest']="please choose a file."; +$lang['csv_nodata']="No data found for import!"; +$lang['sqllib_generalfunctions']="general functions"; +$lang['sqllib_resetauto']="reset auto-increment"; +$lang['sqllib_boards']="Boards"; +$lang['sqllib_deactivateboard']="deactivate Board"; +$lang['sqllib_activateboard']="activate Board"; +$lang['sqllib_boardoffline']="switch Board to offline"; +$lang['sqllib_boardonline']="switch Board to online"; +$lang['sql_notablesselected']="No tables selected !"; +$lang['tools']="Tools"; +$lang['tools_toolbox']="Select Database / Datebase functions / Import - Export "; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/help.php b/mysqldumper/language/es/help.php new file mode 100644 index 0000000..149c3db --- /dev/null +++ b/mysqldumper/language/es/help.php @@ -0,0 +1,175 @@ + +
+

Sobre este proyecto

+La idea para este proyecto proviene de Daniel Schlichholz. +

En 2004 abrió el foro MySQLDumper e inmediatamente algunos aficionados a la programación se encontraron allí, para escribir y ampliar la versión inicial de los scripts de Daniel.
+En poco tiempo quedó establecido el proyecto de realizar un script de copia de seguridad. +

Si tiene Vd. alguna propuesta de mejora, notifíquela en el foro de MySQLDumper-Forum: http://www.mysqldumper.de/board. +

Le deseamos que disfrute del trabajo realizado en este proyecto.
+

+

El equipo de MySQLDumper

+ +
MySQLDumper +Daniel Schlichtholz - Steffen Kamper
+Perlscript con ayuda de Detlev Richter
+Logo - René Schulze +
+
+ +

Ayuda de MySQLDumper

+ + +

Descarga

+Este script puede descargarlo desde la página principal de MySQLDumper.
+Se recomienda que visite dicha página regularmente, para mantener el producto actualizado y poder descargar las ampliaciones que se vayan realizando.
+La dirección es: +http://www.mysqldumper.de/board + + +

Requisitos del sistema

+

El script funciona en cualquier servidor (Windows, Linux, ...) que soporte una versión de PHP superior a la 4.3.4 +(con GZip instalado)
+y con MySQL a partir de la versión 3.23

+

Además, debe tener activado el ejecutar secuencias de comandos JavaScript en su navegador.

+ +

Instalación

+
+La instalación es muy sencilla. Simplemente extraiga los ficheros (conservando la estructura de directorios) en una carpeta cualquiera.
+Suba (por FTP u otros medios) dichos ficheros a su servidor web. (por ejemplo, [directorio web de su servidor]/MySQLDumper)
+... listo!
+Ahora puede ejecutar MySQLDumper desde su navegador llamándolo desde la dirección "http://www.su_servidor.com/MySQLDumper", para iniciar el proceso de configuración, para el que simplemente debe seguir las instrucciones en pantalla.
+
Aviso:
+En caso de que su servidor tenga activado el modo seguro de PHP, el script no podrá crear los directorios que necesita.
+Si es así, deberá hacerlo Vd. de forma manual, según las instrucciones del proceso de configuración.
+Tras haber creado dichos directorios, todo funcionará normalmente y sin restricciones.
+ + +

Instrucciones para la instalación del script Perl

+

En la mayoría de los casos, el servidor dispondrá de un directorio llamado cgi-bin (o perl) desde el que pueden ejecutarse scripts perl.
+ Dichos scripts se podrán acceder desde su navegador mediante la dirección http://www.su_servidor.com/cgi-bin/ .
+
+Si este es su caso, siga las instrucciones siguientes:
+
+1. Ejecute MySQLDumper desde su navegador, y vaya a la página de and click "Backup Perl"
+2. Copie el camino que aparece en la sección de propiedades del Cronscript Perl, al lado de $absolute_path_of_configdir: .
+3. Abra el fichero "crondump.pl" en un editor cualquiera de texto.
+4. Pegue el camino copiado en la entrada absolute_path_of_configdir (sin espacios vacíos). Hay una muestra dos líneas por encima.
+5. Guarde "crondump.pl".
+6. Copie los ficheros "crondump.pl", así como "perltest.pl" y "simpletest.pl" en el directorio cgi-bin (hágalo en modo ASCII si usa FTP).
+7. Dé a dichos ficheros los derechos 0x755 (use chmod desde shell o desde su programa de FTP).
+7b. En caso de ser neesaria la extensión "cgi" para los scripts, cámbiela en los tres ficheros de "pl" a "cgi" (cambiar nombre).
+8. Vaya a la página de + +en MySQLDumper.
+9. Elija el apartado Cronscript.
+10. Cambie el Camino al Cronscript a "/cgi-bin/" (sin comillas).
+10b. Si ha renombrado los scripts a ".cgi", cambie la extensión de los scripts a ".cgi".
+11. Guarde la configuración.
+
+Ya ha terminado. Ahora puede llamar los scripts desde la página de + +. Le recomendamos que pruebe primero tanto Perl como los Módulos Perl, usando los botones apropiados para ello. Si no funciona alguno de los dos, es probable que no pueda utilizar su script.
+
+Aquellos usuarios que pueden ejecutar Perl en cualquier directorio, pueden alternativamente, seguir los pasos siguientes (más sencillos):
+
+1. Ejecute MySQLDumper desde su navegador, y vaya a la página de + +
+2. Copie el camino que aparece en la sección de propiedades del Cronscript Perl, al lado de $absolute_path_of_configdir: .
+3. Abra el fichero "crondump.pl" en un editor cualquiera de texto.
+4. Pegue el camino copiado en la entrada absolute_path_of_configdir (sin espacios vacíos). Hay una muestra dos líneas por encima.
+5. Guarde "crondump.pl" (si lo ha editado en local, súbalo nuevamente al servidor).
+6. Dé a los ficheros "crondump.pl", así como "perltest.pl" y "simpletest.pl", los derechos 0x755 (use chmod desde shell o desde su programa de FTP).
+7. En caso de ser neesaria la extensión "cgi" para los scripts, cámbiela en los tres ficheros de "pl" a "cgi" (cambiar nombre).
+8. Si ha renombrado los scripts a ".cgi", vaya a la página de + +en MySQLDumper, elija el apartado Cronscript y cambie la extensión de los scripts a ".cgi". Guarde la configuración.
+
+ + Nota: Tanto los usuarios de Windows como los usuarios de servidores con configuraciones no estándar, deberán cambiar en los tres scripts la primera línea para reflejar el camino correcto de Perl. Por ejemplo:
+en vez de: #!/usr/bin/perl -w
+ponga: #!C:\perl\bin\perl.exe -w
+

+

Instrucciones de uso

+ +
Menú
+

En el desplegable superior se encuentra la lista de bases de datos disponibles para trabajar con ellas. Tenga en cuenta que no necesariamente tendrá permiso para trabajar con todas ellas, sólo aquellas en las que su usuario tenga permisos podrán ser realmente accedidas. Las demás le darán simplemente un error.
+Todas las acciones se refieren siempre a la base de datos seleccionada en este desplegable.

+ +
    +
    +

    Aquí encontrará algunas propiedades de su sistema, como las versiones instaladas y algunos detalles de la base de datos.
    + Los botones superiores le permitirán acceder a las diferentes opciones, que tendrán más o menos sentido según el nivel de privilegios de su usuario de base de datos:

    +
    • le mostrará las informaciones genéricas, pudiendo además acceder a algunas de ellas en particular, para ampliarlas.
    • +
    • le llevará a la lista de las mismas, pudiendo crear otras nuevas. Si hace click en alguna de ellas, se le llevará a un menú avanzado dónde se le mostrarán las tablas que contiene y distintas opciones para con ellas.
    • +
    • le mostrará respectivamente los procesos, el estado y las opciones y definiciones del servidor de base de datos MySQL.
    • +
    • le permitirá acceder a una pseudoconsola del servidor de bases de datos y realizar operaciones complejas con el mismo. Nota: para poder utilizar dichas opciones, deberá tener los privilegios adecuados en el servidor MySQL.
    • +
    +

    Otra de las opciones importantes de este menú, es la creación o modificación de los ficheros .htaccess. Dichos ficheros gestionan directamente la seguridad de los directorios y es importante por ejemplo, que no cualquier visitante pueda acceder a los datos de su base de datos mediante este programa. Por ello se recomienda encarecidamente utilizar dicha opción (o cualquier otra de que disponga) para proteger esta aplicación de usos indebidos. No obstante tenga en cuenta que hacerlo de forma errónea puede impedirle a Vd. mismo el acceso. Si le sucede esto, no se preocupe, acceda al directorio mediante FTP o mediante su gestor de archivos habitual, y elimine el fichero .htaccess para desprotegerlo y poder volver a acceder normalmente al mismo.

    +
    +

    Aquí puede cambiar todos los datos de configuración del programa, guardar una copia de seguridad de la configuración, cargar una configuración preexistente, o volver a los valores iniciales de instalación.

    +
      +
    • le permite cambiar los parámetros de conexión (haga click en mostrar / esconder) del usuario de base de datos. Si hay más de una base de datos, puede elegir hacer un volcado múltiple e incluir más de una bases de datos en la copia de seguridad (la base de datos actual se muestra siempre en negrita). Además, podrá seleccionar las tablas que serán incluidas en la copia de seguridad mediante un prefijo.
    • +
        +
      • muestra un listado de todas las bases de datos accesibles. Si ha especificado en los parámetros de conexión, que solamente se muestre un tipo una base de datos, solamente aparecerá ésta. Si hay más de una base de datos accesible, puede elegir hacer un volcado múltiple e incluir más de una bases de datos en la copia de seguridad (la base de datos actual se muestra siempre en negrita). Además, podrá seleccionar las tablas de cada base de datos que deben ser incluidas en la copia de seguridad mediante un prefijo, excluyendo las que no contengan el mismo.
      • +
      • es el prefijo que puede especificar para seleccionar tablas de una base de datos. Por ejemplo puede especificar solamente aquellas tablas que empiecen con el prefijo "phpBB_". Si desea hacer una copia de seguridad de toda la base de datos, deje este campo en blanco.
      • +
      +
    • sirve para elegir las características genéricas de las copias de seguridad (compresión, memoria, velocidad [ALERTA: la velocidad excesiva puede provocar que el servidor deje de responder (timeout)], archivos de registro o logs, si se deben optimizar las tablas antes de hacer la copia, etc...) y de la restauración de datos (si se deben vaciar las tablas antes de hacerla, si se debe detener la importación en caso de errores).
    • +
        +
      • permite activar la compresión de los archivos. Se recomienda activarla, si el módulo GZIP está disponible en su servidor, ya que el tamaño de los archivos se reduce sensiblemente.
      • +
      • + permite vaciar el contenido de la base de datos totalmente antes de realizar la recuperación de datos de una copia de seguridad existente. Es recomendable en caso de recuperar una serie de tablas que se hayan corrompido. En caso de duda, se recomienda dejarlo desactivado, puesto que si realiza una recuperación parcial de algunas tablas, se eliminarían antes todas las tablas existentes, aunque no se encuentren presentes en la copia de seguridad a recuperar.
      • +
      +
    • permite elegir las características gráficas de la interfaz del programa. Puede elegir idioma, tema, definir algunos tamaños de ventana, incluso decidir si desea que aparezca el nombre del servidor en que se encuentra en este momento, y en qué lugar. La elección del navegador que utiliza es importante, ya que si lo hace de forma incorrecta, el programa no funcionará correctamente.
    • +
        +
      • : aquí puede seleccionar el idioma para el interfaz gráfico.
      • +
      +
    • define los parámetros que determinan si se van a eliminar archivos de copia de seguridad de forma automática o no.
    • +
        +
      • : activa o desactiva la eliminación augomática. Si está activado, se eliminarán los archivos necesarios (según las reglas definidas a continuación) antes de iniciar una nueva copia de seguridad. Es una opción útil para ahorrar espacio en el servidor, pero le recomendamos que no la active antes de haber podido probar el funcionamiento correcto del programa.
      • +
      • : un valor mayor que cero elimina todos los archivos de copia de seguridad que tengan mayor antigüedad que la escrita.
      • +
      • : un valor mayor que cero elimina todos los archivos de copia de seguridad en exceso del número especificado, bien en total, bien para cada base de datos distinta.
      • +
      +
    • define los parámetros que determinan si se va a enviar un email tras haber completado una copia de seguridad, así como si se deberá adjuntar dicha copia de seguridad y en qué forma.
    • +
        +
      • : activa o desactiva el envío de un email al haberse terminado la copia de seguridad, sea con o sin éxito.
      • +
      • : es la dirección de email a dónde se enviará el mensaje.
      • +
      • : es la dirección de email desde donde se enviará el mensaje. Recuerde permitirle el paso a través de su filtro anti-spam, si dispone de uno.
      • +
      +
    • permite definir una (o varias) transferencias por FTP del archivo de copia de seguridad una vez terminada la misma. Si se activa, se deben especificar las parámetros necesarios para realizar la conexión. Además, deberá tener los derechos apropiados en el servidor de destino de la copia.
    • +
        +
      • : activa o desactiva el envío de la copia de seguridad realizada con éxito, por FTP.
      • +
      • : es la dirección del servidor de FTP destinatario del archivo (por ejemplo ftp.misbackups.com).
      • +
      • : es el puerto de conexión del servidor FTP (generalmente, el puerto 21).
      • +
      • : es el nombre de usuario con el que debe realizarse la conexión.
      • +
      • : es el password a utilizar para establecer la conexión.
      • +
      • : es el directorio de destino del archivo a almacenar. Puede ser un camino absoluto o relativo (pero debe tener derechos de escritura en el mismo).
      • +
      +
    • permite definir las características de la copia de seguridad utilizando el script Perl. La mayoría de las opciones son muy parecidas a las establecidas para el interfaz gráfico, pero para el script Perl, que actúa de forma independiente.
    • +
    +
    +

    Esta es la parte más importante del programa. Desde aquí puede realizar una copia de seguridad de sus datos según las opciones establecidas anteriormente. Además, podrá seleccionar (si así lo desea) solamente algunas tablas para hacer dicha copia, de forma que no todos los datos de la base de datos sean copiados.

    +
    +

    Desde esta opción, podrá restaurar una copia de seguridad existente, a la base de datos seleccionada actualmente.

    +
    +

    En esta página se encuentran los archivos de copia de seguridad generados por el programa.
    + Podrá eliminarlos de uno en uno o en grupo, ejecutar el borrado automático de forma manual, descargar los archivos o subir un archivos para poder restaurarlo posteriormente.

    +
    +

    Aquí podrá ejecutar comandos SQL contra la base de datos, así como consultar la estructura de sus tablas. Para usuarios avanzados de MySQL.

    +
    +

    Aquí encontrará los informes de las operaciones realizadas y podrá borrarlos si así lo desea.

    +
    +

    La página actual.

    +
+

Nuestros esponsors

+Los esponsors de nuestra aplicación los puede consultar en la página de esponsors
+ \ No newline at end of file diff --git a/mysqldumper/language/es/lang.php b/mysqldumper/language/es/lang.php new file mode 100644 index 0000000..3fb4eb9 --- /dev/null +++ b/mysqldumper/language/es/lang.php @@ -0,0 +1,131 @@ +ATENCIÓN: no se puede seguir de forma segura!Los siguientes directorios deben ser creados manualmente en el directorio del Script:
\ No newline at end of file diff --git a/mysqldumper/language/es/lang_config_overview.php b/mysqldumper/language/es/lang_config_overview.php new file mode 100644 index 0000000..045d8aa --- /dev/null +++ b/mysqldumper/language/es/lang_config_overview.php @@ -0,0 +1,112 @@ +no se enviará por email."; +$lang['no_del_files']="No hay limitación en la antigüedad de los archivos de backup."; +$lang['no_number_of_files']="No hay limitación en la cantidad de archivos de backup."; +$lang['save_success']="La configuración se ha guardado con éxito."; +$lang['save_error']="�La configuración no ha podido ser guardada!"; +$lang['config_databases']="Bases de datos"; +$lang['config_dumprestore']="Copia de seguridad / Recuperación"; +$lang['config_email']="Notificación por email"; +$lang['config_autodelete']="Eliminación automática"; +$lang['config_interface']="Interfaz"; +$lang['config_cron']="Propiedades de Crondump para usarlo desde el script PHP"; +$lang['multi_part_groesse']="tamaño máximo del archivo"; +$lang['help_multipart']="Si selecciona archivos múltiples, se crearán varios archivos de copia de seguridad, el tamaño máximo de los cuales quedará determinado por las propiedades elegidas debajo"; +$lang['help_multipartgroesse']="El tamaño máximo de los archivos individuales de copia de seguridad en caso de activar la copia de seguridad en archivos múltiples, queda determinado por este valor"; +$lang['empty_db_before_restore']="Vaciar la base de datos antes de recuperar los valores"; +$lang['allpars']="todos los parámetros"; +$lang['cron_timelimit']="Tiempo límite para el Cronjob ejecutado a traves del script PHP"; +$lang['cron_perlpath']="Ubicación de perl(.exe)"; +$lang['cron_extender']="Extensión de los scripts"; +$lang['cron_savepath']="Archivo de configuración"; +$lang['cron_printout']="Salida de texto"; +$lang['config_cronperl']="Propiedades de Crondump como script perl"; +$lang['cron_mail']="Enviar el backup por email"; +$lang['cron_mailprg']="Programa de email"; +$lang['cron_mailto']="Dirección de email "; +$lang['cron_ftp']="Enviar archivo de backup por FTP"; +$lang['optimize']="Optimizar las tablas antes del backup"; +$lang['help_optimize']="Si esta opción está activada, se optimizarán todas las tablas antes de cada copia de seguridad"; +$lang['help_ftptimeout']="Tiempo de inactividad que tarda en cancelarse la conexión, 90 segundos por defecto."; +$lang['ftp_timeout']="Cancelación de la conexión"; +$lang['help_ftpssl']=""; +$lang['config_askload']="Desea realmente sobreescribir la configuración actual con la configuración inicial?"; +$lang['load']="Cargar config. inicial.\n"; +$lang['load_success']="La configuración inicial ha sido cargada."; +$lang['cron_samedb']="Usar la base de datos actual"; +$lang['cron_crondbindex']="Base de datos y prefijos de tablas
para Cronjob"; +$lang['withattach']=" con fichero adjunto"; +$lang['withoutattach']=" sin fichero adjunto"; +$lang['multidumpconf']="=Propiedades de Multidump="; +$lang['multidumpall']="=Todas las bases de datos="; +$lang['gzip']="Compresión GZip"; +$lang['backup_dir']="Directorio de copia de seguridad"; +$lang['db_only']="trabajar solamente con la siguiente base de datos"; +$lang['send_mail_form']="enviar un email"; +$lang['send_mail_dump']="Adjuntar copia de seguridad"; +$lang['email_adress']="Dirección de email"; +$lang['email_subject']="Email desde donde se envía"; +$lang['email_maxsize']="tamaño máximo del fichero adjunto"; +$lang['age_of_files']="Antigüedad del archivo (en días)"; +$lang['number_of_files_form']="Cantidad de archivos de copia de seguridad"; +$lang['language']="Idioma"; +$lang['list_db']="Bases de datos configuradas:"; +$lang['config_ftp']="Transferencia por FTP de los backups"; +$lang['ftp_transfer']="Transferencia FTP"; +$lang['ftp_server']="Servidor"; +$lang['ftp_port']="Puerto"; +$lang['ftp_user']="Usuario"; +$lang['ftp_pass']="Password"; +$lang['ftp_dir']="Directorio de subida"; +$lang['ftp_ssl']="Conexión segura mediante SSL-FTP"; +$lang['ftp_useSSL']="conexión SSL usada"; +$lang['sqlboxheight']="Altura del cuadro de SQL"; +$lang['sqllimit']="Cantidad de registros por página"; +$lang['bbparams']="Propiedades del código BB"; +$lang['bbtextcolor']="Color de texto"; +$lang['config_expert']="Propiedades avanzadas"; +$lang['exp_chmod']="CHMod para el directorio de trabajo"; +$lang['help_commands']="Antes y después de la copia de seguridad, puede hacer que se ejecute algún comando.\n +Puede tratarse de una sentencia SQL o de un archivo de comandos de sistema (por ejemplo, un script)"; +$lang['withalldbs']="para cada base de datos"; +$lang['cbd']="Comando antes de copia de seguridad"; +$lang['cad']="Comando después de copia de seguridad"; +$lang['exec']="ejecutar"; +$lang['commkind']="Tipo de comando"; +$lang['command']="Comando"; +$lang['wrong_connectionpars']="�Parámetros de conexión incorrectos!"; +$lang['connectionpars']="Parámetros de conexión"; +$lang['extendedpars']="Parámetros extendidos"; +$lang['dbonly']="Sólo ésta base de datos"; +$lang['fade_in_out']="mostrar/ocultar"; +$lang['db_backuppars']="Propiedades de la copia de seguridad de la base de datos"; +$lang['general']="Genéricas"; +$lang['maxsize']="tamaño máx."; +$lang['backup_format']="Formato de copia de seguridad"; +$lang['inserts_complete']="Inserts completos"; +$lang['inserts_extended']="Inserts extendidos"; +$lang['inserts_delayed']="Inserts con retraso"; +$lang['inserts_ignore']="Inserts que ignoren los errores"; +$lang['lock_tables']="bloquear tablas"; +$lang['errorhandling_restore']="Tratamiento de los errores en la recuperación de datos"; +$lang['ehrestore_continue']="informar de los errores y seguir"; +$lang['ehrestore_stop']="detenerse"; +$lang['automatic']="automático"; +$lang['in_mainframe']="en ventana principal"; +$lang['in_leftframe']="en ventana de menu"; +$lang['width']="ancho"; +$lang['sql_befehle']="Comandos SQL"; +$lang['download_languages']="Descargar otros idiomas"; +$lang['download_styles']="Descargar otros temas"; +$lang['connect_to']="Conectarse a "; +$lang['changedir']="Cambiando al directorio"; +$lang['changedirerror']="No se ha podido cambiar el directorio"; +$lang['ftp_ok']="La conexión se ha realizado correctamente"; +$lang['install']="Instalación"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_dump.php b/mysqldumper/language/es/lang_dump.php new file mode 100644 index 0000000..c864701 --- /dev/null +++ b/mysqldumper/language/es/lang_dump.php @@ -0,0 +1,60 @@ +%s` "; +$lang['dump_endergebnis']="%s Tablas con un total de %s registros, han sido guardadas con éxito.
"; +$lang['mailerror']="Se ha producido un error al intentar enviar el email!"; +$lang['emailbody_attach']="En el fichero adjunto encontrará la copia de seguridad de su base de datos MySQL.
Copia de seguridad de la base de datos `%s` +

Se ha creado el siguiente archivo:

%s


Saludos de

MySQLDumper
Los archivos no se adjuntan a este email!
Copia de seguridad de la base de datos `%s` +

Los siguientes archivos han sido adjuntados:

%s +


Saludos de

MySQLDumper
Los archivos se adjuntan a emails separados!
Copia de seguridad de la base de datos `%s` +

Los siguientes archivos han sido adjuntados:

%s


Saludos de

MySQLDumper


Saludos de

MySQLDumper
www.mysqldumper.de"; +$lang['emailbody_toobig']="La copia de seguridad ha sobrepasado el tamaño máximo de %s y por lo tanto no ha sido adjuntada.
Copia de seguridad de la base de datos `%s` +

Se ha creado el siguiente archivo:

%s


Saludos de

MySQLDumper
Copia de seguridad de la base de datos `%s` +

Se ha creado el siguiente archivo:

%s


Saludos de

MySQLDumper
www.mysqldumper.de"; +$lang['email_only_attachment']=" ... solamente el fichero adjunto"; +$lang['tableselection']="Elección de tablas"; +$lang['selectall']="seleccionar todas"; +$lang['deselectall']="deseleccionar todas"; +$lang['startdump']="iniciar copia de seguridad"; +$lang['datawith']="registros con"; +$lang['lastbufrom']="última actualización el"; +$lang['startrestore']="iniciar recuperación"; +$lang['not_supported']="Esta copia de seguridad no comprende esta función."; +$lang['multidump']="Copia múltiple, copia de seguridad de %d bases de datos resalizada."; +$lang['filesendftp']="envío del archivo vía FTP... tenga un poco de paciencia, por favor. "; +$lang['ftpconnerror']="Conexión no establecida! Conectarse a "; +$lang['ftpconnerror1']=" con el usuario "; +$lang['ftpconnerror2']=" ha sido imposible"; +$lang['ftpconnerror3']="El envío por FTP ha fallado! "; +$lang['ftpconnected1']="Conectado con "; +$lang['ftpconnected2']=" en "; +$lang['ftpconnected3']=" escritos"; +$lang['nr_tables_selected']="- con %s tablas seleccionadas"; +$lang['nr_tables_optimized']="%s tablas optimizadas."; +$lang['dump_errors']="

%s erros occured: view

"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_filemanagement.php b/mysqldumper/language/es/lang_filemanagement.php new file mode 100644 index 0000000..b1e12be --- /dev/null +++ b/mysqldumper/language/es/lang_filemanagement.php @@ -0,0 +1,82 @@ +\""; +$lang['fm_restore_header2']="\""; +$lang['fm_dump_header']="Copia de seguridad"; +$lang['DoCronButton']="Ejecutar Cronscript Perl"; +$lang['DoPerlTest']="Comprobar Módulos Perl"; +$lang['DoSimpleTest']="Comprobar Perl"; +$lang['cronperldesc']="Esto solamente funciona, cuando es posible ejecutar ficheros Perl.
El script está en "; +$lang['perloutput1']="Línea a escribir en crondump.pl para absolute_path_of_configdir"; +$lang['perloutput2']="Ejecutar desde el navegador o desde un Cronjob externo al servidor"; +$lang['perloutput3']="Ejecutar desde Shell o como entrada en Crontab"; +$lang['converter']="Copia de seguridad-Conversor"; +$lang['convert_file']="archivo que se convertirá"; +$lang['convert_filename']="Nombre del archivo de destino (sin extensión)"; +$lang['converting']="La conversión"; +$lang['convert_fileread']="Leyendo el archivo '%s'"; +$lang['convert_finished']="Conversión finalizada: '%s' se ha guardado correctamente."; +$lang['no_msd_backupfile']="Copias de seguridad de otros programas"; +$lang['max_upload_size']="Maximum filesize"; +$lang['max_upload_size_info']="If your Dumpfile is bigger than the above mentioned limit, you must upload it via FTP into the directpry \"work/backup\".
+After that you will find it in the filemanagement and can select it to start a restore."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_help.php b/mysqldumper/language/es/lang_help.php new file mode 100644 index 0000000..257d17f --- /dev/null +++ b/mysqldumper/language/es/lang_help.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/mysqldumper/language/es/lang_install.php b/mysqldumper/language/es/lang_install.php new file mode 100644 index 0000000..b579d3f --- /dev/null +++ b/mysqldumper/language/es/lang_install.php @@ -0,0 +1,100 @@ +La Instalación ha terminado --> iniciar MySQLDumper
"; +$lang['install_forcescript']="Iniciar MySQLDumper sin Instalación"; +$lang['install_tomenu']="al menú principal"; +$lang['installmenu']="Menú principal"; +$lang['step']="Paso"; +$lang['install']="Instalación"; +$lang['uninstall']="Desinstalación"; +$lang['tools']="Herramientas"; +$lang['editconf']="modificar configuración"; +$lang['osweiter']="seguir sin guardar"; +$lang['errorman']="Error al escribir la configuración!
Por favor, edite Vd. el fichero "; +$lang['manuell']="manualmente"; +$lang['createdirs']="Directorios creados"; +$lang['check0']=" ...ok Derechos: "; +$lang['check1']="comprobando directorio de trabajo ... "; +$lang['check2']="comprobando directorio de copias de seguridad ... "; +$lang['check3']="comprobando directorio de estructuras ... "; +$lang['check4']="comprobando directorio de informes ... "; +$lang['check5']="comprobando directorio de configuración ... "; +$lang['check6']="He creado manualmente los directorios, "; +$lang['check7']="Los directorios han sido creados. Guarde la configuración ..."; +$lang['bitteweiter']="continúe por favor"; +$lang['install_continue']="seguir con la instalación"; +$lang['connecttomysql']=" conectarse a MySQL "; +$lang['dbparameter']="Parámetros de la base de datos"; +$lang['confignotwritable']="El fichero "; +$lang['dbconnection']="Conexión a la base de datos"; +$lang['connectionerror']="Error: no se pudo realizar la conexión."; +$lang['connection_ok']="La conexión a la base de datos ha sido realizada con éxito."; +$lang['saveandcontinue']="guardar y seguir con la instalación"; +$lang['confbasic']="Propiedades básicas"; +$lang['install_step2finished']="Los datos de acceso a la base de datos han sido guardados.

Puede seguir con la configuración estándar, o personalizarla manualmente."; +$lang['install_step2_1']="seguir con propiedades estándar"; +$lang['laststep']="Fin de la instalación"; +$lang['ftpmode']="Crear directorios por FTP (en modo seguro)"; +$lang['safemodedesc']="Ya que PHP está configurado con la opción \"safe_mode=1\", no tiene permiso para crear directorios.
Por ello solamente puede crearlos por FTP. O bien los crea manualmente y les asigna los derechos correctos (importante!), o permite que lo haga este script. Para ello, deberá introducir los parámetros de conexión."; +$lang['idomanual']="crearé los directorios manualmente"; +$lang['dofrom']="hacer desde"; +$lang['ftpmode2']="creación de los directorios por FTP"; +$lang['connect']="conectar"; +$lang['dirs_created']="Los directorios han sido correctamente creados."; +$lang['connect_to']="conectar a"; +$lang['changedir']="cambiar al directorio"; +$lang['changedirerror']="No ha sido posible realizar el cambio de directorio"; +$lang['ftp_ok']="Los parámetros de FTP son correctos"; +$lang['createdirs2']="Crear directorios"; +$lang['ftp_notconnected']="Conexión por FTP no realizada!"; +$lang['connwith']="Conectar con"; +$lang['asuser']="como usuario"; +$lang['notpossible']="imposible"; +$lang['dircr1']="cree el directorio de trabajo "; +$lang['dircr2']="cree el directorio de copias de seguridad "; +$lang['dircr3']="cree el directorio de estructuras "; +$lang['dircr4']="cree el directorio de informes "; +$lang['dircr5']="cree el directorio de configuración "; +$lang['indir']="está en el directorio"; +$lang['test']="comprobar"; +$lang['check']="comprobar"; +$lang['disabledfunctions']="Funciones deshabilitadas"; +$lang['noftppossible']="Las funciones de FTP no están disponibles!"; +$lang['nogzpossible']="Las funciones de compressión no están disponibles!"; +$lang['ui1']="Se van a eliminar todos los directorios de trabajo, incluídos aquellos que contengan copias de seguridad."; +$lang['ui2']="Está seguro de que desea realizar la operación ?"; +$lang['ui3']="no, abortar inmediatamente"; +$lang['ui4']="si, deseo continuar"; +$lang['ui5']="eliminar directorio de trabajo"; +$lang['ui6']="todo ha sido eliminado satisfactoriamente."; +$lang['ui7']="Por favor, elimine el directorio de los scripts"; +$lang['ui8']="subir un directorio"; +$lang['ui9']="Se ha producido un error, no ha sido posible eliminarlo

Error en el directorio "; +$lang['import']="importar configuración"; +$lang['import1']="Importar propiedades de \"config.gz\""; +$lang['import2']="Cargar configuración e importar datos"; +$lang['import3']="La configuración ha sido cargada ..."; +$lang['import4']="La configuración ha sido guardada."; +$lang['import5']="Iniciar MySQLDumper"; +$lang['import6']="Menú de instalación"; +$lang['import7']="subir configuración"; +$lang['import8']="volver a subir"; +$lang['import9']="Este no es ningun fichero de configuración !"; +$lang['import10']="La configuración ha sido cargada con éxito ..."; +$lang['import11']="ERROR: Ha habido problemas al guardar sql_statements"; +$lang['import12']="ERROR: Ha habido problemas al guardar config.php"; +$lang['expert']="avanzadas"; +$lang['install_help_port']="(vacío = Puerto estándar)"; +$lang['install_help_socket']="(vacío = Socket estándar)"; +$lang['tryagain']="intentar nuevamente"; +$lang['socket']="Socket"; +$lang['port']="Puerto"; +$lang['found_no_db']="ERROR: No se ha encontrado la BdD:"; +$lang['found_db']="Encontrada BdD:"; +$lang['cron_completelog']=""; +$lang['fm_fileupload']="Subir archivo"; +$lang['pass']="Password"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_log.php b/mysqldumper/language/es/lang_log.php new file mode 100644 index 0000000..2611975 --- /dev/null +++ b/mysqldumper/language/es/lang_log.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/mysqldumper/language/es/lang_main.php b/mysqldumper/language/es/lang_main.php new file mode 100644 index 0000000..bc92503 --- /dev/null +++ b/mysqldumper/language/es/lang_main.php @@ -0,0 +1,75 @@ +"; +$lang['htaccess10']="¡Los passwords no son idénticos o están vacíos! "; +$lang['htaccess11']="¿Desea crear ahora la protección del directorio?"; +$lang['htaccess12']="La protección del directorio ha sido creada."; +$lang['htaccess13']="Contenido del archivo"; +$lang['htaccess14']="Se ha producido un error al crear la protección del directorio!
Por favor, coloque en él el siguiente archivo, con el contenido especificado:"; +$lang['htaccess15']="¡Altamente recomendado!"; +$lang['htaccess16']="editar .htaccess"; +$lang['htaccess17']="crear y editar .htaccess"; +$lang['htaccess18']="crear .htaccess en "; +$lang['htaccess19']=" cargar de nuevo "; +$lang['htaccess20']="Ejecutar script"; +$lang['htaccess21']="Escriba el proveedor"; +$lang['htaccess22']="Permitir ejecución"; +$lang['htaccess23']="Listado de directorios"; +$lang['htaccess24']="Documentos de error"; +$lang['htaccess25']="Activar la reescritura"; +$lang['htaccess26']="Denegar / Permitir"; +$lang['htaccess27']="Redirecccionar"; +$lang['htaccess28']="Historial de errores"; +$lang['htaccess29']="otros ejemplos y documentación"; +$lang['htaccess30']="Proveedor"; +$lang['htaccess31']="conjunto"; +$lang['htaccess32']="Alerta! El fichero .htaccess influye directamente el comportamiento de los navegadores.
Si lo crea de forma incorrecta, estas páginas no serán accesibles."; +$lang['phpbug']="¡Bug en zlib! No es posible comprimir archivos"; +$lang['disabledfunctions']="Funciones deshabilitadas"; +$lang['nogzpossible']="Dado que Zlib no está instalado, no puede usar las funciones de compresión GZip."; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_restore.php b/mysqldumper/language/es/lang_restore.php new file mode 100644 index 0000000..9659ed9 --- /dev/null +++ b/mysqldumper/language/es/lang_restore.php @@ -0,0 +1,26 @@ +%d tablas."; +$lang['file_missing']="no se encuentra el fichero"; +$lang['restore_db']="la base de datos '%s' en '%s'. +"; +$lang['restore_complete']="%s Las tablas han sido importadas."; +$lang['restore_run1']="
Hasta ahora se han importado %s de %s registros"; +$lang['restore_run2']="
Se está llenando de datos la tabla '%s'.

"; +$lang['restore_complete2']="%s registros insertados."; +$lang['restore_tables_completed']="Hasta el momento, se han recuperado %d de %d tablas."; +$lang['restore_total_complete']="
Felicidades.

La base de datos ha sido completamente restaurada.
Todos los datos de la copia de seguridad han sido importados con éxito.

He terminado. :-)"; +$lang['db_no_connection']="No es posible conectarse a la base de datos!"; +$lang['db_select_error']="
Error:
La selección de la base de datos '"; +$lang['db_select_error2']="' ha fallado!"; +$lang['file_open_error']="Error: no he podido abrir el fichero."; +$lang['restore_entryerror']="Error al ejecutar el comando:"; +$lang['progress_over_all']="Progreso total"; +$lang['back_to_overview']="vista de base de datos"; +$lang['restore_run0']="Hasta el momento, se han recuperado %s de tablas."; +$lang['unknown_sqlcommand']="comando SQL desconocido"; +$lang['notices']="Avisos"; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/es/lang_sql.php b/mysqldumper/language/es/lang_sql.php new file mode 100644 index 0000000..c025dd0 --- /dev/null +++ b/mysqldumper/language/es/lang_sql.php @@ -0,0 +1,155 @@ +%s líneas exportadas"; +$lang['csv_fieldcount_nomatch']="El número de campos no coincide con el de los datos a importar (%d en vez de %d)."; +$lang['csv_fieldslines']="%d campos reconocidos, totalizando %d líneas"; +$lang['csv_errorcreatetable']="¡Error al crear la tabla `%s`!"; +$lang['fm_uploadfilerequest']="Por favor, elija un archivo."; +$lang['csv_nodata']="¡No se han encontrado datos que importar!"; +$lang['sqllib_generalfunctions']="funciones generales"; +$lang['sqllib_resetauto']="reinicializar autoincremento"; +$lang['sqllib_boards']="Foros"; +$lang['sqllib_deactivateboard']="desactivar foro"; +$lang['sqllib_activateboard']="activar foro"; +$lang['sqllib_boardoffline']="poner foro offline"; +$lang['sqllib_boardonline']="poner foro online"; +$lang['sql_notablesselected']="¡No se han seleccionado tablas!"; +$lang['tools']="Herramientas"; +$lang['tools_toolbox']="Elección de base de datos / Funciones de base de datos / Im- y Exportar "; + + +?> \ No newline at end of file diff --git a/mysqldumper/language/flags/de.gif b/mysqldumper/language/flags/de.gif new file mode 100644 index 0000000..65b0ea9 Binary files /dev/null and b/mysqldumper/language/flags/de.gif differ diff --git a/mysqldumper/language/flags/en.gif b/mysqldumper/language/flags/en.gif new file mode 100644 index 0000000..fa450f0 Binary files /dev/null and b/mysqldumper/language/flags/en.gif differ diff --git a/mysqldumper/language/flags/es.gif b/mysqldumper/language/flags/es.gif new file mode 100644 index 0000000..1b4643a Binary files /dev/null and b/mysqldumper/language/flags/es.gif differ diff --git a/mysqldumper/language/flags/fr.gif b/mysqldumper/language/flags/fr.gif new file mode 100644 index 0000000..db75fc7 Binary files /dev/null and b/mysqldumper/language/flags/fr.gif differ diff --git a/mysqldumper/language/flags/it.gif b/mysqldumper/language/flags/it.gif new file mode 100644 index 0000000..fc5a2cc Binary files /dev/null and b/mysqldumper/language/flags/it.gif differ diff --git a/mysqldumper/language/lang_list.php b/mysqldumper/language/lang_list.php new file mode 100644 index 0000000..2c36f63 --- /dev/null +++ b/mysqldumper/language/lang_list.php @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/mysqldumper/log.php b/mysqldumper/log.php new file mode 100644 index 0000000..d2f7635 --- /dev/null +++ b/mysqldumper/log.php @@ -0,0 +1,104 @@ +ERROR !
Logdir is not writable

'); + +//lesen + +$errorbutton=''; +$perlbutton= ''; +$perlbutton2=''; + +//anzeigen +echo '
'; +echo ''; +echo $errorbutton.$perlbutton.$perlbutton2; +echo '

'; + +//Status Logfiles +echo '
'; +echo ''; +echo '
'.$lang['logfileformat'].'

'.(($config['logcompression']==1) ? 'compressed' : ''); +echo ''.(($config['logcompression']==1) ? $lang['compressed'] : $lang['notcompressed']).'
      '; +echo ''.substr($loginfo['log'],strrpos($loginfo['log'],"/")+1).'
'; +echo ($loginfo['errorlog_size']>0) ? ''.substr($loginfo['errorlog'],strrpos($loginfo['errorlog'],"/")+1).'
' : substr($loginfo['errorlog'],strrpos($loginfo['errorlog'],"/")+1).'
'; +echo ($loginfo['perllog_size']>0) ? ''.substr($loginfo['perllog'],strrpos($loginfo['perllog'],"/")+1).'
': substr($loginfo['perllog'],strrpos($loginfo['perllog'],"/")+1).'
'; +echo ($loginfo['perllogcomplete_size']>0) ? ''.substr($loginfo['perllogcomplete'],strrpos($loginfo['perllogcomplete'],"/")+1).'
': substr($loginfo['perllogcomplete'],strrpos($loginfo['perllogcomplete'],"/")+1).'
'; +echo 'total
'.byte_output($loginfo['log_size']).'
'.byte_output($loginfo['errorlog_size']).'
'.byte_output($loginfo['perllog_size']).'
'.byte_output($loginfo['perllogcomplete_size']).'
'.byte_output($loginfo['log_totalsize']).'
'.$lang['noreverse'].'   '.$lang['reverse'].'
'; + +$out=''; +if($r!=2) $out.='
';
+
+if(file_exists($lfile)) {
+	$zeilen = ($config['logcompression']==1) ? gzfile($lfile ) : file($lfile );
+	if($r==30) {
+		echo '
'.print_r($zeilen,true).'
'; + exit; + } + if($revers==1) $zeilen=array_reverse($zeilen); + foreach($zeilen as $zeile) { + if($r==2) { + $out.= $zeile; + } elseif($r==3) { + $z=explode("|:|",$zeile); + for($i=0;$i '.substr($z[$i],strpos($z[$i],": "))."
"; + } + } else { + $out.=''.substr($zeile,0,strpos($zeile,": ")).' '.substr($zeile,strpos($zeile,": ")); + } + } +} +if($r!=2) $out.='
'; + + +if($out!="") { + echo '
'; + echo ''; + echo '
'.$out.'
'; +} + +echo '
'; +echo MSDFooter(); +?> \ No newline at end of file diff --git a/mysqldumper/main.php b/mysqldumper/main.php new file mode 100644 index 0000000..1fc731f --- /dev/null +++ b/mysqldumper/main.php @@ -0,0 +1,580 @@ +'; +$action=(isset($_GET['action'])) ? $_GET['action'] : "status"; +$checkit=(isset($_GET['checkit'])) ? urldecode($_GET['checkit']) : ""; +$repair=(isset($_GET['repair'])) ? $_GET['repair'] : 0; +$is_htaccess=(file_exists("./.htaccess")); +if($is_htaccess) $htaccess_exist=file(".htaccess"); +$dba=$hta_dir=$Overwrite=$msg=""; + + + +//MySQL-Verbindung herstellen +MSD_mysql_connect(); + +if(isset($_POST['htaccess']) || $action=="schutz") { + + if($is_htaccess) $Overwrite='

'.$lang['htaccess8'].'

'; + $cry_txt=array($lang['htaccess5'],$lang['htaccess6'],$lang['htaccess7']); + $step=(isset($_POST['step']))?$_POST['step']:0; + $cryptart=(isset($_POST['cryptart'])) ? $_POST['cryptart'] :0; + $uname=(isset($_POST['username'])) ? $_POST['username'] : ""; + $upass1=(isset($_POST['userpass1'])) ? $_POST['userpass1'] : ""; + $upass2=(isset($_POST['userpass2'])) ? $_POST['userpass2'] : ""; + + if($step==1) { + $msg=""; + if($uname=="") $msg=$lang['htaccess9']; + if(($upass1!=$upass2) || ($upass1=="")) $msg.=$lang['htaccess10']; + if($msg!="") { + $msg='

'.$msg.'

'; + $step=0; + } else { + $msg='

'.$lang['htaccess11'].'

'; + } + } elseif($step==2) { + $htaccess = "AuthName \"MySQLDump\"\nAuthType Basic\nAuthUserFile ". $config['paths']['root'].".htpasswd\n\nrequire valid-user\n"; + if($cryptart==0) $userpass=crypt($upass1,CRYPT_STD_DES); + elseif($cryptart==1) $userpass=md5($upass1); + else $userpass=$upass1; + $htpasswd = $uname.":".$userpass; + if($file_htpasswd=@fopen(".htpasswd","w")) { + fputs($file_htpasswd,$htpasswd); + fclose($file_htpasswd); + $file_htaccess=@fopen(".htaccess","w"); + fputs($file_htaccess,$htaccess); + fclose($file_htaccess); + $msg= $lang['htaccess12'].'


'.$lang['htaccess13'].' .htaccess:'."\n".htmlspecialchars($htaccess).'


'.$lang['htaccess13'].' .htpasswd:'."\n". htmlspecialchars($htpasswd)."
"; + } else {$msg='

'.$lang['htaccess14'].'


'.$lang['htaccess13'].' .htaccess:'."\n".htmlspecialchars($htaccess).'


'.$lang['htaccess13'].' .htpasswd:'."\n". htmlspecialchars($htpasswd).'
';} + } + + //Ausgabe + echo headline(''.$lang['htaccess1']).$Overwrite; + if($step<2){ + + + if($step==0) { + $un=''; + $p1=''; + $p2=''; + $cry=''.$cry_txt[0].'  '; + $cry.=''.$cry_txt[1].'  '; + $cry.=''.$cry_txt[2].'  '; + + } else { + $un=$uname.''; + $p1='***************'; + $p2='***************'; + $cry=''.$cry_txt[$cryptart]; + } + echo $msg.'
'; + echo ''; + echo '
Name'.$un.'
'.$lang['htaccess2'].''.$p1.'
'.$lang['htaccess3'].''.$p2.'
'.$lang['htaccess4'].' '.$cry.'

'; + echo '
'; + + + } else echo $msg; + echo "











"; + include("inc/footer.php"); + die(); + +} + + +if(isset($_POST['error_submit'])) { + + $debug_adress="debug@daniel-schlichtholz.de"; + //$debug_adress="admin@localhost"; + + if(!isset($_POST['error_absender']) || $_POST['error_absender']=="") { + echo '

'.$lang['mailabsendererror'].'

'; + echo 'back ...'; + die; + } + if($_POST['error_name']=="")$_POST['error_name']=$_POST['error_absender']; + $header="From: ".$_POST['error_name']." <".$_POST['error_absender'].">\n"; + $header .= "Reply-To: ".$_POST['error_absender']."\n"; + $header .= "X-Mailer: PHP/" . phpversion(). "\n"; + $header .= "X-Sender-IP: $REMOTE_ADDR\n"; + $header .= "Content-Type: text/html"; + $subject=stripslashes($_POST['error_subject']); + $body="=======================================
Art: ".$_POST['error_kind']."

"; + $body.=$lang['Ausgabe'].": ".stripslashes(nl2br($_POST['error_aus']))."

"; + $body.=$lang['Zusatz'].": ".nl2br($_POST['error_zusatz'])."

"; + $body.=$lang['Variabeln'].": ".nl2br($_POST['error_vars']); + $body.="
=======================================

"; + + if (@mail($debug_adress, $subject, $body, $header)) { + echo $lang['berichtsent']."

"; + } else { + echo '

'.$lang['mailerror'].'

'; + $body=$lang['autobericht']." '".$_POST['error_name']."'

".$body; + $b=str_replace("
","\n",$body); + $b=str_replace("","\n",$b); + $b=rawurlencode(strip_tags($b)); + echo $lang['berichtman1'].' Debug-Team'; + + } + +} + +if($action=="edithtaccess") { + $htaccessdontexist=0; + + if((isset($_GET['create']) && $_GET['create']==1 ) || (isset($_POST['create']) && $_POST['create']==1)) { + $fp = fopen("$hta_dir.htaccess", "w"); + fwrite ($fp,"# created by MySQLDumper ".MSD_VERSION."\n"); + fclose ($fp); + } + if(isset($_POST['newload'])){ + $hta_dir=(isset($_POST['newhtadir'])) ? $_POST['newhtadir'] : ""; + } else $hta_dir=(isset($_POST['hta_dir'])) ? $_POST['hta_dir'] : ""; + if($hta_dir !="" && substr($hta_dir,-1)!="/")$hta_dir.="/"; + + if(isset($_POST['submit']) && isset($_POST['thta'])){ + $fp = fopen("$hta_dir.htaccess", "w"); + fwrite ($fp,$_POST['thta']); + fclose ($fp); + } + if(file_exists("$hta_dir.htaccess")){ + $htaccess_exist=file("$hta_dir.htaccess"); + } else { + $htaccessdontexist=1; + } + + + echo headline(''.$lang['htaccess16']); + echo '

'.$lang['htaccess32'].'

'; + echo '
File: .htaccess   '; + if($htaccessdontexist!=1) { + echo '


'; + echo '
'; + //Presets + echo '
Presets

'.$lang['htaccess30'].'

+ all-inkl
+ +

'.$lang['htaccess31'].'

+ '.$lang['htaccess20'].'
+ '.$lang['htaccess21'].'
+ '.$lang['htaccess22'].'
+ '.$lang['htaccess23'].'
+ '.$lang['htaccess24'].'
+ '.$lang['htaccess25'].'
+ '.$lang['htaccess26'].'
+ '.$lang['htaccess27'].'
+ '.$lang['htaccess28'].'
+
+ '.$lang['htaccess29'].' + '; + echo '
'.$lang['htaccess18'].'
'; + echo '   '; + echo '   '; + echo '
'; + } else { + echo '

'.$hta_dir.'.htaccess existiert nicht. Soll sie erstellt werden ?

'; + echo '
'; + } + echo '
'.$lang['back'].''; + exit; +} +if($action=="phpinfo") { + phpinfo(); + echo '

Home

'; + exit; +} +if($action=="extinfo") { + echo ErrorReport(); + exit; +} + +if($action=="db") { + for($i=0;$i"; + break; + } + if(isset($_POST['kill'.$i])) { + $res=mysql_query("DROP DATABASE `".$databases['Name'][$i]."`") or die(mysql_error().""); + $dba= '

'.$lang['db']." ".$databases['Name'][$i]." ".$lang['info_deleted']."

"; + SetDefault(); + include ($config['files']['parameter']); + echo ''; + break; + } + if(isset($_POST['optimize'.$i])) { + mysql_select_db($databases['Name'][$i],$config['dbconnection']); + $res = mysql_list_tables($databases['Name'][$i],$config['dbconnection']); + $tabellen=""; + WHILE ($row=mysql_fetch_row($res)) $tabellen.=$row[0].","; + $tabellen=substr($tabellen,0,(strlen($tabellen)-1)); + if ($tabellen>"") + { + $query="OPTIMIZE TABLE ".$tabellen; + $res=mysql_query($query) or die(mysql_error().""); + } + $_GET['dbid']=$i; + $dba= '

'.$lang['db'].' '.$databases['Name'][$i].' '.$lang['info_optimized'].'.

'; + break; + } + if(isset($_POST['check'.$i])) { + $checkit="ALL";$_GET['dbid']=$i; + } + } +} + +//Hier beginnt die Ausgabe +echo headline('Home'); +echo '
'; +echo ''; +echo ''; +echo ''; +echo ''; +echo '
'; + + +if($action=="status") { + //Infos über Backups + $Sum_Files=$Sum_Size=0; + $Last_BU=Array(); + $sm=($config['safe_mode']==1) ? " (Safemode)" : ""; + + $dh = opendir($config['paths']['backup']); + while (false !== ($filename = readdir($dh))) + { + if ($filename != "." && $filename != ".." && !is_dir($config['paths']['backup'].$filename)){ + $files[] = $filename; + $Sum_Files++; + $Sum_Size+=filesize($config['paths']['backup'].$filename); + $ft=filectime($config['paths']['backup'].$filename); + if(!isset($Last_BU[2]) || (isset($Last_BU[2]) && $ft>$Last_BU[2])){ + $Last_BU[0]=$filename; + $Last_BU[1]=date("d.m.Y H:i",$ft); + $Last_BU[2]=$ft; + } + } + } + + $status='
'.$lang['Statusinformationen'].'
'; + $status.= DirectoryWarnings(); + //Versionen + $status.='
'.$lang['Versionsinformationen'].'
'; + $status.='MySQL Dumper-Version: '.MSD_VERSION.' '.MSD_VERSION_ADD.'
'; + $status.='OS: '.MSD_OS.' ('.MSD_OS_EXT.')
'; + $status.='Browser: '.MSD_BROWSER_AGENT.' Version '.MSD_BROWSER_VERSION.'
'; + $status.='MySQL-Version: '.MSD_MYSQL_VERSION.'
'; + $status.='PHP-Version: '.PHP_VERSION.' Speicher: '.$config['ram'].' MB '.(($config['zlib']) ? '': '  '.$lang['phpbug'].'.  ').$sm.'  '; + $status.='Max Execution Time: '.$config['max_execution_time'].' sec.  [PHP-Info]  '; + $status.='
PHP-Extensions: '.$config['phpextensions'].''; + + + + + + + if($config['disabled']!="") $status.='
'.$lang['disabledfunctions'].': '.$config['disabled'].''; + if(!extension_loaded("ftp")) $status.= '
'.$lang['noftppossible'].''; + if(!$config['zlib']) $status.= '   
'.$lang['nogzpossible'].'
'; + + //MySQLDumper Informationen + $status.='
'.$lang['MySQL Dumper Informationen'].'
'.$lang['info_location'].' "'.$_SERVER['SERVER_NAME'].'" ('.($config['paths']['root']).')
'; + $status.=$lang['info_actdb'].": ".$databases['db_actual']."
"; + if($config['no_htaccess']==0) { + //.(($is_htaccess) ? '' : ''.$lang['htaccess15'].''); + if($is_htaccess) { + $status.=''.$lang['htaccess16'].''; + } else { + $status.=''.$lang['htaccess1'].'  '.$lang['htaccess15'].''; + //$status.='   +++ '.$lang['htaccess17'].' +++'; + } + } + //History + $status.='
History
'.$lang['backupfilesanzahl'].' '.$Sum_Files.' Backups ('.byte_output($Sum_Size).')
'; + + $status.=$lang['fm_freespace'].': '.MD_FreeDiskSpace().'
'; + if($Sum_Files>0) $status.=$lang['lastbackup'].' '.$lang['vom'].' '.((isset($Last_BU[1])) ? $Last_BU[1] : " - ").'
+      '.((isset($Last_BU[1])) ? '' : " - ").''.((isset($Last_BU[0])) ? $Last_BU[0] : " - ").'
'; + $status.='
['.$lang['Fehlerbericht'].']
'; + echo $status; +} elseif($action=="db") { + + + //Datenbanken + echo '
'.$lang['info_databases'].'
'; + echo $dba.''; + if(!isset($config['dbconnection'])) MSD_mysql_connect(); + + for($i=0;$i'; + } else { + mysql_select_db($databases['Name'][$i],$config['dbconnection']); + $tabellen = mysql_query("SHOW TABLES FROM `".$databases['Name'][$i]."`",$config['dbconnection']); + $num_tables = mysql_num_rows($tabellen); + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + if($i==$databases['db_selected_index']) $cl="dbrowsel"; + echo ''; + echo ''; + } + } + echo '
'.$databases['Name'][$i].''.$lang['info_nodb'].'
'; + echo ($i==$databases['db_selected_index']) ? "".$databases['Name'][$i]."" : $databases['Name'][$i]; + echo ''.$num_tables.' '.$lang['info_table1']; + echo ($num_tables>1) ? $lang['info_table2'] : ''; + echo '
'.$lang['create_database'].'
'; + echo '
'; +} elseif($action=="sys") { + $sysaction=(isset($_GET['dosys'])) ? $_GET['dosys'] : 0; + $msg=""; + $res=@mysql_query("SHOW VARIABLES LIKE 'datadir'",$config['dbconnection']); + if($res) { + $row = mysql_fetch_array($res); + $data_dir=$row[1]; + } + switch($sysaction) { + case 1: //FLUSH PRIVILEGES + $msg="> operating FLUSH PRIVILEGES
"; + $res=@mysql_query("FLUSH PRIVILEGES",$config['dbconnection']); + $meldung=mysql_error($config['dbconnection']); + if($meldung!="") { + $msg.='> MySQL-Error: '.$meldung; + } else { + $msg.="> Privileges were reloaded."; + } + break; + case 2: //FLUSH STATUS + $msg="> operating FLUSH STATUS
"; + $res=@mysql_query("FLUSH STATUS",$config['dbconnection']); + $meldung=mysql_error($config['dbconnection']); + if($meldung!="") { + $msg.='> MySQL-Error: '.$meldung; + } else { + $msg.="> Status was reset."; + } + break; + case 3: //FLUSH HOSTS + $msg="> operating FLUSH HOSTS
"; + $res=@mysql_query("FLUSH HOSTS",$config['dbconnection']); + $meldung=mysql_error($config['dbconnection']); + if($meldung!="") { + $msg.='> MySQL-Error: '.$meldung; + } else { + $msg.="> Hosts were reloaded.";; + } + break; + case 4: //SHOW MASTER LOGS + $msg="> operating SHOW MASTER LOGS
"; + $res=@mysql_query("SHOW MASTER LOGS",$config['dbconnection']); + $meldung=mysql_error($config['dbconnection']); + if($meldung!="") { + $msg.='> MySQL-Error: '.$meldung; + } else { + $numrows=mysql_num_rows($res); + if($numrows==0) { + $msg.='> there are no master log-files'; + }else{ + $msg.='> there are '.$numrows.' logfiles
'; + for($i=0;$i<$numrows;$i++) { + $row=mysql_fetch_row($res); + $msg.='> '.$row[0].'   '.(($data_dir) ? byte_output(filesize($data_dir.$row[0])) : '').'
'; + } + } + } + break; + case 5: //RESET MASTER + $msg="> operating RESET MASTER
"; + $res=@mysql_query("RESET MASTER",$config['dbconnection']); + $meldung=mysql_error($config['dbconnection']); + if($meldung!="") { + $msg.='> MySQL-Error: '.$meldung; + } else { + $msg.="> All Masterlogs were deleted."; + } + break; + } + echo '
'.$lang['mysqlsys'].'
'; + echo ''; + echo '
'; + echo '> MysSQL Dumper v'.MSD_VERSION.' - Output Console

'; + echo ($msg!="") ? $msg : '> waiting for operation ...
'; + echo '
'; +} elseif($action=="vars") { + $var=(isset($_GET['var'])) ? $_GET['var'] : "prozesse"; + $Titelausgabe=array("variables"=>$lang['Variabeln'],"status"=>$lang['Status'],"prozesse"=>$lang['Prozesse']); + echo '
'.$lang['mysqlvars'].'
'.$Titelausgabe[$var].'    '; + echo ''.$lang['Prozesse'].'   '; + echo ''.$lang['Status'].'   '; + echo ''.$lang['Variabeln'].'   '; + + echo '

 

'; + //Variabeln + switch($var) { + case "variables": + $res=@mysql_query("SHOW variables"); + if($res) $numrows=mysql_num_rows($res); + if($numrows==0) {echo $lang['info_novars'];} else { + echo ''; + for ($i = 0; $i < $numrows; $i++) { + $row = mysql_fetch_array($res); + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + echo ''; + } + } + echo '
Name'.$lang['Inhalt'].'
'.$row[0].''.$row[1].'
'; + break; + case "status": + $res=@mysql_query("SHOW STATUS"); + if($res) $numrows=mysql_num_rows($res); + if($numrows==0) {echo $lang['info_nostatus'];} else { + echo ''; + for ($i = 0; $i < $numrows; $i++) { + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + $row = mysql_fetch_array($res); + echo ''; + } + } + echo '
Name'.$lang['Inhalt'].'
'.$row[0].''.$row[1].'
'; + break; + case "prozesse": + if($config['processlist_refresh']<1000)$config['processlist_refresh']=2000; + if(isset($_GET['killid']) && $_GET['killid']>0) { + $killid=(isset($_GET['killid'])) ? $_GET['killid'] : 0; + $wait=(isset($_GET['wait'])) ? $_GET['wait'] : 0; + if($wait==0) { + $ret=mysql_query("KILL ".$_GET['killid']); + $wait=2; + } else $wait+=2; + + if($wait==0) { + echo '

'.$lang['processkill1'].$_GET['killid'].$lang['processkill2'].$ret.'

'; + } else { + echo '

'.$lang['processkill3'].$wait.$lang['processkill4'].$_GET['killid'].$lang['processkill2'].$ret.'

'; + } + + } + + $killid=$wait=0; + $res=@mysql_query("SHOW FULL PROCESSLIST "); + if($res) $numrows=mysql_num_rows($res); + if($numrows==0) {echo $lang['info_noprocesses'];} else { + echo ''; + for ($i = 0; $i < $numrows; $i++) { + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + $row = mysql_fetch_array($res); + echo ' + + + '; + if($row[0]==$killid && $row[4]=="Killed") { + $wait=$killid=0; + } + } + } + echo '
IDUserHostDBCommandTimeStateInfoRT: '.round($config['processlist_refresh']/1000).' sec
'.$row[0].''.$row[1].''.$row[2].''.$row[3].''.$row[4].''.$row[5].''.$row[6].''.$row[7].'kill
'; + echo '
+ + + +
'; + echo ''; + + break; + } + echo '
'; + +} + + +//Datenbankdetails +if (isset($_GET['dbid'])) +{ + $dbid=$_GET['dbid']; + echo '
'.$lang['info_dbdetail'].'"'.$databases['Name'][$dbid].'"
'; + + $res=@mysql_query("SHOW TABLE STATUS FROM `".$databases['Name'][$dbid]."`"); + mysql_select_db($databases['Name'][$dbid]); + if($res) $numrows=mysql_num_rows($res); + if($numrows==0) { + echo $lang['info_dbempty']; + + } else { + echo $numrows.' '.$lang['info_table1']; + echo ($numrows>1) ? $lang['info_table2'] : ''; + + echo "\n".'
'. + ''."\n"; + $last_update="2000-01-01 00:00:00"; + $s=$s1=$s2=""; + for ($i = 0; $i < $numrows; $i++) + { + $row = mysql_fetch_array($res); + $akt_size=$row['Data_length']+$row['Index_length']; + $cl= ($i % 2) ? 'dbrow' : 'dbrow1'; + echo "\n".''; + if(isset($row['Update_time'])) if(strtotime($row['Update_time'])>strtotime($last_update)) $last_update=$row['Update_time']; + $s1=$s1+$row['Rows']; + $s2=$s2+$row['Data_length']+$row['Index_length']; + } + echo ''; + echo '
Nr.'. + $lang['info_table1'].''. + $lang['info_records'].''. + $lang['info_size'].''. + $lang['info_lastupdate'].''. + $lang['info_optimized'].'Status
'.($i+1).''. + $row['Name'].''. + number_format($row['Rows'],0,",",".").''. + byte_output($akt_size). + ' '. + $row['Update_time'].''; + if ($row['Data_free']==0) echo ''; + else echo ' '.$lang['no'].' '; + echo ''; + if($checkit==$row['Name'] || $repair==1) { + $tmp_res=mysql_query("REPAIR TABLE `".$row['Name']."`"); + } + if(($checkit==$row['Name'] || $checkit=="ALL") && $akt_size>0) { + $tmp_res=mysql_query("CHECK TABLE `".$row['Name']."`"); + if($tmp_res) { + $tmp_row = mysql_fetch_row($tmp_res); + echo ($tmp_row[3]=="OK") ? '' : ' repair '; + } else echo "CHECK TABLE `".$row['Name']."`"; + } else { + if($akt_size>0) echo 'check'; + else echo "-"; + } + echo '
'.$lang['info_sum'].'' + .number_format($s1,0,",",".").''.byte_output($s2).''.$last_update.' 
'; + } + $edb=$lang['info_emptydb1'].' `'.$databases['Name'][$dbid].'` '.$lang['info_emptydb2']; + $kdb=$lang['info_emptydb1'].' `'.$databases['Name'][$dbid].'` '.$lang['info_killdb']; + + echo '
'; + if($numrows>0) echo ''; + echo ''; + if($numrows>0) { + echo ''; + echo ''; + } + echo '
'; +} +echo MSDFooter();; + + +?> diff --git a/mysqldumper/menu.php b/mysqldumper/menu.php new file mode 100644 index 0000000..777ef4d --- /dev/null +++ b/mysqldumper/menu.php @@ -0,0 +1,103 @@ + +var curl=parent.MySQL_Dumper_content.location.href.split("/"); +var cdatei=curl.pop(); +var ca=cdatei.split("."); +if(ca[0]!="sql" && ca[0]!="dump" && ca[0]!="restore" && ca[0]!="frameset") { + parent.MySQL_Dumper_content.location.href=parent.MySQL_Dumper_content.location.href; +} +'; +$msg=''; + + +if(isset($_GET['action'])) { + if($_GET['action']=='dbrefresh') { + $msg.=SetDefault(); + echo $pagerefresh; + + } +} + +if(isset($_POST['dbindex'])) +{ + $dbindex=$_POST['dbindex']; + $databases['db_selected_index']=$dbindex; + SelectDB($dbindex); + WriteParams(1,$config,$databases); + echo $pagerefresh; +} else $dbindex=0; + + +//Ausgabestart +echo MSDHeader(1); +echo headline('',0); + +?> + + + +
+
+ :
+ + + + + + +
+
+ + + diff --git a/mysqldumper/msd_cron/crondump.pl b/mysqldumper/msd_cron/crondump.pl new file mode 100644 index 0000000..4984546 --- /dev/null +++ b/mysqldumper/msd_cron/crondump.pl @@ -0,0 +1,797 @@ +#!/usr/bin/perl -w +######################################################################################## +# MySQLDumper CronDump +# +# 2004,2005 by Steffen Kamper +# additional scripting: Detlev Richter +# +# for support etc. visit http://www.mysqldumper.de/board +# (c) GNU General Public License +######################################################################################## +# Script-Version +my $pcd_version="1.21"; + +######################################################################################## +# please enter the absolute path of the config-dir +# for using the script without Parameters the mysqldumper.conf will be load +# e.g.: +#my $absolute_path_of_configdir="/home/user1234/public_html/mysqldumper/work/config/"; +# +my $absolute_path_of_configdir="/home/www/doc/8176/mysqldumper.de/www/mysqldumper/work/config/"; +my $cgibin_path=""; # this is needed for MIME::Lite if it is in cgi-bin +my $default_configfile="mysqldumper.conf"; + +######################################################################################## +# nothing to edit under this line !!! +######################################################################################## +# import the necessary modules ... +use strict; +use DBI; +use File::Find; +use File::Basename; +use CGI::Carp qw/ warningsToBrowser fatalsToBrowser /; + + + + +# import the optional modules ... +my $eval_in_died; +my $mod_gz=0; +my $mod_ftp=0; +my $mod_mime=0; +push (@INC, "$cgibin_path"); + +eval { $eval_in_died = 1; require Compress::Zlib; }; +if(!$@){ + $mod_gz = 1; + import Compress::Zlib; +} +eval { $eval_in_died = 1; require Net::FTP; }; +if(!$@){ + $mod_ftp = 1; + import Net::FTP; +} +eval { $eval_in_died = 1; require MIME::Lite; }; +if(!$@){ + $mod_mime = 1; + import MIME::Lite; +} +######################################################################################## + +my @trash_files; +my $time_stamp; +my @filearr; +my $sql_file; +my $backupfile; +my $memory_limit=100000; +my $dbh; # DBI databasehandle +my $sth; # DBI statementhandle +my @db_array; +my @dbpraefix_array; +my @db_command_beforedump_array; +my @db_command_afterdump_array; +my $db_anz; +my $record_count; +my $filesize; +my $status_start; +my $status_end; +my $sql_text; +my $punktzaehler; +my @backupfiles_name; +my @backupfiles_size; +my $mysql_commentstring="-- "; + +use vars qw( +$pcd_version $dbhost $dbname $dbuser $dbpass +$cron_save_all_dbs $cron_db_array $cron_dbpraefix_array $dbpraefix $command_beforedump_array $command_afterdump_array +$compression $backup_path $logdatei $completelogdatei $nl $command_beforedump $command_afterdump +$cron_printout $cronmail $cronmail_dump $cronmailto $cronmailfrom +$cronftp $ftp_server $ftp_port $ftp_user $ftp_pass $ftp_dir $mp $multipart_groesse $email_maxsize +$auto_delete $cron_del_files_after_days $max_backup_files $max_backup_files_each $perlspeed $optimize_tables_beforedump $result +@key_value $pair $key $value $conffile @confname $logcompression $log_maxsize $complete_log +$backup_complete_inserts $backup_extended_inserts $backup_delayed_inserts $backup_ignore_inserts $backup_lock_tables +$starttime $Sekunden $Minuten $Stunden $Monatstag $Monat $Jahr $Wochentag $Jahrestag $Sommerzeit +$ri $rct $tabelle @tables @tablerecords $dt $sql_create @ergebnis @ar $sql_daten $inhalt +$insert $totalrecords $error_message $cfh $oldbar $print_out $msg $dt $ftp $dateistamm $dateiendung +$mpdatei $i $BodyNormal $BodyMultipart $BodyToBig $BodyNoAttach $BodyAttachOnly $Body $DoAttach $cmt $part $fpath $fname +$fmtime $timenow $daydiff $datei $inh $gz $search $fdbname @str @dbarray $item %dbanz $anz %db_dat +$delayed $ignore $complete $fieldlist $first_insert $my_comment +); + + + +# Script Start +die "absolute_path_of_configdir is empty !\nYou have to edit the crondump.pl and enter the absolute_path_of_configdir !\n\n" if($absolute_path_of_configdir eq ""); + + +opendir(DIR, $absolute_path_of_configdir) or die "The config-directory you entered is wrong !\n($absolute_path_of_configdir - $!) \n\nPlease edit the crondump.pl and enter the right configuration-path.\n\n"; +closedir(DIR); + +my $abc=length($absolute_path_of_configdir)-1; +my $defed=substr($absolute_path_of_configdir,$abc,1); +if($defed ne "/") { + $absolute_path_of_configdir=$absolute_path_of_configdir."/"; +} + + +#include config file +if($ENV{QUERY_STRING}) { + @key_value = split(/&/,$ENV{QUERY_STRING}); + foreach $pair(@key_value){ + $pair =~ tr/+/ /; + ($key,$value) = split(/=/,$pair); + $conffile=$value if($key eq "config"); + } +} +foreach (@ARGV) { + if($_) { + $conffile=substr($_,7,length($_)-7) if(substr($_,0,7) eq "config="); + } +} + +if(!$conffile) { $conffile=$default_configfile; } +require("$absolute_path_of_configdir$conffile"); +@confname=split(/\//,$conffile); + +# Output Headers +PrintHeader(); + +PrintOut("Config '".$confname[$#confname]."' was loaded.

"); +if($mod_gz==1) { + PrintOut("Compression Library loaded ...
"); +} else { + $compression=0; + PrintOut("Compression Library loading failed - Compression deactivated ...
"); +} +if($mod_ftp==1) { + PrintOut("FTP Library loaded ...
"); +} else { + $cronftp=0; + PrintOut("FTP Library loading failed - FTP deactivated ...
"); +} +if($mod_mime==1) { + PrintOut("Mail Library loaded ...
"); +} else { + $cronmail=0; + PrintOut("Mail Library loading failed - Mail deactivated ...

"); +} + + +# SignalHandler einrichten für Browser-Stop-Button, +# unterbrochene Socketverbindungen, Crtl-C +# Datenbankverbindung wird dann noch ordnungsgemäss geschlossen. +$SIG{HUP} = $SIG{PIPE} = $SIG{INT} =\&closeScript; + + +#teste Zugriff auf logfile +PrintOut("Starting Crondump ... "); +write_log(": starting perl crondump $pcd_version\n"); +PrintOut("ok, logging on
"); + + +#Auto-Delete ausführen +if($auto_delete>0) { + #Autodelete Days + if($cron_del_files_after_days>0) { + PrintOut("
Autodelete: search for backups older than $cron_del_files_after_days days ...
"); + find(\&AutoDeleteDays, $backup_path); + DeleteFiles (\@trash_files); + } + #Autodelete Count + if($max_backup_files>0) { + PrintOut("Autodelete: search for more backups than $max_backup_files ...
"); + find(\&AutoDeleteCount, $backup_path); + DoAutoDeleteCount(); + DeleteFiles (\@trash_files); + } +} + +#Jetzt den Dump anschmeissen +# mal schauen, obs mehrere DB's sind +if($cron_save_all_dbs==0) { + $command_beforedump=$command_beforedump_array; + $command_afterdump=$command_afterdump_array; + ExecuteCommand(1); + DoDump(); + ExecuteCommand(2); + PrintOut("
Crondump finished.
"); + closeScript(); +} else { + @db_array=split(/\|/,$cron_db_array); + @dbpraefix_array=split(/\|/,$cron_dbpraefix_array); + @db_command_beforedump_array=split(/\|/,$command_beforedump_array); + @db_command_afterdump_array=split(/\|/,$command_afterdump_array); + $db_anz=@db_array; + PrintOut("

backup $db_anz Databases ...

"); + for(my $ii = 0; $ii < $db_anz; $ii++) { + $dbname=$db_array[$ii]; + $dbpraefix=($dbpraefix_array[$ii]) ? $dbpraefix_array[$ii] : ""; + $command_beforedump=($db_command_beforedump_array[$ii]) ? $db_command_beforedump_array[$ii] : ""; + $command_afterdump=($db_command_afterdump_array[$ii]) ? $db_command_afterdump_array[$ii] : ""; + PrintOut("
Start backup ".($ii+1)." of $db_anz with database `$dbname` ".(($dbpraefix ne "") ? "(with praefix $dbpraefix)" : "")."
"); + ExecuteCommand(1); + DoDump(); + ExecuteCommand(2); + } + PrintOut("


ALL $db_anz BACKUPS ARE COMPLETE !!!


"); + $cron_save_all_dbs=2; + closeScript(); +} + + +############################################## +# Subroutinen # +############################################## +sub DoDump { + ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, $Jahr, $Wochentag, $Jahrestag, $Sommerzeit) = localtime(time); + $Jahr+=1900;$Monat+=1;$Jahrestag+=1; + my $CTIME_String = localtime(time); + $time_stamp=$Jahr."_".sprintf("%02d",$Monat)."_".sprintf("%02d",$Monatstag)."_".sprintf("%02d",$Stunden)."_".sprintf("%02d",$Minuten); + $starttime= sprintf("%02d",$Monatstag).".".sprintf("%02d",$Monat).".".$Jahr." ".sprintf("%02d",$Stunden).":".sprintf("%02d",$Minuten); + $fieldlist=$delayed=$ignore=""; + # Verbindung mit mSQL herstellen, $dbh ist das Database Handle + PrintOut("connect to database`$dbname`   "); + $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost","$dbuser","$dbpass") || die "Database connection not made: $DBI::errstr"; + # herausfinden welche Mysql-Version verwendet wird + $sth = $dbh->prepare("SELECT VERSION()"); + $sth->execute; + my @mysql_version=$sth->fetchrow; + my @v=split(/\./,$mysql_version[0]); + if($v[0]>=4 && $v[1]>=1 ){ + #mysql Version >= 4.1 + %db_dat = (name => 0, + rows => 4, + data_length =>6, + index_length =>8, + update_time =>11 ); + } else { + #mysql Version < 4.1 + %db_dat = (name => 0, + rows => 3, + data_length =>5 , + index_length =>7, + update_time =>11 ); + } + + PrintOut("ok
MySQL-Version $v[0].$v[1].$v[2]
start Backup ".$starttime."
"); + + my $format=""; + if($backup_complete_inserts==1) { $format.="complete inserts | "; } + if($backup_extended_inserts==1) { $format.="extended inserts | "; } + if($backup_ignore_inserts==1) { $format.="ignored inserts | "; } + if($backup_delayed_inserts==1) { $format.="delayed inserts | "; } + if($backup_lock_tables==1 && $backup_delayed_inserts==0) { $format.="lock tables | ";} + if($format eq "") { + $format="Backup Parameter: normal

"; + } else { + $format="Backup Parameter: ".substr($format,0,length($format)-3)."

"; + } + PrintOut($format); + + #Statuszeile erstellen + my $t=0; + my $r=0; + $sth = $dbh->prepare("SHOW TABLE STATUS FROM `$dbname`"); + $sth->execute; + my $st_e="\n"; + #Arrays löschen + undef(@tables); + undef(@tablerecords); + my $opttbl=0; + + while ( @ar=$sth->fetchrow) { + if($optimize_tables_beforedump==1) { + #tabelle optimieren + my $sth_to = $dbh->prepare("OPTIMIZE Table `$ar[$db_dat{name}]`"); + $sth_to->execute; $opttbl++; + } + if($dbpraefix eq ""){ + $t++; + $r+=$ar[$db_dat{rows}]; + push(@tables,$ar[$db_dat{name}]); + push(@tablerecords,$ar[$db_dat{rows}]); + $st_e.=$mysql_commentstring."TABLE\|$ar[$db_dat{name}]\|$ar[$db_dat{rows}]\|".($ar[$db_dat{data_length}]+$ar[$db_dat{index_length}])."\|$ar[$db_dat{update_time}]\n"; + } else { + if (substr($ar[$db_dat{name}],0,length($dbpraefix)) eq $dbpraefix) { + $t++; + $r+=$ar[$db_dat{rows}]; + push(@tables,$ar[$db_dat{name}]); + push(@tablerecords,$ar[$db_dat{rows}]); + $st_e.=$mysql_commentstring."TABLE\|$ar[$db_dat{name}]\|$ar[$db_dat{rows}]\|".($ar[$db_dat{data_length}]+$ar[$db_dat{index_length}])."\|$ar[$db_dat{update_time}]\n"; + } + } + } + PrintOut("$opttbl tables were optimized
") if($opttbl>0) ; + PrintOut("found $t tables with $r records.


"); + + #AUFBAU der Statuszeile: + # -- Status:tabellenzahl:datensätze:Multipart:Datenbankname:script:scriptversion:Kommentar:MySQLVersion:Backupflags:SQLBefore:SQLAfter:EXTINFO + # Aufbau Backupflags (1 Zeichen pro Flag, 0 oder 1, 2=unbekannt) + # (complete inserts)(extended inserts)(ignore inserts)(delayed inserts)(downgrade)(lock tables)(optimize tables) + # + $status_start=$mysql_commentstring."Status:$t:$r:"; + my $downgrade=0; + my $flags="$backup_complete_inserts$backup_extended_inserts$backup_ignore_inserts$backup_delayed_inserts$downgrade$backup_lock_tables$optimize_tables_beforedump"; + $status_end=":$dbname:perl:$pcd_version:$my_comment:$mysql_version[0]:$flags"; + $status_end.=":$command_beforedump:$command_afterdump:EXTINFO$st_e\n".$mysql_commentstring."Dump created on $CTIME_String by PERL Cron-Script\n".$mysql_commentstring."Dump by MySQLDumper (http://www.mysqldumper.de/board/)\n\n"; + + + if($mp>0) { + $sql_text=$status_start."MP_$mp".$status_end; + } else { + $sql_text=$status_start.$status_end; + } + NewFilename(); + + $totalrecords=0; + for (my $tt=0;$tt<$t;$tt++) { + $tabelle=$tables[$tt]; + # definition auslesen + if($dbpraefix eq "" or ($dbpraefix ne "" && substr($tabelle,0,length($dbpraefix)) eq $dbpraefix)) { + PrintOut("dumping table `$tabelle` "); + $a="\n\n$mysql_commentstring\n$mysql_commentstring Create Table `$tabelle`\n$mysql_commentstring\n\nDROP TABLE IF EXISTS `$tabelle`;\n\n"; + $sql_text.=$a; + $sql_create="Show create table `$tabelle`"; + $sth = $dbh->prepare($sql_create); + $sth->execute; + @ergebnis=$sth->fetchrow; + $sth->finish; + $a=$ergebnis[1].";\n"; + $sql_text.=$a."\n$mysql_commentstring\n$mysql_commentstring Data for Table `$tabelle`\n$mysql_commentstring\n\n"; + if($backup_delayed_inserts==0) { + $sql_text.="\n/*!40000 ALTER TABLE `$tabelle` DISABLE KEYS */;\n"; + } + if($backup_lock_tables==1 && $backup_delayed_inserts==0) { + $sql_text.="LOCK TABLES `$tabelle` WRITE;\n\n"; + } + WriteToFile($sql_text); + $sql_text=""; + PrintOut("* "); + $punktzaehler=64; + if($backup_complete_inserts==1) { + $fieldlist="("; + $sql_create="Show fields from `$tabelle`"; + $sth = $dbh->prepare($sql_create); + $sth->execute; + while ( @ar=$sth->fetchrow) { + $fieldlist.="`".$ar[0]."`,"; + } + $fieldlist=substr($fieldlist,0,length($fieldlist)-1).")"; + } + # daten auslesen + $rct=$tablerecords[$tt]; + for (my $ttt=0;$ttt<$rct;$ttt+=$perlspeed) { + $delayed="DELAYED " if($backup_delayed_inserts==1); + $ignore="IGNORE " if($backup_ignore_inserts==1); + $insert = "INSERT ".$delayed.$ignore."INTO `$tabelle` $fieldlist VALUES ("; + $first_insert=0; + $sql_daten="SELECT * FROM `$tabelle` Limit ".$ttt.",".$perlspeed.";"; + $sth = $dbh->prepare($sql_daten); + $sth->execute; + while ( @ar=$sth->fetchrow) { + #Start the insert + if($first_insert==0) { + $a="\n$insert"; + if($backup_extended_inserts==1) {$first_insert=1;} + } else { + $a="\n("; + } + foreach $inhalt(@ar){ $a.= $dbh->quote($inhalt).", "; } + $a=substr($a,0, length($a)-2).")"; + if($backup_extended_inserts==1) { + $a.=","; + } else { + $a.=";"; + } + $sql_text.= $a; + if($memory_limit>0 && length($sql_text)>$memory_limit) { + if($backup_extended_inserts==1 && length($a)>0) { + $sql_text=substr($sql_text,0, length($sql_text)-1).";" if(length($sql_text)>0); + $first_insert=0; + } + WriteToFile($sql_text); + $sql_text=""; + if($mp>0 && $filesize>$multipart_groesse) {NewFilename();} + } + } + } + #jetzt wegschreiben + if($backup_extended_inserts==1) { + $sql_text=substr($sql_text,0, length($sql_text)-1).";" if(length($sql_text)>0);; + } + if($backup_lock_tables==1 && $backup_delayed_inserts==0) { + $sql_text.="\n\nUNLOCK TABLES;"; + } + if($backup_delayed_inserts==0) { + $sql_text.="\n/*!40000 ALTER TABLE `$tabelle` ENABLE KEYS */;\n"; + } + WriteToFile($sql_text); + $sql_text=""; + PrintOut("
   $tablerecords[$tt] inserted records (backupfile now $filesize Bytes)
"); + $totalrecords+=$tablerecords[$tt]; + if($mp>0 && $filesize>$multipart_groesse) {NewFilename();} + } + } + # Ende + WriteToFile("\n".$mysql_commentstring."EOB"); + PrintOut("
Backup of Database `$dbname` complete.
"); + write_log(": Perl Cron-Dump `$backupfile` finished.\n"); + + # Jetzt der Versand per Mail + if($cronmail==1) { + PrintOut("sending mail ...
"); + send_mail(); + write_log(": Mail was sent to $cronmailto.\n"); + PrintOut("Mail was sent to $cronmailto.
"); + } + + # Jetzt der Versand per FTP + if($cronftp==1) { + PrintOut("sending ftp ...
"); + send_ftp($sql_file); + } +} + +#Wird aufgerufen, wenn Fehler passieren +sub err_trap { + $error_message = shift(@_); + print "Perl Cronscript ERROR: $error_message \n"; + close; +} + +sub PrintHeader { + print "Content-type: text/html\n\n"; + PrintOut("\n"); + PrintOut("MySQLDumper - Perl CronDump [Version $pcd_version]

MySQLDumper - Perl CronDump [Version $pcd_version]

\n"); +} + +sub PrintOut { + $print_out = shift(@_); + if($cron_printout==1) { + local ($oldbar) = $|; + $cfh = select (STDOUT); + $| = 1; + print $print_out."\n"; + $| = $oldbar; + select ($cfh); + } + + if($complete_log==1) { + my $logsize=0; + if (-e $completelogdatei) { + $logsize=(stat($completelogdatei))[7]; + unlink($completelogdatei) if($logsize + length($print_out)>$log_maxsize && $log_maxsize>0); + } + if($logcompression==0) { + open(DATEI,">>$completelogdatei") || err_trap('can\'t open mysqldump_perl.complete.log ('.$completelogdatei.').'); + print DATEI $print_out."\n" || err_trap('can\'t write to mysqldump_perl.complete.log ('.$completelogdatei.').'); + close(DATEI)|| err_trap('can\'t close mysqldump_perl.complete.log ('.$completelogdatei.').'); + } else { + $gz = gzopen($completelogdatei, "ab") || err_trap("Cannot open mysqldump_perl.complete.log: ".$gz->gzerror()); + $gz->gzwrite("$print_out\n") || err_trap("Error writing mysqldump_perl.complete.log: ".$gz->gzerror()); + $gz->gzclose ; + } + } +} + +sub write_log { + $msg = shift(@_); + ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, $Jahr, $Wochentag, $Jahrestag, $Sommerzeit) = localtime(time); + $Jahr+=1900; $Monat+=1;$Jahrestag+=1; + $dt=sprintf("%02d",$Monatstag).".".sprintf("%02d",$Monat).".".sprintf("%02d",$Jahr)." ".sprintf("%02d",$Stunden).":".sprintf("%02d",$Minuten).":".sprintf("%02d",$Sekunden); + + my $logsize=0; + if (-e $logdatei) { + $logsize=(stat($logdatei))[7]; + unlink($logdatei) if($logsize+200>$log_maxsize && $log_maxsize>0); + } + + if($logcompression==0){ + open(DATEI,">>$logdatei") || err_trap("can't open file ($logdatei)."); + print DATEI "$dt $msg" || err_trap("can't write to file ($logdatei)."); + close(DATEI)|| err_trap("can't close file ($logdatei)."); + } else { + $gz = gzopen($logdatei, "ab") || err_trap("Cannot open : ".$gz->gzerror()); + $gz->gzwrite("$dt $msg") || err_trap("Error writing: ".$gz->gzerror()); + $gz->gzclose ; + } +} + +sub send_ftp { + $ftp = Net::FTP->new($ftp_server, Port => $ftp_port, Timeout => 360, Debug => 1) or err_trap( "FTP-ERROR: Can't connect: $@\n"); + $ftp->login($ftp_user, $ftp_pass) or err_trap("FTP-ERROR: Couldn't login\n"); + $ftp->binary(); + $ftp->cwd($ftp_dir) or err_trap("FTP-ERROR: Couldn't change directory\n"); + if($mp==0) { + $ftp->put($sql_file) or err_trap("FTP-ERROR: Couldn't put $sql_file\n"); + write_log(": FTP-Transfer `$backupfile` to $ftp_server completed.\n"); + PrintOut("FTP-Transfer `$backupfile` to $ftp_server completed.
"); + } else { + $dateistamm=substr($backupfile,0,index($backupfile,"part_"))."part_"; + $dateiendung=($compression==1)?".sql.gz":".sql"; + $mpdatei=""; + for ($i=1;$i<$mp;$i++) { + $mpdatei=$dateistamm.$i.$dateiendung; + $ftp->put($backup_path.$mpdatei) or err_trap("Couldn't put $backup_path.$mpdatei\n"); + write_log(": FTP-Transfer `$mpdatei` to $mpdatei completed.\n"); + PrintOut("FTP-Transfer `$mpdatei` to $ftp_server completed.
"); + } + } +} + +sub send_mail { + MIME::Lite->send("sendmail", "/usr/lib/sendmail -t -oi -oem"); + $BodyNormal='In der Anlage findest Du die Sicherung Deiner MySQL-Datenbank.
Sicherung der Datenbank '.$dbname.'

Viele Grüsse

MySQLDumper
www.mysqldumper.de'; + $BodyMultipart='Es wurde eine Multipart-Sicherung erstellt. Die Sicherungen werden nicht als Anhang mitgeliefert!
Sicherung der Datenbank `'.$dbname.'`

Folgene Dateien wurden erzeugt:

'; + $BodyToBig='Die Sicherung überschreitet die Maximalgrösse von '.$email_maxsize.' Bytes und wurde daher nicht angehängt.
Sicherung der Datenbank '.$dbname.'

Viele Grüsse

MySQLDumper
www.mysqldumper.de

Folgene Datei wurde erzeugt:

'; + $BodyNoAttach='Das Backup wurde nicht angehängt.
Sicherung der Datenbank `'.$dbname.'`
'; + $BodyAttachOnly='... nur der Anhang

Viele Grüsse

MySQLDumper
www.mysqldumper.de'; + $Body=""; + $DoAttach=1; + my @mparray; + if($mp==0) { + if(($email_maxsize>0 && $filesize>$email_maxsize) || $cronmail_dump==0) { + if($cronmail_dump==0) { + $Body=$BodyNoAttach.$backupfile."   ".$filesize; + } else { + $Body=$BodyToBig.$backupfile."   ".$filesize; + } + $DoAttach=0; + } else { + $Body=$BodyNormal; + } + } else { + $Body=$BodyMultipart; + $dateistamm=substr($backupfile,0,index($backupfile,"part_"))."part_"; + $dateiendung=($compression==1)?".sql.gz":".sql"; + $mpdatei=""; + for ($i=1;$i<$mp;$i++) { + $mpdatei=$dateistamm.$i.$dateiendung; + push(@mparray,"$mpdatei|$i"); + $Body.="$mpdatei (".(stat($backup_path.$mpdatei))[7]." Bytes)
"; + } + $Body.='


Viele Grüsse

MySQLDumper
www.mysqldumper.de'; + } + + $msg = new MIME::Lite ; + $msg = build MIME::Lite + From => $cronmailfrom , + To => $cronmailto , + Subject => "MySQLDumper Perl Crondump" , + Type => 'text/html', + Data => $Body; + if($DoAttach==1 && $mp==0) { + attach $msg + Type => "application/gzip" , + Path => "$sql_file" , + Encoding => "base64", + Filename => "$backupfile" ; + } + + $msg->send || err_trap("Error sending mail !"); + + if($DoAttach==1 && $mp>0) { + foreach $datei(@mparray) { + @str=split(/\|/,$datei); + $msg = new MIME::Lite ; + $msg = build MIME::Lite + From => $cronmailfrom , + To => $cronmailto , + Subject => "MySQLDumper Perl Crondump - Attach ".$str[1]." of ".@mparray , + Type => 'text/html', + Data => $BodyAttachOnly; + attach $msg + Type => "application/gzip" , + Path => $backup_path.$str[0] , + Encoding => "base64", + Filename => $str[0] ; + $msg->send || err_trap("Error sending mail !"); + } + } +} + + +sub check_emailadr { + $cmt = shift(@_); + if ($cmt =~ /^([\w\-\+\.]+)@([\w\-\+\.]+)$/){ + return (1) + } else { + return (0) + } +} + +sub NewFilename { + $part=""; + if($mp>0) { + $part="_part_$mp"; + $mp++; + } + if($compression==0) { + $sql_file=$backup_path.$dbname."_".$time_stamp."_crondump_perl".$part.".sql"; + $backupfile=$dbname."_".$time_stamp."_crondump_perl".$part.".sql"; + } else { + $sql_file=$backup_path.$dbname."_".$time_stamp."_crondump_perl".$part.".sql.gz"; + $backupfile=$dbname."_".$time_stamp."_crondump_perl".$part.".sql.gz"; + } + if($mp==0) { + PrintOut("
Start Perl Cron-Dump with file `$backupfile`
"); + write_log(": Start Perl Cron-Dump with file `$backupfile` \n"); + } + if($mp==2) { + PrintOut("
Start Perl Multipart-Cron-Dump with file `$backupfile`
"); + write_log(": Start Perl Multipart-Cron-Dump with file `$backupfile` \n"); + } + if($mp>2) { + PrintOut("
Continue Perl Multipart-Cron-Dump with file `$backupfile`
"); + write_log(": Continue Perl Multipart-Cron-Dump with file `$backupfile` \n"); + } + if($mp>0) { + $sql_text=$status_start."MP_".($mp-1).$status_end; + } else { + $sql_text=$status_start.$status_end; + } + WriteToFile($sql_text); + $sql_text=""; + $first_insert=0; + $punktzaehler=0; + push(@backupfiles_name,$sql_file); +} + +sub WriteToFile { + $inh=shift; + if(length($inh)>0) { + if($compression==0){ + open(DATEI,">>$sql_file"); + print DATEI $inh; + close(DATEI); + } else { + $gz = gzopen($sql_file, "ab") || err_trap("Cannot open : ".$gz->gzerror()); + $gz->gzwrite($inh) || err_trap("Error writing: ".$gz->gzerror()); ; + $gz->gzclose ; + } + PrintOut("."); + $filesize= (stat($sql_file))[7]; + $punktzaehler++; + if($punktzaehler>180){ + $punktzaehler=0; + PrintOut("
"); + } + } +} + +sub AutoDeleteDays { + $fpath=$File::Find::name; + $fname=basename($fpath); + $fmtime=(stat($fname))[9]; + if($fmtime) { + $timenow=time; + $daydiff=($timenow-$fmtime)/60/60/24; + if (((/\.gz$/) || (/\.sql$/)) && ($daydiff>$cron_del_files_after_days)) { + PrintOut "$fpath $daydiff
" if (-f $fname); + push(@trash_files,$fpath); + } + } +} + +sub AutoDeleteCount { + $fpath=$File::Find::name; + $fname=basename($fpath); + $fmtime=(stat($fname))[9]; + if($fmtime) { + ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, $Jahr)=localtime($fmtime); + $Jahr+=1900; $Monat+=1; + $Monat="0".$Monat if(length($Monat)==1); + $search="_".$Jahr."_".$Monat."_"; + $fdbname=substr($fname,0,index($fname,$search)); + if ((/\.gz$/) || (/\.sql$/)) { + push(@filearr,"$fmtime|$fdbname|$fpath"); + } + } +} + +sub DoAutoDeleteCount { + my @str; + my @dbarray; + my $item; + my %dbanz; + my $anz=@filearr; + @filearr=sort(@filearr); + if($max_backup_files_each==0) { + PrintOut("Autodelete by Count ($max_backup_files) => found $anz Backups
"); + for($i = 0; $i < ($anz-$max_backup_files); $i++) { + @str=split(/\|/,$filearr[$i]); + push(@trash_files, $str[2]); + } + } else { + PrintOut("Autodelete by Count each DB ($max_backup_files) => found $anz Backups
"); + foreach $item (@filearr) { + @str=split(/\|/,$item); + $dbanz{$str[1]}++; + push(@trash_files, $str[2]) if($dbanz{$str[1]}>$max_backup_files); + } + } +} + +sub DeleteFiles { + if(@trash_files==0) { + PrintOut("no file to delete.
"); + } else { + foreach $datei(@trash_files) { + PrintOut("".$datei." deleted.
"); + write_log( ": Perl Cronsript Autodelete - $datei deleted.\n" ) ; + } + } + unlink @trash_files ; + undef(@trash_files); +} + +sub ExecuteCommand { + my $cmt = shift(@_); + my (@cad, $errText, $succText, $cd2, $commandDump); + + if($cmt==1) { #before dump + $commandDump=$command_beforedump; + $errText="Error while executing Query before Dump"; + $succText="executing Query before Dump was successful"; + write_log(": Executing Command before dump\n"); + } else { + $commandDump=$command_afterdump; + $errText="Error while executing Query after Dump"; + $succText="executing Query after Dump was successful"; + write_log(": Executing Command after dump\n"); + } + if(length($commandDump)>0) { + #jetzt ausführen + if(substr($commandDump,0,7) ne "system:") { + $dbh = DBI->connect("DBI:mysql:$dbname:$dbhost","$dbuser","$dbpass")|| die "Database connection not made: $DBI::errstr"; + $dbh->{PrintError} = 0; + if(index($commandDump,";")>=0) { + @cad=split(/;/,$commandDump); + for($i=0;$i<@cad;$i++) { + if($cad[$i] ne ""){ + write_log(": Executing Command ($cad[$i]\n"); + $sth = $dbh->prepare($cad[$i]); + $sth->execute; + $sth->finish; + } + } + } else { + write_log(": Executing Command ($commandDump)\n"); + if($commandDump) { + $sth = $dbh->prepare($commandDump); + $sth->execute; + $sth->finish; + } + } + if($@){ + my $ger=$@; + PrintOut("

$errText ($commandDump):
$ger

"); + write_log(": $errText ($commandDump): $ger\n"); + } else { + PrintOut("

$succText

"); + write_log(": $succText\n"); + } + } else { + #Systembefehl + $commandDump=substr($commandDump,7); + system($commandDump); + PrintOut("

$succText ($commandDump)

"); + write_log(": $succText ($commandDump)\n"); + } + } +} + +sub closeScript { + my ($Start, $Jetzt, $Totalzeit); + $Start = $^T; $Jetzt = (time); + $Totalzeit=$Jetzt - $Start; + ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat, $Jahr, $Wochentag, $Jahrestag, $Sommerzeit) = localtime(time); + $Jahr+=1900;$Monat+=1;$Jahrestag+=1; + $starttime= sprintf("%02d",$Monatstag).".".sprintf("%02d",$Monat).".".$Jahr." ".sprintf("%02d",$Stunden).":".sprintf("%02d",$Minuten); + if($cron_save_all_dbs!=1) { + PrintOut("closing script $starttime, bye
total time used: $Totalzeit sec.
#EOS
\n"); + # Datenbankverbindung schliessen + $sth->finish() if (defined $sth); + ($dbh->disconnect() || warn $dbh->errstr) if (defined $dbh); + } +} diff --git a/mysqldumper/msd_cron/perltest.pl b/mysqldumper/msd_cron/perltest.pl new file mode 100644 index 0000000..58e0d95 --- /dev/null +++ b/mysqldumper/msd_cron/perltest.pl @@ -0,0 +1,98 @@ +#!/usr/bin/perl -w +use strict; +use Socket; +use Config; +use CGI::Carp qw(warningsToBrowser fatalsToBrowser); +use CGI; +my $cgi = CGI->new(); +print $cgi->header(); +warningsToBrowser(1); # dies ist ganz wichtig! + +my $eval_in_died; +my $mod_dbi=0; +my $mod_ff=0; +my $mod_fb=0; +my $mod_gz=0; +my $mod_ftp=0; +my $mod_mime=0; + + +print "

Perl-Test für MySQLDumper

\n"; +print "
Unbedingt notwendige Funktionen für das Cronscript
"; +print "

teste DBI ...

\n"; +eval { $eval_in_died = 1; require DBI; }; + if(!$@){ + $mod_dbi = 1; + import DBI; + } +if($mod_dbi!=1){ + print "DBI ist nicht vorhanden !
\n"; +} else { + print "DBI ist installiert.
\n"; +} + +print "

teste File::Find ...

\n"; +eval { $eval_in_died = 1; require File::Find; }; + if(!$@){ + $mod_ff = 1; + import File::Find; + } +if($mod_ff!=1){ + print "File::Find ist nicht vorhanden !
\n"; +} else { + print "File::Find ist installiert.
\n"; +} + + +print "

teste File::Basename ...

\n"; +eval { $eval_in_died = 1; require File::Basename; }; + if(!$@){ + $mod_fb = 1; + import File::Basename; + } +if($mod_fb!=1){ + print "File::Basename ist nicht vorhanden !
\n"; +} else { + print "File::Basename ist installiert.
\n"; +} + +print "
Konfigurierbare Funktionen für das Cronscript
"; + +print "

teste Compress::Zlib ...

\n"; +eval { $eval_in_died = 1; require Compress::Zlib; }; + if(!$@){ + $mod_gz = 1; + import Compress::Zlib; + } +if($mod_gz!=1){ + print "Compress::Zlib ist nicht vorhanden !
\n"; +} else { + print "Compress::Zlib ist installiert.
\n"; +} + +print "

teste Net::FTP ...

\n"; +eval { $eval_in_died = 1; require Net::FTP; }; + if(!$@){ + $mod_ftp = 1; + import Net::FTP; + } +if($mod_ftp!=1){ + print "Net::FTP ist nicht vorhanden !
\n"; +} else { + print "Net::FTP ist installiert.
\n"; +} + +print "

teste MIME::Lite ...

\n"; +eval { $eval_in_died = 1; require MIME::Lite; }; + if(!$@){ + $mod_mime = 1; + import MIME::Lite; + } +if($mod_mime!=1){ + print "MIME::Lite ist nicht vorhanden !
\n"; +} else { + print "MIME::Lite ist installiert.
\n"; +} + + +print "\n"; diff --git a/mysqldumper/msd_cron/simpletest.pl b/mysqldumper/msd_cron/simpletest.pl new file mode 100644 index 0000000..af69b72 --- /dev/null +++ b/mysqldumper/msd_cron/simpletest.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl -w + + +use strict; +use CGI::Carp qw(fatalsToBrowser warningsToBrowser); + + +print "Content-type: text/html\n\n"; +print '', "\n"; +print "Testausgabe\n"; +print "\n"; + +print "Wenn Du das siehst, funktioniert Perl auf Deinem System !

"; +print "If you see this perl works fine on your system !"; +print "\n"; diff --git a/mysqldumper/restore.php b/mysqldumper/restore.php new file mode 100644 index 0000000..eb1009d --- /dev/null +++ b/mysqldumper/restore.php @@ -0,0 +1,308 @@ +0) WriteLog('Start Multipart-Restore \''.$restore['filename'].'\''); + else WriteLog('Start Restore \''.$restore['filename'].'\''); + } + else + { + if ($restore['compressed']==0) $filegroesse=filesize($fpath.$restore['filename']); + // Dateizeiger an die richtige Stelle setzen + ($restore['compressed']) ? gzseek($restore['filehandle'],$restore['offset']) : fseek($restore['filehandle'],$restore['offset']); + + // Jetzt basteln wir uns mal unsere Befehle zusammen... + $a=0; + $dauer=0; + $restore['EOB']=false; + //lock_table($restore['actual_table']); + WHILE ( ($a<$restore['anzahl_zeilen'] ) + && (!$restore['fileEOF']) && ($dauer<$restore['max_zeit']) && !$restore['EOB'] ) + { + $sql_command=get_sqlbefehl(); + + if($sql_command>'') + { +//WriteLog($sql_command); + $meldung=''; + $res=mysql_query($sql_command,$config['dbconnection']); + + if (!$res===false) + { + $anzsql=mysql_affected_rows($config['dbconnection']); + + // Anzahl der eingetragenen Datensaetze ermitteln (Indexaktionen nicht zaehlen) + $command=strtoupper(substr($sql_command,0,7)); + if ($command=='INSERT ') + { + $anzsql=mysql_affected_rows($config['dbconnection']); + if($anzsql>0) + { + $restore['eintraege_ready']+=$anzsql; + } + } + } + + // Bei MySQL-Fehlern sofort abbrechen und Info ausgeben + $meldung=mysql_error($config['dbconnection']); + if ($meldung!='') + { + if (strtolower(substr($meldung,0,15))=='duplicate entry') + { + ErrorLog('RESTORE',$databases['db_actual'],$sql_command,$meldung,1); + $restore['notices']++; + } + else + { + if($config['stop_with_error']==0) + { + Errorlog("RESTORE",$databases['db_actual'],$sql_command,$meldung); + $restore['errors']++; + } + else + { + Errorlog("RESTORE",$databases['db_actual'],$sql_command,'Restore failed: '.$meldung,0); + SQLError($sql_command,$meldung); + die(); + } + } + } + } + $a++; + $dauer=time()-$restore['startzeit']; + } + $eingetragen=$a-1; + } + + $restore['offset']= ($restore['compressed']) ? gztell($restore['filehandle']) : ftell($restore['filehandle']); + if ($restore['compressed']) gzclose($restore['filehandle']); else fclose($restore['filehandle']); + + $aus_header[]= PicCache($relativ_path); + $aus_header[]= headline($lang['restore']); + $aus_header[]='Browser : '; + + $restore['aufruf']++; + if (!$restore['compressed']) $prozent=($filegroesse>0) ? ($restore['offset']*100)/$filegroesse : 0; + else + { + if ($restore['anzahl_eintraege']>0) $prozent=$restore['eintraege_ready']*100/$restore['anzahl_eintraege']; + else $prozent=0; + } + if ($prozent>100) $prozent=100; + + if($aus1!='') $aus[]= '
'.$aus1.'

'; + $aus[]= '

'.sprintf($lang['restore_db'],$databases['db_actual'],$config['dbhost']).'
'; + $aus[]='Backup-File: '.$restore['filename'].'
'; + if($fmp>0) $aus[]= '
Multipart File '.$restore['part'].'
'; + + $tabellen_fertig=($restore['table_ready']>0) ? $restore['table_ready']:'0'; + $to_do= ($restore['anzahl_tabellen']>0) ? $restore['anzahl_tabellen']:$lang['unknown']; + if($restore['anzahl_tabellen']>0) + $aus[]=sprintf($lang['restore_tables_completed'],$tabellen_fertig,$to_do); + else + $aus[]=sprintf($lang['restore_tables_completed0'],$tabellen_fertig); + + $done=number_format($restore['eintraege_ready'],0,',','.'); + $to_do=number_format($restore['anzahl_eintraege'],0,',','.'); + if ($restore['anzahl_eintraege']>0) + $aus[]=sprintf($lang['restore_run1'],$done,$to_do); + else + $aus[]=sprintf($lang['restore_run0'],$done); + $aus[]=sprintf($lang['restore_run2'],$restore['actual_table']); + $aus[]=$lang['progress_over_all'].'
'; + + //Fortschrittsbalken + $prozentbalken=(round($prozent,0)*3); + if ($restore['anzahl_eintraege']>0) + { + $aus[]= ''; + if ($prozentbalken>=3) $aus[]= ''; + $aus[]= '' + .'
+  '.(number_format($prozent,2,",",".")).' %
'; + } + else $aus[]= ' '.$lang['unknown_number_of_records'].'

'; + + //Speed-Anzeige + $fw=($config['maxspeed']==$config['minspeed']) ? 300 : round(($restore['anzahl_zeilen']-$config['minspeed'])/($config['maxspeed']-$config['minspeed'])*300,0); + $aus[]='
'; + $aus[]='
'; + $aus[]='Speed
'.$restore['anzahl_zeilen'].'
'; + $aus[]=''; + $aus[]='
'; + $aus[]=''; + $aus[]='
'; + $aus[]=''; + $aus[]=''; + $aus[]='
'.$config['minspeed'].''.$config['maxspeed'].'
'; + + //Status-Text + $aus[]= '

'.zeit_format(time()-$restore['xtime']).', '.$restore['aufruf'].' pages'; //, speed '.$anzahl_zeilen; + $aus[]= ($fmp>0) ? ', file '.$restore['part'] : ''; + $aus[]= ($restore['errors']>0) ? ', '.$restore['errors'].' errors' : ''; + $aus[]= ($restore['notices']>0) ? ', '.$restore['notices'].' notices' : ''; + $aus[]= '

'; + $restore['summe_eintraege']+=$eingetragen; + + //Zeitanpassung + if($config['direct_connection']==1) + { + if ($dauer<$restore['max_zeit']) + { + $restore['anzahl_zeilen']=$restore['anzahl_zeilen']*$config['tuning_add']; + } + else + { + $restore['anzahl_zeilen']=$restore['anzahl_zeilen']*$config['tuning_sub']; + } + $restore['anzahl_zeilen']=round($restore['anzahl_zeilen'],0); + if($config['minspeed']>0) {if ($restore['anzahl_zeilen']<$config['minspeed']) $restore['anzahl_zeilen']=$config['minspeed'];} + if($config['maxspeed']>0) {if($restore['anzahl_zeilen']>$config['maxspeed']) $restore['anzahl_zeilen']=$config['maxspeed'];} + } + + if ($restore['fileEOF'] && $restore['part']==0) $restore['EOB']=true; + + if ($restore['EOB']) + { + // Uff, geschafft! Jetzt darf die Leitung wieder abkuehlen. :-) + unset($aus); + $aus=array(); + + $restore['xtime']=time()-$restore['xtime']; + WriteLog("Restore '".$restore['filename']."' finished in ".zeit_format($restore['xtime'])."."); + $aus[]=$lang['restore_total_complete']."
"; + $aus[]=$lang['file'].': '.$restore['filename'].'

'; + $aus[]= sprintf($lang['restore_complete'],$restore['table_ready']).'
'; + $aus[]= sprintf($lang['restore_complete2'],number_format($restore['eintraege_ready'],0,",",".")); + $aus[]= '

'.zeit_format($restore['xtime']).", ".$restore['aufruf']." pages

"; + if($restore['errors']>0) $aus[]=$lang['errors'].': '.$restore['errors'].' » '.$lang['view'].'
'; + if($restore['notices']>0) $aus[]=$lang['notices'].': '.$restore['notices'].' » '.$lang['view'].'
'; + $aus[]= "
   "; + $aus[]= "   "; + $RestoreFertig=1; + } + else + { + if ($restore['fileEOF']) + { + //Multipart-Restore + $nextfile=NextPart($restore['filename']); + + if(!file_exists($config['paths']['backup'].$nextfile)) + { + $done=number_format($restore['eintraege_ready'],0,",","."); + $to_do=number_format($restore['anzahl_eintraege'],0,",","."); + $aus[]= '

'.$lang['restore'].'

'; + $aus[]= sprintf($lang['restore_db'],$databases['db_actual'],$config['dbhost']); + $aus[]= '

'.$lang['multi_part'].': '.$lang['file_missing'].' \''.$nextfile.'\' !

'; + $aus[]=sprintf($lang['restore_run1'],$done,$to_do); + $aus[]=sprintf($lang['restore_run2'],$restore['actual_table']); + $aus[]= '

'.zeit_format(time()-$restore['xtime']).', '.$restore['aufruf'].' pages'; //, speed '.$anzahl_zeilen; + $aus[]= ($fmp>0) ? ', '.$lang['file'].' '.$restore['part'] : ''; + $aus[]= ($restore['errors']>0) ? ', '.$restore['errors'].' errors' : ''; + $aus[]= '

'.((isset($restore['EOB'])) ? "EOB":""); + WriteLog('Restore unsuccessful: Cannot find Multipartfile \''.$nextfile.'\''); + $RestoreFertig=1; + } + else + { + $restore['filename']=urlencode($nextfile); + $restore['offset']=0; + $restore['part']++; + } + } + } +} +else $aus[]=$fpath.$restore['filename'].' : '.$lang['file_open_error']; + +//===================================================================== +//================= Anzeige =========================================== +//===================================================================== + +//Seite basteln +//DEBUGGER +$debugausgabe=''; +$manuell=0; + +$pagefooter=($RestoreFertig==1) ? MSDFooter() : '
'; +if (is_array($aus_header)) $aus=array_merge($aus_header,$aus); + +$page_parameter=get_page_parameter($restore,'restore'); +if ($RestoreFertig==1) $page_parameter=''; + +$pageheader=''.$meta.'MySqlDumper'.$page_parameter; +$js_aufruf_automatisch=''; +$js_aufruf_manuell=''; +$selbstaufruf=($page_parameter=="") ? "" : (($manuell==0) ? $js_aufruf_automatisch : $js_aufruf_manuell); +$complete_page=$pageheader.(($aus!='') ? implode("\n",$aus) : '').$debugausgabe.$selbstaufruf.$pagefooter; +echo $complete_page; + +?> \ No newline at end of file diff --git a/mysqldumper/sql.php b/mysqldumper/sql.php new file mode 100644 index 0000000..31f614a --- /dev/null +++ b/mysqldumper/sql.php @@ -0,0 +1,1282 @@ + +var auswahl = "document.getElementsByName(\"f_export_tables[]\")[0]"; +var msg1="'.$lang['sql_notablesselected'].'"; +'; +} + +//Variabeln + +$tdcompact=(isset($_GET['tdc'])) ? $_GET['tdc'] : $config['interface_table_compact']; + +$mysql_help_ref='http://dev.mysql.com/doc/mysql/'.$config['language'].'/index.html'; +$mysql_errorhelp_ref='http://dev.mysql.com/doc/mysql/'.$config['language'].'/error-handling.html'; + +$no_order=false; +$db=(!isset($_GET['db'])) ? $databases['db_actual'] : $_GET['db']; +$dbid=(!isset($_GET['dbid'])) ? $databases['db_selected_index'] : $_GET['dbid']; +$context=(!isset($_GET['context'])) ? 0 : $_GET['context']; +$context=(!isset($_POST['context'])) ? $context : $_POST['context']; +$tablename=(!isset($_GET['tablename'])) ? "" : $_GET['tablename']; +$limitstart=(!isset($_GET['limitstart'])) ? 0 : $_GET['limitstart']; +$orderdir=(!isset($_GET['orderdir'])) ? "" : $_GET['orderdir']; +$order=(!isset($_GET['order'])) ? "" : $_GET['order']; +$sqlconfig=(isset($_GET['sqlconfig'])) ? 1 : 0; +$editkey=(!isset($_GET['editkey'])) ? -1 : $_GET['editkey']; +$norder=($orderdir==" DESC") ? " ASC" : " DESC"; +$sql['order_statement']=($order!="") ? " ORDER BY ".$order.$norder : ""; +$sql['sql_statement']=(isset($_GET['sql_statement'])) ? stripslashes(urldecode($_GET['sql_statement'])) : ""; +$showtables=(!isset($_GET['showtables'])) ? 0 : $_GET['showtables']; +$limit=$add_sql=""; +$bb=(isset($_GET['bb'])) ? $_GET['bb'] : -1; +if(isset($_POST['tablename'])) $tablename=$_POST['tablename']; + + +//SQL-Statement geposted +if(isset($_POST['execsql'])) +{ + $sql['sql_statement']=(isset($_POST['sqltextarea'])) ? stripslashes($_POST['sqltextarea']) : ""; + + $db=$_POST['db']; + $dbid=$_POST['dbid']; + $tablename=$_POST['tablename']; + if($tablename=='') $tablename=ExtractTablename($sql['sql_statement']); + +} + + +if($sql['sql_statement']==""){ + if($tablename!="" && $showtables==0) { + $sql['sql_statement']="SELECT * FROM `$tablename`"; + } else { + $sql['sql_statement']="SHOW TABLE STATUS FROM `$db`"; + $showtables=1; + } +} + +//sql-type +$sql_to_display_data=0; +$Anzahl_SQLs=substr_count(substr($sql['sql_statement'],0,strlen($sql['sql_statement'])-1),";"); + +if($Anzahl_SQLs==0 && (substr(strtoupper($sql['sql_statement']),0,6)=="SELECT" || substr(strtoupper($sql['sql_statement']),0,4)=="SHOW" )) + $sql_to_display_data=1; +//if($Anzahl_SQLs>0) $sql_to_display_data=0; + +if($sql_to_display_data==1) { + //nur ein SQL-Statement + $limitende=($limitstart+$config['sql_limit']); + + //Darf editiert werden? + $no_edit=(strtoupper(substr($sql['sql_statement'],0,6))!="SELECT" || $showtables==1 + || preg_match('@^((-- |#)[^\n]*\n|/\*.*?\*/)*(UNION|JOIN)@im', $sql['sql_statement'])); + + if($no_edit)$no_order=true; + + //Darf sortiert werden? + $op=strpos(strtoupper($sql['sql_statement']),"ORDER"); + if($op>0) { + $sql['order_statement']=substr($sql['sql_statement'],$op); + $sql['sql_statement']=substr($sql['sql_statement'],0,$op); + } + +} + +if(isset($_POST['tableselect']) && $_POST['tableselect']!="1") $tablename=$_POST['tableselect']; + +//MySQL verbinden +MSD_mysql_connect(); + +mysql_select_db($db,$config['dbconnection']); + + +///*** EDIT / UPDATES / INSERTS ***/// +///*** ***/// + +//Datensatz editieren +if(isset($_POST['update'])) { + GetPostParams(); + $f=explode("|",$_POST['feldnamen']); + $sqlu='Update `'.$tablename.'` Set '; + for($i=0;$i'; +} +//Datensatz einfügen +if(isset($_POST['insert'])) { + GetPostParams(); + $f=explode("|",$_POST['feldnamen']); + $sqlu='Insert into `'.$tablename.'` Set '; + for($i=0;$i'; +} + +if(isset($_POST['cancel'])) GetPostParams(); + + + + +//Tabellenansicht +$showtables=(substr(strtoupper($sql['sql_statement']),0,5)=="SHOW ") ? 1 : 0; +$tabellenansicht=(substr(strtoupper($sql['sql_statement']),0,10)=="SHOW TABLE") ? 1 : 0; + + +if(strtolower(substr($sql['sql_statement'],0,6))=="select") $limit=' LIMIT '.$limitstart.', '.$limitende.';'; +$params="sql.php?db=".$db."&tablename=".$tablename."&dbid=".$dbid.'&context='.$context.'&sql_statement='.urlencode($sql['sql_statement']).'&tdc='.$tdcompact.'&showtables='.$showtables; +if($order!="") $params.="&order=".$order."&orderdir=".$orderdir.'&context='.$context; +if($bb>-1) $params.="&bb=".$bb; + +$aus=headline($lang['sql_browser']); + +$aus.='

'.$lang['sql_backdboverview'].'  '; +$aus.='['.$lang['tools'].']  '.$lang['db'].'  '; + +if($context<3) { + $aus.='`'.$db.'` '.(($tablename!="") ? ''.$lang['table'].' `'.$tablename.'`' : '').''; +} else $aus.="(".$lang['sql_selecdb'].")"; +$aus.='

 

'; + +if($context==0) { + //Start SQL-Box + if(isset($_GET['readfile']) && $_GET['readfile']==1) { + $aus.='
'; + $aus.=''; + $aus.='
'; + $aus.='SQL-File öffnen (auch gz möglich):(max 2 MB)     
'; + } + if(isset($_POST['submit_openfile'])) { + //open file + if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) $aus.=''.$lang['fm_uploadfilerequest'].''; + else { + $fn=$_FILES['upfile']['tmp_name']; + if(strtolower(substr($_FILES['upfile']['name'],-3))==".gz") + $read__user_sqlfile=gzfile($fn); + else + $read__user_sqlfile=file($fn); + $aus.='geladenes File: '.$_FILES['upfile']['name'].'   '.byte_output(filesize($_FILES['upfile']['tmp_name'])).''; + $sql_loaded=implode("",$read__user_sqlfile); + } + + + + } + $aus.='
'; + //Titelzeile + $aus.='
'; + $aus.='  '; + $aus.='show less'; + $aus.=' show more   '; + $aus.=''.SQL_ComboBox().'  '.Table_ComboBox(); + $aus.='   '; + + if(!isset($_GET['readfile'])) $aus.= '  read file '; + $aus.=''; + $aus.='
'; + + //Eingabebox + $aus.='
'; + $aus.='
'.$lang['sql_warning'].'
'; + + $aus.=''; + $aus.='

'; +} + +if(isset($_GET['mode']) && $context==0) { + if(isset($_GET['recordkey'])) $rk=stripslashes(urldecode($_GET['recordkey'])); + if(isset($_GET['tablename'])) $tablename=$_GET['tablename']; + + if($_GET['mode']=="kill") { + + if($showtables==0) { + $sqlk= "DELETE FROM `$tablename` WHERE ".$rk; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $aus.='

'.$lang['sql_recorddeleted'].'

'; + } else { + $sqlk= "Drop Table `$rk`"; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $aus.='

'.sprintf($lang['sql_recorddeleted'],$rk).'

'; + } + } + if($_GET['mode']=="empty") { + + if($showtables==0) { + + } else { + $sqlk= "TRUNCATE `$rk`"; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $aus.='

'.sprintf($lang['sql_tableemptied'],$rk).'

'; + } + } + if($_GET['mode']=="emptyk") { + + if($showtables==0) { + + } else { + $sqlk= "TRUNCATE `$rk`;"; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $sqlk= "ALTER TABLE `$rk` AUTO_INCREMENT=1;"; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $aus.='

'.sprintf($lang['sql_tableemptiedkeys'],$rk).'

'; + } + } + if($_GET['mode']=="edit") { + $aus.='

'.$lang['sql_recordedit'].' '.$rk.'

'; + $sqledit="Select * from `$tablename` where $rk"; + + $res=MSD_query($sqledit) or die(SQLError($sqledit,mysql_error())); + $aus.='
'; + $aus.=''; + $row=mysql_fetch_row($res); + $aus.=''; + $feldnamen=""; + for($x=0; $xname.'|'; + $aus.=''; + $aus.= ''; //'.$str->type.' + } + + $aus.=''; + $aus.='
'.$str->name.''; + if($str->type=='blob') + $aus.=''; + else + $aus.=''; + $aus.=' 
      
'.FormHiddenParams().'
'; + } + if($_GET['mode']=="new") { + $aus.='

'.$lang['sql_recordnew'].'

'; + $sqledit="SHOW FIELDS FROM `$tablename`"; + $res=MSD_query($sqledit) or die(SQLError($sqledit,mysql_error())); + $num=mysql_numrows($res); + $aus.='
'; + $aus.=''; + + $aus.=''; + $feldnamen=""; + for($x=0; $x<$num; $x++) { + $row=mysql_fetch_row($res); + $feldnamen.=$row[0].'|'; + $aus.=''; + $aus.=''; //'.$str->type.' + } + $aus.=''; + $aus.='
'.$row[0].''; + $type=strtoupper($row[1]); + if($type=='BLOB' || $type=='TEXT') + $aus.=''; + else + $aus.=''; + $aus.=' 
      
'.FormHiddenParams().'
'; + + } +} + + +if($context==0){ + //Data-View + echo $aus.'

'.(($showtables==1)?$lang['sql_tableview']:$lang['sql_dataview']).'

'; + if($showtables==0){ + $p='sql.php?sql_statement='.urlencode($sql['sql_statement']).'&db='.$db.'&tablename='.$tablename.'&dbid='.$dbid.'&limitstart='.$limitstart.'&order='.$order.'&orderdir='.$orderdir.'&tdc='.$tdcompact; + echo ''.$lang['sql_recordnew'].'    '; + echo 'Tabellenstruktur bearbeiten'; + } else { + $p='sql.php?db='.$db.'&dbid='.$dbid.'&context=2'; + echo ''.$lang['sql_tablenew'].''; + } + //Statuszeile + echo '

 Schau mal: '.ExtractTablenameFromSQL($sql['sql_statement']).'

'; + if(isset($msg))echo $msg; + + //SQL ausführen + if($sql_to_display_data==0) { + //mehrere SQL-Statements + $numrowsabs=$numrows=0; + MSD_DoSQL($sql['sql_statement']); + echo SQLOutput($out); + + } else { + $numrowsabs=$numrows=0; + $res=MSD_query($sql['sql_statement']) or die(SQLError($sql['sql_statement'],mysql_error())); + + $numrowsabs=mysql_num_rows($res); + $res=MSD_query($sql['sql_statement'].$sql['order_statement'].$limit) or die(SQLError($sql['sql_statement'].$sql['order_statement'].$limit,mysql_error())); + $numrows=mysql_num_rows($res); + if($limitende>$numrowsabs)$limitende=$numrowsabs; + } + + + if($numrowsabs>0 && $Anzahl_SQLs<=1) { + if($showtables==0) { + $command_line=$lang['info_records']." ".($limitstart+1)." - $limitende ".$lang['sql_vonins']." $numrowsabs    "; + $command_line.=($limitstart>0) ? '<<    ' : '<<    '; + $command_line.=($limitstart>0) ? '<    ' : '<    '; + $command_line.=($limitende<$numrowsabs) ? '>    ' : '>    '; + $command_line.=($limitende<($numrowsabs-$config['sql_limit'])) ? '>>' : '>>'; + echo $command_line; + } else { + echo $numrowsabs." ".$lang['tables']; + } + echo '

'; + //Datentabelle + echo ''; + + $t=$d=""; + $fdesc=Array(); + $key=-1; + if ($numrows>0){ + //Infos und Header holen + //1.Datensatz für Feldinfos + $row= mysql_fetch_row($res); + //Kompaktmodus-Switcher + $t=''; + $t.=''; + for($x=0; $xname; + $fdesc[$x]['table']=$str->table; + $fdesc[$x]['max_length']=$str->max_length; + $fdesc[$x]['not_null']=$str->not_null; + $fdesc[$x]['primary_key']=$str->primary_key; + $fdesc[$x]['unique_key']=$str->unique_key; + $fdesc[$x]['multiple_key']=$str->multiple_key; + $fdesc[$x]['numeric']=$str->numeric; + $fdesc[$x]['blob']=$str->blob; + $fdesc[$x]['type']=$str->type; + $fdesc[$x]['unsigned']=$str->unsigned; + $fdesc[$x]['zerofill']=$str->zerofill; + + $tt="Name: ".$fdesc[$x]['name']."\nType: ".$fdesc[$x]['type']."\nMax Length: ".$fdesc[$x]['max_length']."\nUnsigned: ".$fdesc[$x]['unsigned']."\nzerofill: ".$fdesc[$x]['zerofill']; + $pic=''; + if($str->primary_key==1 || $str->unique_key==1) { + if($key==-1) $key=$x; + if($str->primary_key==1) $pic='primary key'; + elseif($str->unique_key==1) $pic='unique key'; + } + + if($bb==-1) + $bb_link=($str->type=="blob") ? '   [BB]' : ''; + else + $bb_link=($str->type=="blob") ? '   [no BB]' : ''; + if($no_order==false && $showtables==0) + $t.=$pic.' '.$str->name.''.$bb_link; + else + $t.=$pic.' '.$str->name.''.$bb_link; + + $arname=($orderdir==" ASC") ? "arup.gif" : "ardown.gif"; + if($str->name==$order)$t.='  '; + $t.=''; + + //echo "
DOING HEADERS
$t"; + } + + //und jetzt Daten holen + mysql_data_seek ($res, 0); + + for ($i=0;$i<$numrows;$i++) { + $row= mysql_fetch_row($res); + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + for($x=0; $x '.$nl; + $p='sql.php?sql_statement='.urlencode($sql['sql_statement']).'&db='.$db.'&tablename='.$tablename.'&dbid='.$dbid.'&limitstart='.$limitstart.'&order='.$order.'&orderdir='.$orderdir.'&editkey='.$key.'&tdc='.$tdcompact; + if($key==-1) { + $rk=""; + for($il=0;$iledit '; + } + } + if($showtables==0) { + $d.='delete'; + } else { + if($tabellenansicht==1) { + $d.=''.$lang['edit'].' '.$nl.$nl; + $d.=''.$lang['empty'].' '.$nl.$nl; + $d.=''.$lang['emptykeys'].' '.$nl.$nl; + $d.=''.$lang['delete'].' '.$nl.$nl; + } + } + $d.=''; + } + $d.='
'; + } + if($i==0) echo ''.$t.''; + echo "\n\n".''.$d.''."\n\n"; + $d=""; + } + } + echo '
'.(($tdcompact==0) ? 'Ansicht: normal' : 'Ansicht: kompakt').''; + $t.='   '.$lang['sql_queryentry'].' '.count($row).' '.$lang['sql_columns']; + $t.='
 '; + $divstart=''; + $divend=''; + if($bb==$x){ + $data=simple_bbcode_conversion($row[$x]); + } else + $data=(($fdesc[$x]['type']=='string' || $fdesc[$x]['type']=='blob') ? strip_tags($row[$x]) : $row[$x]); + $d.=($tabellenansicht==1 && $x==0) ? "$divstart$data$divend" : $divstart.$data.$divend; + $d.='
'; + if($showtables==0) echo '
'.$command_line; + } else echo '

'.$lang['sql_nodata'].'

'; +} elseif ($context==1) { + //SQL-Strings + echo $aus.='

'.$lang['sql_befehle'].' ('.count($SQL_ARRAY).')

'; + echo ''.$lang['sql_befehlneu'].'

'; + if(isset($_POST['sqlnewupdate'])) { + $ind=count($SQL_ARRAY); + if(count($SQL_ARRAY)>0) + array_push($SQL_ARRAY,$_POST['sqlname'.$ind]."|".$_POST['sqlstring'.$ind]); + else $SQL_ARRAY[0]=$_POST['sqlname0']."|".$_POST['sqlstring0']; + WriteSQL(); + echo '

'.$lang['sql_befehlsaved1'].' \''.$_POST['sqlname'.$ind].'\' '.$lang['sql_befehlsaved2'].'

'; + } + echo '
+ + + + '; + echo ''; + $i=0; + if(count($SQL_ARRAY)>0) { + for($i=0;$i'.$lang['sql_befehlsaved1'].' \''.$_POST['sqlname'.$i].'\' '.$lang['sql_befehlsaved3'].'

'; + $SQL_ARRAY[$i]=$_POST['sqlname'.$i]."|".$_POST['sqlstring'.$i]; + WriteSQL(); + } + if(isset($_POST['sqlmove'.$i])) { + echo '

'.$lang['sql_befehlsaved1'].' \''.$_POST['sqlname'.$i].'\' '.$lang['sql_befehlsaved4'].'

'; + $a[]=$SQL_ARRAY[$i]; + array_splice($SQL_ARRAY,$i,1); + $SQL_ARRAY=array_merge($a,$SQL_ARRAY); + WriteSQL(); + } + if(isset($_POST['sqldelete'.$i])) { + echo '

'.$lang['sql_befehlsaved1'].' \''.$_POST['sqlname'.$i].'\' '.$lang['sql_befehlsaved5'].'

'; + array_splice($SQL_ARRAY,$i,1); + WriteSQL(); + } + } + for($i=0;$i
'; + echo ''; + echo ''; + } + } + if(isset($_GET['new'])) { + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + echo ' + + '; + } + echo '
PositionNameSQL'.$lang['command'].'
'.($i+1).''; + echo '
+
+
'.($i+1).''; + echo '
'.$lang['sql_library'].'
'; + echo '
'; + +} elseif ($context==2) { + //Tabellen + echo $aus.'
'.$lang['sql_tablesofdb'].' `'.$databases['Name'][$dbid].'` '.$lang['sql_edit'].'
'; + if(isset($_GET['kill'])) { + if($_GET['anz']==1) + echo '

'.$lang['sql_nofielddelete'].'

'; + else { + $sql_alter="ALTER TABLE `".$databases['Name'][$dbid]."`.`".$_GET['tablename']."` DROP COLUMN `".$_GET['kill']."`"; + MSD_DoSQL($sql_alter); + echo '
'; + echo '

'.$lang['sql_fielddelete1'].' `'.$_GET['kill'].'` '.$lang['sql_deleted'].'.

'.highlight_sql($out).'
'; + } + } + if(isset($_POST['tablecopysubmit'])) { + $table_edit_name=$_GET['tablename']; + if($_POST['tablecopyname']=="") { + echo '

'.$lang['sql_nodest_copy'].'

'; + } elseif(Table_Exists($databases['Name'][$dbid],$_POST['tablecopyname'])) { + echo '

'.$lang['sql_desttable_exists'].'

'; + } else { + Table_Copy("`".$databases['Name'][$dbid]."`.`".$table_edit_name."`",$_POST['tablecopyname'],$_POST['copyatt']); + echo '
'; + echo ($_POST['copyatt']==0) ? '

'.sprintf($lang['sql_scopy'],$table_edit_name,$_POST['tablecopyname']).'.

' : '

'.sprintf($lang['sql_tcopy'],$table_edit_name,$_POST['tablecopyname']).'

'; + echo highlight_sql($out).'
'; + $tablename=$_POST['tablecopyname']; + } + } + if(isset($_POST['newtablesubmit'])) { + if($_POST['newtablename']=="") { + echo '

'.$lang['sql_tablenoname'].'

'; + } else { + $sql_alter="CREATE TABLE `".$databases['Name'][$dbid]."`.`".$_POST['newtablename']."` (`id` int(11) unsigned not null AUTO_INCREMENT PRIMARY KEY ) ".((MSD_NEW_VERSION) ? "ENGINE" : "TYPE")."=MyISAM;"; + MSD_DoSQL($sql_alter); + echo SQLOutput($out,$lang['table'].' `'.$_POST['newtablename'].'` '.$lang['sql_created']); + } + } + if(isset($_POST['t_edit_submit'])) { + $sql_alter="ALTER TABLE `".$databases['Name'][$dbid]."`.`".$_POST['table_edit_name']."` "; + if($_POST['t_edit_name']=="") + echo '

'.$lang['sql_tblnameempty'].'

'; + elseif(MSD_NEW_VERSION && $_POST['t_edit_collate']!="" && substr($_POST['t_edit_collate'],0,strlen($_POST['t_edit_charset']))!=$_POST['t_edit_charset']) + echo '

'.$lang['sql_collatenotmatch'].'

'; + else { + if($_POST['table_edit_name']!=$_POST['t_edit_name']) { + $sql_alter.="RENAME TO `".$_POST['t_edit_name']."`, "; + $table_edit_name=$_POST['t_edit_name']; + } else $table_edit_name=$_POST['table_edit_name']; + if($_POST['t_edit_engine']!="") $sql_alter.=((MSD_NEW_VERSION) ? "ENGINE=" : "TYPE=").$_POST['t_edit_engine'].", "; + if($_POST['t_edit_rowformat']!="") $sql_alter.="ROW_FORMAT=".$_POST['t_edit_rowformat'].", "; + if(MSD_NEW_VERSION && $_POST['t_edit_charset']!="") $sql_alter.="DEFAULT CHARSET=".$_POST['t_edit_charset'].", "; + if(MSD_NEW_VERSION && $_POST['t_edit_collate']!="") $sql_alter.="COLLATE ".$_POST['t_edit_collate'].", "; + $sql_alter.="COMMENT='".$_POST['t_edit_comment']."' "; + + MSD_DoSQL($sql_alter); + echo SQLOutput($out,$lang['table'].' `'.$_POST['table_edit_name'].'` '.$lang['sql_changed']); + } + } else { + if(!isset($table_edit_name) || $table_edit_name=="") { + $table_edit_name=(isset($_GET['tablename'])) ? $_GET['tablename'] : ""; + if(isset($_POST['tableselect'])) $table_edit_name=$_POST['tableselect']; + if(isset($_POST['newtablesubmit'])) $table_edit_name=$_POST['newtablename']; + } + } + if(isset($_POST['newfield_posted'])) { + //build sql for alter + if($_POST['f_name']=="") { + echo '

'.$lang['sql_fieldnamenotvalid'].' ('.$_POST['f_name'].')

'; + $field_fehler=1; + } else { + //alter Key + $oldkeys[0]=$_POST['f_primary']; + $oldkeys[1]=$_POST['f_unique']; + $oldkeys[2]=$_POST['f_index']; + $oldkeys[3]=$_POST['f_fulltext']; + //neuer Key + $newkeys[0]=($_POST['f_index_new']=="primary")? 1 : 0; + $newkeys[1]=($_POST['f_index_new']=="unique")? 1 : 0; + $newkeys[2]=($_POST['f_index_new']=="index")? 1 : 0; + $newkeys[3]=(isset($_POST['f_indexfull'])) ? 1 : 0; + + $add_sql.=ChangeKeys($oldkeys,$newkeys,$_POST['f_name'],$_POST['f_size'],"drop_only"); + + $sql_stamm="ALTER TABLE `".$databases['Name'][$dbid]."`.`$table_edit_name` "; + $sql_alter=$sql_stamm.((isset($_POST['editfield'])) ? "CHANGE COLUMN `".$_POST['fieldname']."` `".$_POST['f_name']."` " : "ADD COLUMN `".$_POST['f_name']."` "); + $sql_alter.=$_POST['f_type']; + $wl=stripslashes($_POST['f_size']); + if($wl!="" && !preg_match('@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT)$@i', $_POST['f_type'])) { + $sql_alter.="($wl) "; + } elseif ($_POST['f_size']=="" && preg_match('@^(VARCHAR)$@i', $_POST['f_type'])) { + $sql_alter.="("."255".") "; + } else $sql_alter.=" "; + $sql_alter.=$_POST['f_attribut']." "; + $sql_alter.=$_POST['f_null']." "; + $sql_alter.=($_POST['f_default']!="") ? "DEFAULT '".$_POST['f_default']."' " :""; + + if(MSD_NEW_VERSION && $_POST['f_collate']!="") $sql_alter.="COLLATE ".$_POST['f_collate']." "; + + if($_POST['f_extra']=="AUTO_INCREMENT") { + $sql_alter.=" AUTO_INCREMENT "; + } + if($newkeys[0]==1) $sql_alter.=" PRIMARY KEY "; + if($newkeys[1]==1) $sql_alter.=" UNIQUE INDEX "; + if($newkeys[2]==1) $sql_alter.=" INDEX "; + if($newkeys[3]==1) $sql_alter.=" FULLTEXT INDEX "; + + $sql_alter.=$_POST['f_position']." ;"; + + if($add_sql!="") { + $add_sql=$sql_stamm.$add_sql; + $sql_alter="$sql_alter;\n$add_sql;\n"; + } + MSD_DoSQL($sql_alter); + + echo '
'; + echo '

`'.$_POST['f_name'].'` '.((isset($_POST['editfield'])) ? $lang['sql_changed'] : $lang['sql_created']).'.

'; + echo highlight_sql($out).'
'; + $fields_infos=FillFieldinfos($databases['Name'][$dbid],$table_edit_name); + } + } + mysql_select_db($databases['Name'][$dbid]); + $sqlt="SHOW TABLE STATUS FROM `".$databases['Name'][$dbid]."` ;"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + $anz_tabellen=mysql_numrows($res); + $p="sql.php?db=".$databases['Name'][$dbid]."&dbid=$dbid&tablename=$table_edit_name&context=2"; + + echo '
'; + echo ''; + echo '
'.$lang['new'].' '.$lang['sql_createtable'].':
'.$lang['sql_copytable'].':
'; + + echo ''; + + if($anz_tabellen==0) { + echo ''; + } else { + + + echo ''; + echo ''; + echo ''; + } + echo '
'.$lang['sql_notablesindb'].' `'.$databases['Name'][$dbid].'`
'.$lang['sql_selecttable'].':     

 

'; + if($table_edit_name!="") { + + $sqlf="SHOW FULL FIELDS FROM `".$databases['Name'][$dbid]."`.`$table_edit_name` ;"; + $res=MSD_query($sqlf) or die(SQLError($sqlf,mysql_error())); + $anz_fields=mysql_num_rows($res); + + //Array füllen + + $fields_infos=FillFieldinfos($databases['Name'][$dbid],$table_edit_name); + + if(MSD_NEW_VERSION) + $t_engine=(isset($fields_infos['_tableinfo_']['ENGINE'])) ? $fields_infos['_tableinfo_']['ENGINE'] : "MyISAM"; + else + $t_engine=(isset($fields_infos['_tableinfo_']['TYPE'])) ? $fields_infos['_tableinfo_']['TYPE'] : "MyISAM"; + $t_charset=(isset($fields_infos['_tableinfo_']['DEFAULT CHARSET'])) ? $fields_infos['_tableinfo_']['DEFAULT CHARSET'] : ""; + $t_collation=isset($row['Collation']) ? $row['Collation'] : ""; //(isset($fields_infos['_tableinfo_']['COLLATE'])) ? $fields_infos['_tableinfo_']['COLLATE'] : ""; + $t_comment=(isset($fields_infos['_tableinfo_']['COMMENT'])) ? substr($fields_infos['_tableinfo_']['COMMENT'],1,strlen($fields_infos['_tableinfo_']['COMMENT'])-2) : ""; + $t_rowformat=(isset($fields_infos['_tableinfo_']['ROW_FORMAT'])) ? $fields_infos['_tableinfo_']['ROW_FORMAT'] : ""; + + echo "
Tabelle `$table_edit_name`
"; + $td=''; + + + //Tabelleneigenschaften + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'.$lang['sql_tblpropsof'].' `'.$table_edit_name.'` ('.$anz_fields.' '.$lang['fields'].')Name
Engine
Row Format
'.$lang['charset'].'
'.$lang['collation'].'
'.$lang['comment'].'
 

 

'; + + $field_fehler=0; + echo '
Felder der Tabelle `'.$table_edit_name.'`
'; + + if(isset($_GET['newfield']) || isset($_GET['editfield']) || $field_fehler>0 || isset($_POST['newfield_posted'])) { + if(isset($_GET['editfield'])) $id=$_GET['editfield']; + $d_name=(isset($_GET['editfield'])) ? $fields_infos[$id]['name'] : ""; + $d_type=(isset($_GET['editfield'])) ? $fields_infos[$id]['type'] : ""; + $d_size=(isset($_GET['editfield'])) ? $fields_infos[$id]['size'] : ""; + $d_null=(isset($_GET['editfield'])) ? $fields_infos[$id]['null'] : ""; + $d_attribute=(isset($_GET['editfield'])) ? $fields_infos[$id]['attribut'] : ""; + $d_default=(isset($_GET['editfield'])) ? substr($fields_infos[$id]['default'],1,strlen($fields_infos[$id]['default'])-2) : ""; + $d_extra=(isset($_GET['editfield'])) ? $fields_infos[$id]['extra'] : ""; + $d_primary=$d_unique=$d_index=$d_fulltext=0; + $d_collate=(isset($_GET['editfield'])) ? $fields_infos[$id]['collate'] : ""; + $d_comment=(isset($_GET['editfield'])) ? $fields_infos[$id]['comment'] : ""; + $d_privileges=(isset($_GET['editfield'])) ? $fields_infos[$id]['privileges'] : ""; + + if(isset($_GET['editfield'])) { + $d_primary=(isset($fields_infos['_primarykey_']) && $fields_infos['_primarykey_']==$fields_infos[$id]['name']) ? 1 : 0; + if(isset($fields_infos['_key_'])) { + for($i=0;$i'; + if (isset($_GET['editfield'])) echo ''; + if(isset($_POST['newtablesubmit'])) echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + + echo ''; + echo ''; + echo '
'.((isset($_GET['editfield'])) ? $lang['sql_editfield']." `".$d_name."`" : $lang['sql_newfield']).'
Name
Type
Size '.$lang['sql_enumsethelp'].'
NULL
Default
Extra
'.$lang['sql_indexes'].'
'; + echo 'No Index '; + echo 'Primary Key '; + echo 'Unique Index '; + echo 'Index '; + echo 'Fulltext Index 
'.$lang['collation'].'
'.$lang['sql_attributes'].'
'.$lang['sql_atposition'].':

 

'; + } else + echo ''.$lang['sql_insertnewfield'].'

'; + + //Felder ausgeben + echo ''; + for($i=0;$i<$anz_fields;$i++) { + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + if($i==0) echo ''; + echo ''; + echo ''; + echo ''.$td.$fields_infos[$i]['extra'].''; + echo ''; + } + echo '
 FieldTypeSizeNULLKeyAttributeDefaultExtraSortierung
'; + echo 'edit field  '; + echo 'delete field  '; + + echo ''.$fields_infos[$i]['name'].''.$fields_infos[$i]['type'].''.$fields_infos[$i]['size'].''.$fields_infos[$i]['null'].''; + //key + if($fields_infos['_primarykey_']==$fields_infos[$i]['name']) echo 'Primary Key'; + if(isset($fields_infos['_fulltextkey_'])) { + for($ii=0;$ii'; break; + } + } + } + if(isset($fields_infos['_uniquekey_'])) { + for($ii=0;$ii'; break; + } + } + } + if(isset($fields_infos['_key_'])) { + for($ii=0;$ii".$fields_infos['_key_'][$ii]['columns'].""; + if($fields_infos['_key_'][$ii]['name']==$fields_infos[$i]['name']) { + echo 'Index'; break; + } + } + } + echo ''.$fields_infos[$i]['attribut'].''.$fields_infos[$i]['default'].''.((MSD_NEW_VERSION) ? $fields_infos[$i]['collate'] : " ").'

'; + + echo '
'.$lang['sql_tableindexes'].' `'.$table_edit_name.'`
'; + echo ''.((MSD_NEW_VERSION) ? '' : '').''; + $sqlk="SHOW KEYS FROM `".$databases['Name'][$dbid]."`.`$table_edit_name`;"; + $res=MSD_query($sqlk) or die(SQLError($sqlk,mysql_error())); + $num=mysql_numrows($res); + if($num==0) { + echo ''; + } else { + for($i=0;$i<$num;$i++) { + $row=mysql_fetch_array($res); + $cl= ($i % 2) ? "dbrow" : "dbrow1"; + //Images + echo ''; + echo ''; + if(MSD_NEW_VERSION) echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } + echo '
 Index-NameTyp'.$lang['sql_allowdups'].''.$lang['sql_cardinality'].'Spalten
'.$lang['sql_tablenoindexes'].'
  '.$row['Key_name'].''.$row['Index_type'].''.(($row['Non_unique']==1) ? $lang['yes']: $lang['no']).''.(($row['Cardinality']>=0) ? $row['Cardinality'] : "keine").''.$row['Column_name'].'

'; + + /*echo "
"; + echo '
';print_r($fields_infos);echo '
';*/ + } + +} elseif ($context==3) { + //Datenbanken + if(isset($_GET['dbrefresh'])) SetDefault(); + + echo $aus."

Tools

"; + if(isset($_POST['dbdosubmit'])) { + $newname=$_POST['newname']; + $db_index=$_POST['db_index']; + $db_action=$_POST['db_action']; + $changed=false;$ausgabe=$out=""; + switch($db_action) { + case "drop": + MSD_DoSQL("DROP DATABASE `".$databases['Name'][$db_index]."`"); + echo SQLOutput($out,'

'.$lang['db'].' `'.$databases['Name'][$db_index].'` wurde gelöscht.

'); + $changed=true; + break; + case "empty": + EmptyDB($databases['Name'][$db_index]); + echo SQLOutput($out,'

'.$lang['db'].' `'.$databases['Name'][$db_index].'` '.$lang['sql_wasemptied'].'.

'); + break; + case "rename": + $dbold=$databases['Name'][$db_index]; + DB_Copy($dbold,$newname,1); + echo SQLOutput($out,'

'.$lang['db'].' `'.$dbold.'` '.$lang['sql_renamedto'].' `'.$newname.'`.

'); + $changed=true; + break; + case "copy": + $dbold=$databases['Name'][$db_index]; + DB_Copy($dbold,$newname); + $changed=true; + echo SQLOutput($out,'

'.sprintf($lang['sql_dbcopy'],$dbold,$newname).'

'); + break; + case "structure": + DB_Copy($databases['Name'][$db_index],$newname,0,0); + $changed=true; + echo SQLOutput($out,'

'.sprintf($lang['sql_dbscopy'],$databases['Name'][$db_index],$newname).'

'); + break; + case "rights": + break; + } + + + if($changed=true) { + SetDefault(); + include ($config['files']['parameter']); + echo ''; + + } + } + if(isset($_POST['dbwantaction'])) { + if(isset($_POST['db_createnew'])) { + $newname=$_POST['db_create']; + if(!empty($newname)) { + $col=(MSD_NEW_VERSION) ? $_POST['db_collate'] : ""; + if($col!="") { + $r=explode("|",$col); + $sqlc="CREATE DATABASE `$newname` DEFAULT CHARACTER SET $r[0] COLLATE $r[1]"; + } else $sqlc="CREATE DATABASE `$newname`"; + MSD_query($sqlc) or die(SQLError($sqlc,mysql_error())); + echo $lang['db']." `$newname` ".$lang['sql_wascreated'].".
"; + SetDefault(); + include ($config['files']['parameter']); + echo ''; + + } + } + $db_action=$newname="";$db_index=-1; + for($i=0;$i
'; + echo '
'; + switch($db_action) { + case "drop": + echo ''.sprintf($lang['askdbdelete'],$databases['Name'][$i]).'

'; + echo ''; + break; + case "empty": + echo ''.sprintf($lang['askdbempty'],$databases['Name'][$i]).'

'; + echo ''; + break; + case "rename": + echo ''.$lang['sql_renamedb'].' `'.$databases['Name'][$db_index].'` '.$lang['in'].' `'.$newname.'`

'; + echo ''; + break; + case "copy": + echo ''.sprintf($lang['askdbcopy'],$databases['Name'][$db_index],$newname).'

'; + if($newname=="") echo '

'.$lang['sql_namedest_missing'].'

'; else { + echo ''; + + } + break; + case "structure": + echo ''.$lang['fm_askdbcopy1'].'`'.$databases['Name'][$db_index].'`'.$lang['fm_askdbcopy2'].'`'.$newname.'`'.$lang['fm_askdbcopy3'].'

'; + if($newname=="") echo '

'.$lang['sql_namedest_missing'].'

'; else { + echo ''; + + } + break; + case "rights": + break; + } + echo "

"; + + + } + } + + echo '
'; + echo '
'; + echo ''; + echo '
'.$lang['create_database'].'
Name: '; + echo '  '.$lang['collation'].':   '; + echo '
'; + + echo '

 

'; + echo ''; + for($i=0;$i' : ''; + echo ''; + echo ''; + } + + echo '
'.$lang['dbs'].''.$lang['sql_actions'].'
'.$databases['Name'][$i].''; + echo '  '; + echo "\n\n".'  '; + + echo '  
'; + + +} elseif ($context==4) { + //Im-/Export + $import=(isset($_GET['import'])) ? 1 : 0; + if($import==1) { + //IMPORT + CheckcsvOptions(); + if(isset($_POST['f_import_csvtrenn'])) $sql['import']['trenn']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_import_csvtrenn']) : $_POST['f_import_csvtrenn']; + if(isset($_POST['f_import_csvenc'])) $sql['import']['enc']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_import_csvenc']) : $_POST['f_import_csvenc']; + if(isset($_POST['f_import_csvesc'])) $sql['import']['esc']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_import_csvesc']) : $_POST['f_import_csvesc']; + if (empty($sql['import']['endline'])) { + $sql['import']['endline']=$nl; + } else { + $sql['import']['endline']= str_replace('\\r', "\015",$sql['import']['endline']); + $sql['import']['endline'] = str_replace('\\n', "\012",$sql['import']['endline']); + $sql['import']['endline']= str_replace('\\t', "\011",$sql['import']['endline']); + } + $sql['import']['endline']= str_replace('\\t', "\011",$sql['import']['endline']); + if(isset($_POST['f_import_csvnull'])) $sql['import']['null']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_import_csvnull']) : $_POST['f_import_csvnull']; + $sql['import']['namefirstline']=(isset($_POST['f_import_namefirstline'])) ? $_POST['f_import_namefirstline'] : 0; + $sql['import']['emptydb']=(isset($_POST['import_emptydb'])) ? 1:0; + $sql['import']['createindex']=(isset($_POST['import_createindex'])) ? 1:0; + $sql['import']['table']=(isset($_POST['import_table'])) ? $_POST['import_table'] : ""; + $sql['import']['import_source']=isset($_POST['import_source']) ? $_POST['import_source'] : 0; + $sql['import']['text']=isset($_POST['import_text']) ? (($config['magic_quotes_gpc']) ? stripslashes($_POST['import_text']) : $_POST['import_text']) : ""; + $sql['import']['csv']=""; + + if(isset($_POST['do_import'])) { + + $sql['import']['tablecreate']=0; + if($sql['import']['table']=="new") { + $sql['import']['table']="import_"; + $sql['import']['tablecreate']=1; + } + if($sql['import']['table']=="") { + $aus.=''.$lang['import_notable'].''; + } else { + if($_POST['import_source']==0) { + //Import aus textbox + $sql['import']['csv']=explode($sql['import']['endline'],$sql['import']['text']); + + } else { + if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) { + $aus.=''.$lang['fm_uploadfilerequest'].''; + } else { + $fn=$_FILES['upfile']['tmp_name']; + + $sql['import']['csv']=(substr($_FILES['upfile']['name'],-3)==".gz") ? gzfile($fn) : file($fn); + $sql['import']['text']=implode("",$sql['import']['csv']); + $aus.=''.$lang['sql_uploadedfile'].''.$_FILES['upfile']['name'].'   '.byte_output(filesize($_FILES['upfile']['tmp_name'])).''; + + } + } + if(is_array($sql['import']['csv'])) + $aus.=DoImport(); + else + $aus.='
'.$lang['csv_nodata'].''; + + } + } + $impaus=$aus; + + $impaus.='
'.$nl; + $impaus.= ''; + $impaus.= ''.$lang['export'].''; + $impaus.= '
'.sprintf($lang['sql_import'],$databases['Name'][$dbid]).'
'; + $impaus.= ''.$nl; + + $impaus.= ''; + + $impaus.=''; + + $impaus.=''; + + $impaus.= '
'.$nl; + $impaus.= $lang['importoptions'].''.$lang['csvoptions'].'
'.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= '
'.$lang['importtable'].'
'.$lang['importsource'].''.$lang['fromtextbox'].'
'.$nl; + $impaus.= ''.$lang['fromfile'].'
'.$lang['emptytablebefore'].'
'.$lang['createautoindex'].'
'.$nl; + + + $impaus.= '
'.$nl; + + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= ''.$nl; + $impaus.= '
'.$lang['csv_namefirstline'].'
'.$lang['csv_fieldseperate'].'
'.$lang['csv_fieldsenclosed'].'
'.$lang['csv_fieldsescape'].'
'.$lang['csv_eol'].'
'.$lang['csv_null'].'
'.$nl; + + $impaus.= '
'.$lang['csv_fileopen'].':   + '; + $impaus.='
'.$nl; + + + + $impaus.= '

 

'.$lang['import'].':
'.$nl; + + $impaus.= ''.$nl; + + echo $impaus.$nl; + + } else { + //EXPORT + $tables=0;$tblstr=""; + $sql['export']['db']=$db; + + if(isset($_POST['f_export_submit'])) { + //echo '
'.print_r($_POST,true).'

'; + $sql['export']['header_sent']=""; + $sql['export']['lines']=0; + $sql['export']['format']=$_POST['f_export_format']; + $sql['export']['ztrenn']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_export_csvztrenn']) : $_POST['f_export_csvztrenn']; + $sql['endline']['ztrenn']=$sql['export']['ztrenn']; + if($sql['export']['format']==0) { + //CSV + $format=0; + $sql['export']['trenn']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_export_csvtrenn']) : $_POST['f_export_csvtrenn']; + $sql['export']['enc']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_export_csvenc']) : $_POST['f_export_csvenc']; + $sql['export']['esc']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_export_csvesc']) : $_POST['f_export_csvesc']; + if (empty($sql['export']['endline'])) { + $sql['export']['endline']=$nl; + } else { + $sql['export']['endline']= str_replace('\\r', "\015",$sql['export']['endline']); + $sql['export']['endline'] = str_replace('\\n', "\012",$sql['export']['endline']); + $sql['export']['endline']= str_replace('\\t', "\011",$sql['export']['endline']); + } + $sql['export']['endline']= str_replace('\\t', "\011",$sql['export']['endline']); + } elseif($sql['export']['format']==1) { + //EXCEL + $format=1; + $sql['export']['trenn']=","; + $sql['export']['enc']='"'; + $sql['export']['esc']='"'; + $sql['export']['endline']="\015\012"; + } elseif($sql['export']['format']==3) { + //EXCEL 2003 + $format=1; + $sql['export']['trenn']=";"; + $sql['export']['enc']='"'; + $sql['export']['esc']='"'; + $sql['export']['endline']="\015\012"; + } elseif($sql['export']['format']==4) { + //XML + $format=4; + CheckcsvOptions(); + } elseif($sql['export']['format']==5) { + //HTML + $format=5; + CheckcsvOptions(); + } + if($format<3) $sql['export']['null']=($config['magic_quotes_gpc']) ? stripslashes($_POST['f_export_csvnull'.$format]) : $_POST['f_export_csvnull'.$format]; + $sql['export']['namefirstline']=(isset($_POST['f_export_namefirstline'.$format])) ? $_POST['f_export_namefirstline'.$format] : 0; + + $sql['export']['sendfile']=$_POST['f_export_sendresult']; + $sql['export']['compressed']=(isset($_POST['f_export_compressed'])) ? $_POST['f_export_compressed'] : 0; + + $sql['export']['exportfile']=""; + $sql['export']['xmlstructure']=(isset($_POST['f_export_xmlstructure'])) ? $_POST['f_export_xmlstructure'] : 0; + $sql['export']['htmlstructure']=(isset($_POST['f_export_htmlstructure'])) ? $_POST['f_export_htmlstructure'] : 0; + + //ausgewählte Tabellen + if(isset($_POST['f_export_tables'])) + $sql['export']['tables']=$_POST['f_export_tables']; + + } else CheckcsvOptions(); + + //Tabellenliste + $sqlt="SHOW TABLE STATUS FROM `$db`"; + $res=MSD_query($sqlt) or die(SQLError($sqlt,mysql_error())); + if($res) { + $sql['export']['tablecount']=mysql_numrows($res); + $sql['export']['recordcount']=0; + for($i=0;$i<$sql['export']['tablecount'];$i++) { + $row = mysql_fetch_array($res); + $tblstr.=''."\n"; + $sql['export']['recordcount']+=$row['Rows']; + } + } + + $exaus=$aus.'

'.sprintf($lang['sql_export'],$databases['Name'][$dbid]).'

'; + + $exaus.='
'.$nl; + $exaus.= ''.$lang['import'].''; + $exaus.= '
'.sprintf($lang['sql_export'],$databases['Name'][$dbid]).'
'; + $exaus.= ''.$nl; + $exaus.= ''; + $exaus.= ''; + $exaus.= ''; + + $exaus.= '
'.$lang['tables'].''.$lang['exportoptions'].''.$lang['export'].'
'.$sql['export']['tablecount'].' '.$lang['tables'].', '.$sql['export']['recordcount'].' '.$lang['records'].''; + $exaus.= '   '.$lang['all'].'  '.$lang['none'].''.$nl; + + $exaus.= '

'.$nl; + $exaus.= '
'.$nl; + $exaus.= ''.$nl; + $exaus.= ''."CSV".'   '.$nl; + $exaus.= ''."Excel".'   '.$nl; + $exaus.= ''.$lang['excel2003'].'
'.$nl; + $exaus.= ''."XML".'   '.$nl; + $exaus.= ''."HTML".'

'.$nl; + $exaus.= '
CSV-Optionen'.$nl; + $exaus.= ''.$nl; + $exaus.= ''.$nl; + $exaus.= ''.$nl; + $exaus.= ''.$nl; + $exaus.= ''.$nl; + $exaus.= '
'.$nl; + $exaus.= ''.$lang['csv_namefirstline'].'
'.$lang['csv_fieldseperate'].'
'.$lang['csv_fieldsenclosed'].'
'.$lang['csv_fieldsescape'].'
'.$lang['csv_eol'].'
'.$lang['csv_null'].'
'.$nl; + + $exaus.= '
Excel-Optionen'.$nl; + $exaus.= ''.$nl; + $exaus.= '
'; + $exaus.= ''.$lang['csv_namefirstline'].'
'.$lang['csv_null'].'
'.$nl; + + $exaus.= '
XML-Optionen'; + $exaus.= ''; + $exaus.= '
mit Struktur
'.$nl; + + $exaus.= '
HTML-Optionen'; + $exaus.= ''; + $exaus.= '
mit Struktur
'.$nl; + + $exaus.= '
'.$nl; + $exaus.= ''.$lang['showresult'].'
'.$nl; + $exaus.= ''.$lang['sendresultasfile'].'
'.$nl; + $exaus.= '
'.$lang['compressed'].'

'.$nl; + + $exaus.= '
'.$nl; + $exaus.= '
'.$nl; + + $exaus.= ''.$nl; + + if(!$download) echo $exaus.$nl; + if(isset($_POST['f_export_submit']) && isset($sql['export']['tables'])) { + if(!$download) echo '

'.$lang['export'].':zeige in neuem Fenster

'.$nl; + echo ''.$lang['exportfinished'].'  '.sprintf($lang['exportlines'],$sql['export']['lines']).$nl; + } else exit(); + } + } +} +?> + +

'; +echo MSDFooter(); + +function FormHiddenParams() +{ + global $db,$dbid,$tablename,$context,$limitstart,$order,$orderdir; + + $s=''; + $s.=''; + $s.=''; + $s.=''; + $s.=''; + $s.=''; + $s.=''; + + return $s; + +} + + +?> diff --git a/mysqldumper/style.php b/mysqldumper/style.php new file mode 100644 index 0000000..8900c1f --- /dev/null +++ b/mysqldumper/style.php @@ -0,0 +1,141 @@ + + + +/* MySQLDumper STYLESHEET + +Name: msd + +*/ + +* {margin: 0;padding: 0;} +img {border:0;} + + + +body {font:12px/1.5 Verdana,Helvetica,sans-serif;color:#4E5665;background: #C7D1D0;} +body.menu {font:12px Verdana,Helvetica,sans-serif;color:#4E5665;background:#738C88;} + +/* LINKS */ + +a {color:#4E5665 ; text-decoration:underline; font:12px verdana, sans-serif} +a:hover {color:#E87B00; text-decoration:none} +a.ul {text-decoration:underline;} + + +/* general */ +#pagetitle {font-size: 18px;font-weight: bold;background:url(pics/pagetitle.gif) #6495ED;letter-spacing: 2px;color:White;padding:2px 6px;} + +#server0 {position:absolute;bottom:2px;text-align:center;padding:1px;} +#server1 {position:absolute;right:16px;text-align:center;padding:1px;} +a.server {color:#333333;font-size:10px;} +a.server:hover {text-decoration: underline;color: white;} + +.version {font-size: 11px;font-weight:bold;} +.small {font-size:11px;} +.ssmall {font-size:10px;} +.success {font-weight:bold;} +.error {color:red;font-weight:bold;} + +table td {text-align:left;vertical-align:top;padding:0 6px;} +table th {padding:0 6px;} + +/* MENU */ +#wrapmenu {margin:0;} + +#menu {background: url(pics/navi_bg.jpg) no-repeat; text-align:center;} +#menu ul {margin-top:160px;padding:0;list-style:none;border-top:1px solid #9AA2B1} +#menu ul li { height:20px;} +#menu ul li a {display:block;position:relative; /*fuer den ie*/ font:11px/20px verdana, sans-serif;text-decoration:none;color:#4E5665; background:url(pics/mainnavi.gif) repeat-x 0 -20px;padding:0 15px;height:20px;text-align:left;} +#menu ul li a:hover {color:#fff; background:url(pics/mainnavi.gif) repeat-x 0 0px;} +/*der aktive link in der navi*/ +#menu ul li.active a {font-weight:bold;color:#fff; background:url(pics/mainnavi.gif) repeat-x 0 -40px; display:block;} + +#menu p,#menu p a{color:#fff;line-height:1.5;font-size:11px;} + +/* MAIN */ +#topnavi {text-align:center;margin:6px;} +#content {margin-left:12px;} +#content p {margin-bottom:8px;} + +/*Tabellen */ +table tr.dbrow {background:#E4E9E8;} +table tr.dbrow1 {background:#D5DDDC;} +table tr.dbrowsel {background:#fff;} +table.bordersmall,table.border {border:2px solid #738C88;width:84%;} +table.border th,table.bordersmall th {font-size:11px;color:#738C88;} +table.border tr.thead,table.bordersmall tr.thead {background:#A5B6B4;height:24px;} +table.bordersmall input,table.bordersmall select,table.bordersmall td, +#sqlheaderbox select,#configright select, #configright a {font-size:11px;} +.tdcompact {width:100px;height:16px;overflow:hidden;font-size:11px;} +.tdnormal {white-space:nowrap;padding:4px;} +.sqlheadmenu a {} + + +/* FORM-Elements */ +#content .Formbutton {margin:6px;font:10px verdana, sans-serif; border: 1px solid #4E5665; background:#A9B2B1; color:#4E5665;padding:2px;cursor: pointer;} +#content .SQLbutton {font-size:11px;background:#E4E9E8;cursor: pointer;} +#content textarea #thta {font-size:11px;color:blue;width:400px;height:300px;overflow:scroll;} +#content textarea {width:100%;background:#B3C2C0;} + +input.radio,input.checkbox {background-color: transparent;} + +/* Colors for Formelements */ +input.text,input.small {background:#B3C2C0;color:#4E5665;} +select {background:#B3C2C0;color:#4E5665;} +textarea {background:#B3C2C0;color:#4E5665;} + +/* for Geckos */ +input[disabled] {color:#888;} + + +/*horizontales Menü */ + +#hormenu {} +#hormenu ul {border-bottom:thin solid #D5DDDC;margin-bottom:8px;width:80%;} +#hormenu ul li {display:inline;} +#hormenu ul li a {font:11px/20px verdana, sans-serif;text-decoration:none;color:#4E5665;padding:0 14px;border:0;} +#hormenu ul li a:hover {color:#E87B00;} +#hormenu ul li#active a{font:bold 11px/20px verdana, sans-serif;text-decoration:none; color:#E87B00; float:left; padding:0 14px;} +#hormenu ul li#active a:hover{color:#E87B00; } + +/* spezielle Elemente */ +.MySQLbox{font-size: 10pt;padding: 6px;background:#000; color: #fff;border: thin solid #999999;height: 200px;width: 80%;text-align: left;overflow: auto; } +#content #mysqlbox {border:1px solid #738C88;background:#D5DDDC;} +#content #sqlheaderbox {white-space:nowrap;height:20px;vertical-align:middle;padding-top:2px;} +#content #sqleditbox {border:1px solid #738C88;background:#E4E9E8;margin-bottom:10px;} +#content #sqleditbox p {background:#A5B6B4;font-weight:bold;text-align:center;} +#content #sqlnewbox {border:1px solid #738C88;background:#E4E9E8;} +#content #sqlnewbox p {background:#A5B6B4;font-weight:bold;text-align:center;} +#content #sqloutbox {font-size: 11px;width:700px;padding:6px;background:#D5DDDC;border:1px solid #738C88;overflow:auto;height:240px;} +#content p.autodel {font-size:11px;border-bottom:1px dashed #fff;margin-bottom:12px;} +#content .Logbox {font:12px/1.2 "Courier New", Courier, monospace;padding: 6px;border: thin solid #738C88;height: 320px;width: 90%;text-align: left;overflow: auto;} +#content .Logbox span {color:#738C88;} +#content .backupmsg {padding-left:20px;font-size:11px;} +#content .backupmsg .success,#content .backupmsg a{color:#999;font-size:11px;} +#content .backupmsg .error {color:red;} + +/* TEXT */ + +h1 {font-size:16px;} +h5 {font-size:14px;margin:12px 0;} +h6 {font-size:11px; background:#D1D4DC;border:1px solid #9AA2B1;text-indent: 12px;margin:8px 0;} + +/* Config */ +#configleft {float:left;width:160px;margin-top:24px;} +#configleft .Formbutton {width:130px;margin:8px 0;} +#configleft .ConfigButton {width:130px;font-size:11px;background:#E4E9E8;} +#configleft .ConfigButtonSelected {width: 130px;font-size: 11px;background: #D5DDDC;} + +#configright {font-size:11px;margin-left:160px;} +#configright fieldset {border:1px thin #D5DDDC;padding:12px;width:90%;} +#configright legend {color:#646968;margin:8px 0;} + + +#footer {font-size:11px;text-align:center;border-top:1px dashed #eee;margin-top:36px;} +#footer a {font-size:11px;} \ No newline at end of file