|
25 | 25 | if ($result->errorCode() == 0) { |
26 | 26 | $data = $result->fetch(); |
27 | 27 | if ($data['setting'] != $database_charset) { |
28 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . sprintf($_lang['status_failed_database_collation_does_not_match'], $data['setting']) . '</span>'; |
| 28 | + echo $output . '<span id="database_fail">' . sprintf($_lang['status_failed_database_collation_does_not_match'], $data['setting']) . '</span>'; |
29 | 29 | exit(); |
30 | 30 | } |
31 | 31 | $result = $dbh->query("SELECT COUNT(*) FROM {$tableprefix}site_content"); |
32 | 32 |
|
33 | 33 | if ($dbh->errorCode() == 0) { |
34 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed_table_prefix_already_in_use'] . '</span>'; |
| 34 | + echo $output . '<span id="database_fail">' . $_lang['status_failed_table_prefix_already_in_use'] . '</span>'; |
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | } else { |
38 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed'] . ' ' . print_r($result->errorInfo(), true) . '</span>'; |
| 38 | + echo $output . '<span id="database_fail">' . $_lang['status_failed'] . ' ' . print_r($result->errorInfo(), true) . '</span>'; |
39 | 39 | exit(); |
40 | 40 | } |
41 | 41 | break; |
|
44 | 44 | if ($result->errorCode() == 0) { |
45 | 45 | $data = $result->fetch(); |
46 | 46 | if ($data['Value'] != $database_collation) { |
47 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . sprintf($_lang['status_failed_database_collation_does_not_match'], $data['1']) . '</span>'; |
| 47 | + echo $output . '<span id="database_fail">' . sprintf($_lang['status_failed_database_collation_does_not_match'], $data['1']) . '</span>'; |
48 | 48 | exit(); |
49 | 49 | } |
50 | 50 |
|
51 | 51 | $result = $dbh->query("SELECT COUNT(*) FROM {$tableprefix}site_content"); |
52 | 52 |
|
53 | 53 | if ($dbh->errorCode() == 0) { |
54 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed_table_prefix_already_in_use'] . '</span>'; |
| 54 | + echo $output . '<span id="database_fail">' . $_lang['status_failed_table_prefix_already_in_use'] . '</span>'; |
55 | 55 | exit(); |
56 | 56 | } |
57 | 57 | $result = $dbh->query("SELECT SCHEMA_NAME |
|
60 | 60 | if ($dbh->errorCode() == 0) { |
61 | 61 | $data = $result->fetch(); |
62 | 62 | if (isset($data['SCHEMA_NAME']) && $data['SCHEMA_NAME'] == $pwd) { |
63 | | - echo $output . '<span id="database_pass" style="color:#80c000;"> ' . $_lang['status_passed'] . '</span>'; |
| 63 | + echo $output . '<span id="database_pass"> ' . $_lang['status_passed'] . '</span>'; |
64 | 64 | exit(); |
65 | 65 | } |
66 | 66 | } |
67 | 67 | } else { |
68 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed'] . ' ' . print_r($result->errorInfo(), true) . '</span>'; |
| 68 | + echo $output . '<span id="database_fail">' . $_lang['status_failed'] . ' ' . print_r($result->errorInfo(), true) . '</span>'; |
69 | 69 | exit(); |
70 | 70 | } |
71 | 71 | break; |
72 | 72 | } |
73 | 73 |
|
74 | 74 | } catch (PDOException $e) { |
75 | 75 | if (!stristr($e->getMessage(), 'database "' . $pwd . '" does not exist') && !stristr($e->getMessage(), 'Unknown database \'' . $database_name . '\'') && !stristr($e->getMessage(), 'Base table or view not found')) { |
76 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed'] . ' ' . $e->getMessage() . '</span>'; |
| 76 | + echo $output . '<span id="database_fail">' . $_lang['status_failed'] . ' ' . $e->getMessage() . '</span>'; |
77 | 77 | exit(); |
78 | 78 | } |
79 | 79 | } |
|
86 | 86 | $dbh->query('CREATE DATABASE "' . $database_name . '" ENCODING \'' . $database_charset . '\';'); |
87 | 87 | if ($dbh->errorCode() > 0) { |
88 | 88 | if (stristr($dbh->errorInfo()[2], 'already exists') === false) { |
89 | | - $output .= '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed_could_not_create_database'] . ' ' . print_r($dbh->errorInfo(), true) . '</span>'; |
| 89 | + $output .= '<span id="database_fail">' . $_lang['status_failed_could_not_create_database'] . ' ' . print_r($dbh->errorInfo(), true) . '</span>'; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | } catch (Exception $exception) { |
|
97 | 97 | case 'mysql': |
98 | 98 | $query = 'CREATE DATABASE IF NOT EXISTS `' . $database_name . '` CHARACTER SET ' . $database_charset . ' COLLATE ' . $database_collation . ";"; |
99 | 99 | if (!$dbh->query($query)) { |
100 | | - $output .= '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed_could_not_create_database'] . '</span>'; |
| 100 | + $output .= '<span id="database_fail">' . $_lang['status_failed_could_not_create_database'] . '</span>'; |
101 | 101 | echo $output; |
102 | 102 | exit(); |
103 | 103 | } else { |
104 | | - $output .= '<span id="database_pass" style="color:#80c000;">' . $_lang['status_passed_database_created'] . '</span>'; |
| 104 | + $output .= '<span id="database_pass">' . $_lang['status_passed_database_created'] . '</span>'; |
105 | 105 | echo $output; |
106 | 106 | exit(); |
107 | 107 | } |
108 | 108 | break; |
109 | 109 | } |
110 | 110 |
|
111 | | - echo $output . '<span id="database_pass" style="color:#80c000;"> ' . $_lang['status_passed'] . '</span>'; |
| 111 | + echo $output . '<span id="database_pass"> ' . $_lang['status_passed'] . '</span>'; |
112 | 112 | exit(); |
113 | 113 | } catch (PDOException $e) { |
114 | | - echo $output . '<span id="database_fail" style="color:#FF0000;">' . $_lang['status_failed'] . ' ' . $e->getMessage() . '</span>'; |
| 114 | + echo $output . '<span id="database_fail">' . $_lang['status_failed'] . ' ' . $e->getMessage() . '</span>'; |
115 | 115 | } |
116 | 116 |
|
117 | 117 | echo $output; |
0 commit comments