Changeset 1049 for locker/sql
- Timestamp:
- Apr 2, 2009, 9:55:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/sql/bin/get-password
r1037 r1049 12 12 global $env_user; 13 13 $cnfFile = file_get_contents($path); 14 if (preg_match('/\[mysql\][^\[]*host *= *([^\ n]*)/',$cnfFile,$match)) {14 if (preg_match('/\[mysql\][^\[]*host *= *([^\r\n]*)/',$cnfFile,$match)) { 15 15 $host = $match[1]; 16 } elseif (preg_match('/\[client\][^\[]*host *= *([^\ n]*)/',$cnfFile,$match)) {16 } elseif (preg_match('/\[client\][^\[]*host *= *([^\r\n]*)/',$cnfFile,$match)) { 17 17 $host = $match[1]; 18 18 } else { 19 19 $host = 'sql.mit.edu'; 20 20 } 21 if (preg_match('/\[mysql\][^\[]*user *= *([^\ n]*)/',$cnfFile,$match)) {21 if (preg_match('/\[mysql\][^\[]*user *= *([^\r\n]*)/',$cnfFile,$match)) { 22 22 $user = $match[1]; 23 } elseif (preg_match('/\[client\][^\[]*user *= *([^\ n]*)/',$cnfFile,$match)) {23 } elseif (preg_match('/\[client\][^\[]*user *= *([^\r\n]*)/',$cnfFile,$match)) { 24 24 $user = $match[1]; 25 25 } else { 26 26 $user = $env_user; 27 27 } 28 if (preg_match('/\[mysql\][^\[]*password *= *([^\ n]*)/',$cnfFile,$match)) {28 if (preg_match('/\[mysql\][^\[]*password *= *([^\r\n]*)/',$cnfFile,$match)) { 29 29 $password = $match[1]; 30 } elseif (preg_match('/\[client\][^\[]*password *= *([^\ n]*)/',$cnfFile,$match)) {30 } elseif (preg_match('/\[client\][^\[]*password *= *([^\r\n]*)/',$cnfFile,$match)) { 31 31 $password = $match[1]; 32 32 } else {
Note: See TracChangeset
for help on using the changeset viewer.