Source for file database.php
Documentation is available at database.php
* @package Joomla.Administrator
* @subpackage com_installer
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* @subpackage com_installer
protected $_context =
'com_installer.discover';
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
protected function populateState($ordering =
null, $direction =
null)
$this->setState('message', $app->getUserState('com_installer.message'));
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
parent::populateState('name', 'asc');
* Fixes database problems
$installer->deleteUnexistingFiles();
* Gets the changeset object
* @return JSchemaChangeset
catch
(RuntimeException $e)
* Method to get a JPagination object for the data set.
* Get version from #__schemas table
* @return mixed the return value from the query, or null if the query fails
$query =
$db->getQuery(true)
->from($db->quoteName('#__schemas'))
->where('extension_id = 700');
$result =
$db->loadResult();
* Fix schema version if wrong
* @param JSchemaChangeSet $changeSet Schema change set
* @return mixed string schema version if success, false if fail
// Get correct schema version -- last file in array
$schema =
$changeSet->getSchema();
// Check value. If ok, don't do update
$query =
$db->getQuery(true)
->delete($db->quoteName('#__schemas'))
->where($db->quoteName('extension_id') .
' = 700');
->insert($db->quoteName('#__schemas'))
->set($db->quoteName('extension_id') .
'= 700')
->set($db->quoteName('version_id') .
'= ' .
$db->quote($schema));
* Get current version from #__extensions table
* @return mixed version if successful, false if fail
$cache =
new JRegistry($table->manifest_cache);
return $cache->get('version');
* Fix Joomla version in #__extensions table if wrong (doesn't equal JVersion short version)
* @return mixed string update version if success, false if fail
$cache =
new JRegistry($table->manifest_cache);
$updateVersion =
$cache->get('version');
if ($updateVersion ==
$cmsVersion->getShortVersion())
$cache->set('version', $cmsVersion->getShortVersion());
$table->manifest_cache =
$cache->toString();
return $cmsVersion->getShortVersion();
* Check if com_config parameters are blank.
* @return string default text filters (if any)
$table->load($table->find(array('name' =>
'com_config')));
* Check if com_config parameters are blank. If so, populate with com_content text filters.
* @return mixed boolean true if params are updated, null otherwise
$table->load($table->find(array('name' =>
'com_config')));
// Check for empty $config and non-empty content filters
// Get filters from com_content and store if you find them
if ($contentParams->get('filters'))
$newParams->set('filters', $contentParams->get('filters'));
$table->params = (string)
$newParams;
Documentation generated on Tue, 19 Nov 2013 14:57:52 +0100 by phpDocumentor 1.4.3