GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Small collection of scripts to manage wordpress
Homepage: http://people.warp.es/~koke/wordpress-scripts/
Clone URL: git://github.com/koke/wordpress-scripts.git
Pass correctly the password to mysql
koke (author)
Wed May 14 12:11:15 -0700 2008
commit  f71e6f9c0b870461a7c0b50216f5c3e033934fc5
tree    86deb0f68884050f42b583c1daef25d361255b45
parent  0f10850d9ee258d49c1487358d2154d1b1a978ea
...
19
20
21
22
 
 
 
 
 
 
...
19
20
21
 
22
23
24
25
26
27
0
@@ -19,4 +19,9 @@ if (!is_dir($wp_path)) {
0
 require $wp_path."/wp-config.php";
0
 
0
 echo "Backing up database...\n";
0
-system(sprintf("mysqldump -h %s -u %s -p%s %s | gzip -c9 > $backup_name", DB_HOST, DB_USER, DB_PASSWORD, DB_NAME));
0
+if (DB_PASSWORD == "") {
0
+ $popt = "";
0
+} else {
0
+ $popt = "-p" . DB_PASSWORD
0
+}
0
+system(sprintf("mysqldump -h %s -u %s $popt %s | gzip -c9 > $backup_name", DB_HOST, DB_USER, DB_NAME));
...
19
20
21
22
 
23
24
25
 
26
27
 
...
19
20
21
 
22
23
24
 
25
26
 
27
0
@@ -19,9 +19,9 @@ if (!is_dir($wp_path)) {
0
 require $wp_path."/wp-config.php";
0
 
0
 echo "Importing database...\n";
0
-if ($password == "") {
0
+if (DB_PASSWORD == "") {
0
     $popt = "";
0
 } else {
0
- $popt = "-p%s"
0
+ $popt = "-p" . DB_PASSWORD
0
 }
0
-system(sprintf("zcat %s | mysql -h %s -u %s $popt %s", $backup_name, DB_HOST, DB_USER, DB_PASSWORD, DB_NAME));
0
+system(sprintf("zcat %s | mysql -h %s -u %s $popt %s", $backup_name, DB_HOST, DB_USER, DB_NAME));
...
18
19
20
21
 
22
23
24
 
25
26
27
...
18
19
20
 
21
22
23
 
24
25
26
27
0
@@ -18,10 +18,10 @@ if (!is_dir($wp_path)) {
0
 
0
 require $wp_path."/wp-config.php";
0
 
0
-if ($password == "") {
0
+if (DB_PASSWORD == "") {
0
     $popt = "";
0
 } else {
0
- $popt = "-p%s";
0
+ $popt = "-p" . DB_PASSWORD
0
 }
0
 if (!preg_match('/^http:\/\//', $host_name)) {
0
     $host_name = "http://$host_name";

Comments

    No one has commented yet.