diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini
index aaf152d667b46..eef32fb4dc09f 100644
--- a/administrator/language/en-GB/en-GB.ini
+++ b/administrator/language/en-GB/en-GB.ini
@@ -393,7 +393,7 @@ JGLOBAL_KEEP_TYPING="Keep typing ..."
JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Language pack does not match this Joomla! version. Some strings may be missing."
JGLOBAL_LEAST_HITS="Least Hits"
JGLOBAL_LEFT="Left"
-JGLOBAL_LINK_AUTHOR_DESC="If set to Yes, the Name of the article's Author will be linked to its contact page. You must create a contact linked to the author's user record, and the "Content - Contact" plugin must be enabled, for this to be in effect. This is a global setting but can be changed at the Category, Menu and Article levels."
+JGLOBAL_LINK_AUTHOR_DESC="If set to Yes, the Name of the article's Author will be linked to its contact page. You must create a contact linked to the author's user record, and the "Content - Contact" plugin must be enabled, for this to be in effect."
JGLOBAL_LINK_AUTHOR_LABEL="Link Author"
JGLOBAL_LINK_CATEGORY_DESC="If set to Yes, and if Show Category is set to 'Show', the Category Title will link to a layout showing articles in that Category."
JGLOBAL_LINK_CATEGORY_LABEL="Link Category"
@@ -481,7 +481,7 @@ JGLOBAL_SELECTION_ALL="Select All"
JGLOBAL_SELECTION_INVERT="Toggle Selection"
JGLOBAL_SELECTION_INVERT_ALL="Toggle All Selections"
JGLOBAL_SELECTION_NONE="Clear Selection"
-JGLOBAL_SHOW_AUTHOR_DESC="If set to Show, the Name of the article's Author will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels."
+JGLOBAL_SHOW_AUTHOR_DESC="If set to Show, the Name of the article's Author will be displayed."
JGLOBAL_SHOW_AUTHOR_LABEL="Show Author"
JGLOBAL_SHOW_CATEGORY_DESC="If set to Show, the title of the article’s category will show."
JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC="Show or hide the description of the selected Category."
@@ -508,13 +508,13 @@ JGLOBAL_SHOW_FEED_LINK_LABEL="Show Feed Link"
JGLOBAL_SHOW_FULL_DESCRIPTION="Show full description ..."
JGLOBAL_SHOW_HEADINGS_DESC="Show or hide the headings in list layouts."
JGLOBAL_SHOW_HEADINGS_LABEL="Table Headings"
-JGLOBAL_SHOW_HITS_DESC="If set to Show, the number of Hits on a particular Article will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels."
+JGLOBAL_SHOW_HITS_DESC="If set to Show, the number of Hits on a particular Article will be displayed."
JGLOBAL_SHOW_HITS_LABEL="Show Hits"
JGLOBAL_SHOW_ICONS_DESC="Print and email will utilise icons or text."
JGLOBAL_SHOW_ICONS_LABEL="Show Icons"
JGLOBAL_SHOW_INTRO_DESC="If set to Show, the Intro Text of the article will show when you drill down to the article. If set to Hide, only the part of the article after the "Read More" break will show."
JGLOBAL_SHOW_INTRO_LABEL="Show Intro Text"
-JGLOBAL_SHOW_MODIFY_DATE_DESC="If set to Show, the date and time an Article was last modified will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels."
+JGLOBAL_SHOW_MODIFY_DATE_DESC="If set to Show, the date and time an Article was last modified will be displayed."
JGLOBAL_SHOW_MODIFY_DATE_LABEL="Show Modify Date"
JGLOBAL_SHOW_NAVIGATION_DESC="If set to Show, shows a navigation link (Next, Previous) between articles."
JGLOBAL_SHOW_NAVIGATION_LABEL="Show Navigation"
diff --git a/installation/model/configuration.php b/installation/model/configuration.php
index 118b1e714c83e..450ef745e3835 100644
--- a/installation/model/configuration.php
+++ b/installation/model/configuration.php
@@ -10,6 +10,7 @@
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
+use Joomla\Utilities\ArrayHelper;
/**
* Configuration setup model for the Joomla Core Installer.
@@ -30,16 +31,16 @@ class InstallationModelConfiguration extends JModelBase
public function setup($options)
{
// Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ $options = ArrayHelper::toObject($options);
// Attempt to create the root user.
- if (!$this->_createConfiguration($options))
+ if (!$this->createConfiguration($options))
{
return false;
}
// Attempt to create the root user.
- if (!$this->_createRootUser($options))
+ if (!$this->createRootUser($options))
{
return false;
}
@@ -56,7 +57,7 @@ public function setup($options)
*
* @since 3.1
*/
- public function _createConfiguration($options)
+ public function createConfiguration($options)
{
// Create a new registry to build the configuration options.
$registry = new Registry;
@@ -183,6 +184,9 @@ public function _createConfiguration($options)
$useFTP = false;
}
+ // Get the session
+ $session = JFactory::getSession();
+
if ($useFTP == true)
{
// Connect the FTP client.
@@ -196,7 +200,6 @@ public function _createConfiguration($options)
if (!$ftp->write($file, $buffer))
{
// Set the config string to the session.
- $session = JFactory::getSession();
$session->set('setup.config', $buffer);
}
@@ -207,13 +210,11 @@ public function _createConfiguration($options)
if ($canWrite)
{
file_put_contents($path, $buffer);
- $session = JFactory::getSession();
$session->set('setup.config', null);
}
else
{
// Set the config string to the session.
- $session = JFactory::getSession();
$session->set('setup.config', $buffer);
}
}
@@ -230,12 +231,8 @@ public function _createConfiguration($options)
*
* @since 3.1
*/
- private function _createRootUser($options)
+ private function createRootUser($options)
{
- // Get the application
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
// Get a database object.
try
{
@@ -250,7 +247,7 @@ private function _createRootUser($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage(JText::sprintf('INSTL_ERROR_CONNECT_DB', $e->getMessage()), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_ERROR_CONNECT_DB', $e->getMessage()), 'notice');
return false;
}
@@ -325,7 +322,7 @@ private function _createRootUser($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
return false;
}
@@ -361,7 +358,7 @@ private function _createRootUser($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
return false;
}
diff --git a/installation/model/database.php b/installation/model/database.php
index a7fea7473faf5..1ea6aeecb0b36 100644
--- a/installation/model/database.php
+++ b/installation/model/database.php
@@ -9,6 +9,8 @@
defined('_JEXEC') or die;
+use Joomla\Utilities\ArrayHelper;
+
/**
* Database configuration model for the Joomla Core Installer.
*
@@ -33,7 +35,7 @@ class InstallationModelDatabase extends JModelBase
*/
protected static function generateRandUserId()
{
- $session = JFactory::getSession();
+ $session = JFactory::getSession();
$randUserId = $session->get('randUserId');
if (empty($randUserId))
@@ -56,8 +58,8 @@ protected static function generateRandUserId()
public static function resetRandUserId()
{
self::$userId = 0;
- $session = JFactory::getSession();
- $session->set('randUserId', self::$userId);
+
+ JFactory::getSession()->set('randUserId', self::$userId);
}
/**
@@ -88,12 +90,8 @@ public static function getUserId()
*/
public function initialise($options)
{
- // Get the application.
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
- // Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ // Get the options as a object for easier handling.
+ $options = ArrayHelper::toObject($options);
// Load the back-end language files so that the DB error messages work.
$lang = JFactory::getLanguage();
@@ -113,7 +111,7 @@ public function initialise($options)
// Ensure a database type was selected.
if (empty($options->db_type))
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_TYPE'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_TYPE'), 'notice');
return false;
}
@@ -121,7 +119,7 @@ public function initialise($options)
// Ensure that a hostname and user name were input.
if (empty($options->db_host) || empty($options->db_user))
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_DB_DETAILS'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_INVALID_DB_DETAILS'), 'notice');
return false;
}
@@ -129,7 +127,7 @@ public function initialise($options)
// Ensure that a database name was input.
if (empty($options->db_name))
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_EMPTY_NAME'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_EMPTY_NAME'), 'notice');
return false;
}
@@ -137,7 +135,7 @@ public function initialise($options)
// Validate database table prefix.
if (!preg_match('#^[a-zA-Z]+[a-zA-Z0-9_]*$#', $options->db_prefix))
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_PREFIX_MSG'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_PREFIX_MSG'), 'notice');
return false;
}
@@ -145,7 +143,7 @@ public function initialise($options)
// Validate length of database table prefix.
if (strlen($options->db_prefix) > 15)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_FIX_TOO_LONG'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_TOO_LONG'), 'notice');
return false;
}
@@ -153,7 +151,7 @@ public function initialise($options)
// Validate length of database name.
if (strlen($options->db_name) > 64)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_NAME_TOO_LONG'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_TOO_LONG'), 'notice');
return false;
}
@@ -163,7 +161,8 @@ public function initialise($options)
{
if (strtolower($options->db_prefix) != $options->db_prefix)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_FIX_LOWERCASE'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_FIX_LOWERCASE'), 'notice');
+
return false;
}
}
@@ -172,12 +171,18 @@ public function initialise($options)
try
{
return InstallationHelperDatabase::getDbo(
- $options->db_type, $options->db_host, $options->db_user, $options->db_pass, $options->db_name, $options->db_prefix, $options->db_select
+ $options->db_type,
+ $options->db_host,
+ $options->db_user,
+ $options->db_pass,
+ $options->db_name,
+ $options->db_prefix,
+ $options->db_select
);
}
catch (RuntimeException $e)
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
return false;
}
@@ -194,10 +199,6 @@ public function initialise($options)
*/
public function createDatabase($options)
{
- // Get the application.
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
// Disable autoselect database before it's created.
$tmpSelect = true;
@@ -213,8 +214,8 @@ public function createDatabase($options)
return false;
}
- // Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ // Get the options as a object for easier handling.
+ $options = ArrayHelper::toObject($options);
// Check database version.
$type = $options->db_type;
@@ -240,12 +241,12 @@ public function createDatabase($options)
* in order to trick the connection into creating the database
*/
$altDBoptions = array(
- 'driver' => $options->db_type,
- 'host' => $options->db_host,
- 'user' => $options->db_user,
+ 'driver' => $options->db_type,
+ 'host' => $options->db_host,
+ 'user' => $options->db_user,
'password' => $options->db_pass,
- 'prefix' => $options->db_prefix,
- 'select' => $options->db_select
+ 'prefix' => $options->db_prefix,
+ 'select' => $options->db_select,
);
$altDB = JDatabaseDriver::getInstance($altDBoptions);
@@ -258,7 +259,7 @@ public function createDatabase($options)
catch (RuntimeException $e)
{
// We did everything we could
- $app->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
return false;
}
@@ -271,21 +272,21 @@ public function createDatabase($options)
catch (RuntimeException $e)
{
// We did everything we could
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
return false;
}
}
elseif ($type == 'postgresql' && strpos($e->getMessage(), 'Error connecting to PGSQL database') === 42)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_COULD_NOT_CREATE_DATABASE'), 'notice');
return false;
}
// Anything getting into this part of the conditional either doesn't support manually creating the database or isn't that type of error
else
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'notice');
return false;
}
@@ -293,7 +294,7 @@ public function createDatabase($options)
if (!$db->isMinimumVersion())
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db_version), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db_version), 'notice');
return false;
}
@@ -303,7 +304,7 @@ public function createDatabase($options)
// @internal MySQL versions pre 5.1.6 forbid . / or \ or NULL.
if ((preg_match('#[\\\/\.\0]#', $options->db_name)) && (!version_compare($db_version, '5.1.6', '>=')))
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_NAME', $db_version), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_INVALID_NAME', $db_version), 'notice');
return false;
}
@@ -312,7 +313,7 @@ public function createDatabase($options)
// @internal Check for spaces in beginning or end of name.
if (strlen(trim($options->db_name)) <> strlen($options->db_name))
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_SPACES'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_SPACES'), 'notice');
return false;
}
@@ -320,7 +321,7 @@ public function createDatabase($options)
// @internal Check for asc(00) Null in name.
if (strpos($options->db_name, chr(00)) !== false)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_CHAR'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_NAME_INVALID_CHAR'), 'notice');
return false;
}
@@ -336,7 +337,7 @@ public function createDatabase($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
return false;
}
@@ -353,7 +354,7 @@ public function createDatabase($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_DATABASE_ERROR_POSTGRESQL_QUERY'), 'notice');
return false;
}
@@ -377,7 +378,7 @@ public function createDatabase($options)
}
else
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_CREATE', $options->db_name), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_CREATE', $options->db_name), 'notice');
return false;
}
@@ -391,6 +392,7 @@ public function createDatabase($options)
if (isset($i['1']) && $i['1'] == '*')
{
unset($options[$i]);
+
break;
}
}
@@ -400,8 +402,7 @@ public function createDatabase($options)
// Restore autoselect value after database creation.
$options['db_select'] = $tmpSelect;
- $session = JFactory::getSession();
- $session->set('setup.options', $options);
+ JFactory::getSession()->set('setup.options', $options);
return true;
}
@@ -427,8 +428,8 @@ public function handleOldDatabase($options)
return false;
}
- // Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ // Get the options as a object for easier handling.
+ $options = ArrayHelper::toObject($options);
// Set the character set to UTF-8 for pre-existing databases.
$this->setDatabaseCharset($db, $options->db_name);
@@ -466,10 +467,6 @@ public function handleOldDatabase($options)
*/
public function createTables($options)
{
- // Get the application.
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
if (!isset($options['db_created']) || !$options['db_created'])
{
return $this->createDatabase($options);
@@ -480,8 +477,8 @@ public function createTables($options)
return false;
}
- // Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ // Get the options as a object for easier handling.
+ $options = ArrayHelper::toObject($options);
// Check database type.
$type = $options->db_type;
@@ -506,7 +503,7 @@ public function createTables($options)
// Check if the schema is a valid file
if (!is_file($schema))
{
- $app->enqueueMessage(JText::sprintf('INSTL_ERROR_DB', JText::_('INSTL_DATABASE_NO_SCHEMA')), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_ERROR_DB', JText::_('INSTL_DATABASE_NO_SCHEMA')), 'notice');
return false;
}
@@ -536,7 +533,7 @@ public function createTables($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
return false;
}
@@ -562,7 +559,7 @@ public function createTables($options)
if (empty($files))
{
- $app->enqueueMessage(JText::_('INSTL_ERROR_INITIALISE_SCHEMA'), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::_('INSTL_ERROR_INITIALISE_SCHEMA'), 'notice');
return false;
}
@@ -594,7 +591,7 @@ public function createTables($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
return false;
}
@@ -613,7 +610,7 @@ public function createTables($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
$return = false;
}
@@ -624,7 +621,7 @@ public function createTables($options)
{
if (!$installer->refreshManifestCache($extension->extension_id))
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'notice');
return false;
}
@@ -653,8 +650,7 @@ public function createTables($options)
}
// Handle default backend language setting. This feature is available for localized versions of Joomla.
- $app = JFactory::getApplication();
- $languages = $app->getLocaliseAdmin($db);
+ $languages = JFactory::getApplication()->getLocaliseAdmin($db);
if (in_array($options->language, $languages['admin']) || in_array($options->language, $languages['site']))
{
@@ -663,7 +659,7 @@ public function createTables($options)
// Set default administrator/site language to sample data values.
$params['administrator'] = 'en-GB';
- $params['site'] = 'en-GB';
+ $params['site'] = 'en-GB';
if (in_array($options->language, $languages['admin']))
{
@@ -690,7 +686,8 @@ public function createTables($options)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
+
$return = false;
}
}
@@ -709,10 +706,6 @@ public function createTables($options)
*/
public function installSampleData($options)
{
- // Get the application.
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
if (!isset($options['db_created']) || !$options['db_created'])
{
return $this->createDatabase($options);
@@ -723,8 +716,8 @@ public function installSampleData($options)
return false;
}
- // Get the options as an object for easier handling.
- $options = JArrayHelper::toObject($options);
+ // Get the options as a object for easier handling.
+ $options = ArrayHelper::toObject($options);
// Build the path to the sample data file.
$type = $options->db_type;
@@ -745,7 +738,7 @@ public function installSampleData($options)
{
if (!file_exists($data))
{
- $app->enqueueMessage(JText::sprintf('INSTL_DATABASE_FILE_DOES_NOT_EXIST', $data), 'notice');
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_FILE_DOES_NOT_EXIST', $data), 'notice');
return false;
}
@@ -844,11 +837,20 @@ protected function updateUserIds($db)
foreach ($updates_array as $table => $field)
{
- $db->setQuery(
- 'UPDATE ' . $db->quoteName('#__' . $table) .
- ' SET ' . $db->quoteName($field) . ' = ' . $db->quote($userId)
- );
- $db->execute();
+ $query = $db->getQuery(true)
+ ->update($db->quoteName('#__' . $table))
+ ->set($db->quoteName($field) . ' = ' . $db->quote($userId));
+
+ $db->setQuery($query);
+
+ try
+ {
+ $db->execute();
+ }
+ catch (RuntimeException $e)
+ {
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
+ }
}
}
@@ -888,6 +890,7 @@ public function backupDatabase($db, $prefix)
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'notice');
+
$return = false;
}
@@ -899,6 +902,7 @@ public function backupDatabase($db, $prefix)
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_BACKINGUP', $e->getMessage()), 'notice');
+
$return = false;
}
}
@@ -969,6 +973,7 @@ public function deleteDatabase($db, $prefix)
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('INSTL_DATABASE_ERROR_DELETE', $e->getMessage()), 'notice');
+
$return = false;
}
}
@@ -990,22 +995,18 @@ public function deleteDatabase($db, $prefix)
*/
public function populateDatabase($db, $schema)
{
- // Get the application
- /* @var InstallationApplicationWeb $app */
- $app = JFactory::getApplication();
-
$return = true;
// Get the contents of the schema file.
if (!($buffer = file_get_contents($schema)))
{
- $app->enqueueMessage($db->getErrorMsg(), 'notice');
+ JFactory::getApplication()->enqueueMessage($db->getErrorMsg(), 'notice');
return false;
}
// Get an array of queries from the schema and process them.
- $queries = $this->_splitQueries($buffer);
+ $queries = $this->splitQueries($buffer);
foreach ($queries as $query)
{
@@ -1041,7 +1042,8 @@ public function populateDatabase($db, $schema)
}
catch (RuntimeException $e)
{
- $app->enqueueMessage($e->getMessage(), 'notice');
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'notice');
+
$return = false;
}
}
@@ -1086,10 +1088,10 @@ public function setDatabaseCharset($db, $name)
*
* @since 3.1
*/
- protected function _splitQueries($query)
+ protected function splitQueries($query)
{
- $buffer = array();
- $queries = array();
+ $buffer = array();
+ $queries = array();
$in_string = false;
// Trim any whitespace.
@@ -1113,8 +1115,8 @@ protected function _splitQueries($query)
if ($query[$i] == ";" && !$in_string)
{
$queries[] = substr($query, 0, $i);
- $query = substr($query, $i + 1);
- $i = 0;
+ $query = substr($query, $i + 1);
+ $i = 0;
}
if ($in_string && ($query[$i] == $in_string) && $buffer[1] != "\\")
diff --git a/installation/model/forms/database.xml b/installation/model/forms/database.xml
index ecb67af45b1d1..629222bde5f60 100644
--- a/installation/model/forms/database.xml
+++ b/installation/model/forms/database.xml
@@ -2,30 +2,48 @@