Skip to content

Commit 4777d8d

Browse files
andrepereiradasilvardeutz
authored andcommitted
warnings and errors, not notices ... (#11801)
1 parent 67b3aeb commit 4777d8d

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

installation/model/database.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -111,47 +111,47 @@ public function initialise($options)
111111
// Ensure a database type was selected.
112112
if (empty($options->db_type))
113113
{
114-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_TYPE'), 'notice');
114+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_TYPE'), 'warning');
115115

116116
return false;
117117
}
118118

119119
// Ensure that a hostname and user name were input.
120120
if (empty($options->db_host) || empty($options->db_user))
121121
{
122-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_DB_DETAILS'), 'notice');
122+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_DB_DETAILS'), 'warning');
123123

124124
return false;
125125
}
126126

127127
// Ensure that a database name was input.
128128
if (empty($options->db_name))
129129
{
130-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_EMPTY_NAME'), 'notice');
130+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_EMPTY_NAME'), 'warning');
131131

132132
return false;
133133
}
134134

135135
// Validate database table prefix.
136136
if (!preg_match('#^[a-zA-Z]+[a-zA-Z0-9_]*$#', $options->db_prefix))
137137
{
138-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_PREFIX_MSG'), 'notice');
138+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_PREFIX_MSG'), 'warning');
139139

140140
return false;
141141
}
142142

143143
// Validate length of database table prefix.
144144
if (strlen($options->db_prefix) > 15)
145145
{
146-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_TOO_LONG'), 'notice');
146+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_TOO_LONG'), 'warning');
147147

148148
return false;
149149
}
150150

151151
// Validate length of database name.
152152
if (strlen($options->db_name) > 64)
153153
{
154-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_TOO_LONG'), 'notice');
154+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_TOO_LONG'), 'warning');
155155

156156
return false;
157157
}
@@ -161,7 +161,7 @@ public function initialise($options)
161161
{
162162
if (strtolower($options->db_prefix) != $options->db_prefix)
163163
{
164-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_LOWERCASE'), 'notice');
164+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_LOWERCASE'), 'warning');
165165

166166
return false;
167167
}
@@ -182,7 +182,7 @@ public function initialise($options)
182182
}
183183
catch (RuntimeException $e)
184184
{
185-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
185+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'error');
186186

187187
return false;
188188
}
@@ -259,7 +259,7 @@ public function createDatabase($options)
259259
catch (RuntimeException $e)
260260
{
261261
// We did everything we could
262-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
262+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'error');
263263

264264
return false;
265265
}
@@ -272,29 +272,29 @@ public function createDatabase($options)
272272
catch (RuntimeException $e)
273273
{
274274
// We did everything we could
275-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
275+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'error');
276276

277277
return false;
278278
}
279279
}
280280
elseif ($type == 'postgresql' && strpos($e->getMessage(), 'Error connecting to PGSQL database') === 42)
281281
{
282-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
282+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'error');
283283

284284
return false;
285285
}
286286
// Anything getting into this part of the conditional either doesn't support manually creating the database or isn't that type of error
287287
else
288288
{
289-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
289+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'error');
290290

291291
return false;
292292
}
293293
}
294294

295295
if (!$db->isMinimumVersion())
296296
{
297-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db_version), 'notice');
297+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db_version), 'error');
298298

299299
return false;
300300
}
@@ -304,7 +304,7 @@ public function createDatabase($options)
304304
// @internal MySQL versions pre 5.1.6 forbid . / or \ or NULL.
305305
if ((preg_match('#[\\\/\.\0]#', $options->db_name)) && (!version_compare($db_version, '5.1.6', '>=')))
306306
{
307-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_NAME', $db_version), 'notice');
307+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_NAME', $db_version), 'error');
308308

309309
return false;
310310
}
@@ -313,15 +313,15 @@ public function createDatabase($options)
313313
// @internal Check for spaces in beginning or end of name.
314314
if (strlen(trim($options->db_name)) <> strlen($options->db_name))
315315
{
316-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_SPACES'), 'notice');
316+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_SPACES'), 'error');
317317

318318
return false;
319319
}
320320

321321
// @internal Check for asc(00) Null in name.
322322
if (strpos($options->db_name, chr(00)) !== false)
323323
{
324-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_CHAR'), 'notice');
324+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_CHAR'), 'error');
325325

326326
return false;
327327
}
@@ -337,7 +337,7 @@ public function createDatabase($options)
337337
}
338338
catch (RuntimeException $e)
339339
{
340-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
340+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'error');
341341

342342
return false;
343343
}
@@ -354,7 +354,7 @@ public function createDatabase($options)
354354
}
355355
catch (RuntimeException $e)
356356
{
357-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
357+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'error');
358358

359359
return false;
360360
}
@@ -378,7 +378,7 @@ public function createDatabase($options)
378378
}
379379
else
380380
{
381-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_CREATE', $options->db_name), 'notice');
381+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_CREATE', $options->db_name), 'error');
382382

383383
return false;
384384
}
@@ -503,7 +503,7 @@ public function createTables($options)
503503
// Check if the schema is a valid file
504504
if (!is_file($schema))
505505
{
506-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_ERROR_DB', JText::_('INSTL_DATABASE_NO_SCHEMA')), 'notice');
506+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_ERROR_DB', JText::_('INSTL_DATABASE_NO_SCHEMA')), 'error');
507507

508508
return false;
509509
}
@@ -533,7 +533,7 @@ public function createTables($options)
533533
}
534534
catch (RuntimeException $e)
535535
{
536-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
536+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
537537

538538
return false;
539539
}
@@ -559,7 +559,7 @@ public function createTables($options)
559559

560560
if (empty($files))
561561
{
562-
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_ERROR_INITIALISE_SCHEMA'), 'notice');
562+
JFactory::getApplication()->enqueueMessage(JText::_('INSTL_ERROR_INITIALISE_SCHEMA'), 'error');
563563

564564
return false;
565565
}
@@ -591,7 +591,7 @@ public function createTables($options)
591591
}
592592
catch (RuntimeException $e)
593593
{
594-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
594+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
595595

596596
return false;
597597
}
@@ -610,7 +610,7 @@ public function createTables($options)
610610
}
611611
catch (RuntimeException $e)
612612
{
613-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
613+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
614614
$return = false;
615615
}
616616

@@ -621,7 +621,7 @@ public function createTables($options)
621621
{
622622
if (!$installer->refreshManifestCache($extension->extension_id))
623623
{
624-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'notice');
624+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'error');
625625

626626
return false;
627627
}
@@ -686,7 +686,7 @@ public function createTables($options)
686686
}
687687
catch (RuntimeException $e)
688688
{
689-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
689+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
690690

691691
$return = false;
692692
}
@@ -738,7 +738,7 @@ public function installSampleData($options)
738738
{
739739
if (!file_exists($data))
740740
{
741-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_FILE_DOES_NOT_EXIST', $data), 'notice');
741+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_FILE_DOES_NOT_EXIST', $data), 'error');
742742

743743
return false;
744744
}
@@ -849,7 +849,7 @@ protected function updateUserIds($db)
849849
}
850850
catch (RuntimeException $e)
851851
{
852-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
852+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
853853
}
854854
}
855855
}
@@ -889,7 +889,7 @@ public function backupDatabase($db, $prefix)
889889
}
890890
catch (RuntimeException $e)
891891
{
892-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'notice');
892+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'error');
893893

894894
$return = false;
895895
}
@@ -901,7 +901,7 @@ public function backupDatabase($db, $prefix)
901901
}
902902
catch (RuntimeException $e)
903903
{
904-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'notice');
904+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'error');
905905

906906
$return = false;
907907
}
@@ -972,7 +972,7 @@ public function deleteDatabase($db, $prefix)
972972
}
973973
catch (RuntimeException $e)
974974
{
975-
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_DELETE', $e->getMessage()), 'notice');
975+
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_DELETE', $e->getMessage()), 'error');
976976

977977
$return = false;
978978
}
@@ -1000,7 +1000,7 @@ public function populateDatabase($db, $schema)
10001000
// Get the contents of the schema file.
10011001
if (!($buffer = file_get_contents($schema)))
10021002
{
1003-
JFactory::getApplication()->enqueueMessage($db->getErrorMsg(), 'notice');
1003+
JFactory::getApplication()->enqueueMessage($db->getErrorMsg(), 'error');
10041004

10051005
return false;
10061006
}
@@ -1042,7 +1042,7 @@ public function populateDatabase($db, $schema)
10421042
}
10431043
catch (RuntimeException $e)
10441044
{
1045-
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
1045+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
10461046

10471047
$return = false;
10481048
}

0 commit comments

Comments
 (0)