Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed May 7, 2016
2 parents e9ab705 + 55ca1fe commit e19edeb
Show file tree
Hide file tree
Showing 178 changed files with 22,820 additions and 16,426 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Expand Up @@ -128,3 +128,13 @@ Desktop.ini
/libraries/vendor/symfony/yaml/composer.json
/libraries/vendor/symfony/yaml/phpunit.xml.dist
/libraries/vendor/symfony/yaml/README.md
/libraries/vendor/simplepie/simplepie/demo
/libraries/vendor/simplepie/simplepie/tests
/libraries/vendor/simplepie/simplepie/README.markdown
/libraries/vendor/simplepie/simplepie/phpunit.xml.dist
/libraries/vendor/simplepie/simplepie/.gitignore
/libraries/vendor/simplepie/simplepie/.travis.yml
/libraries/vendor/simplepie/simplepie/compatibility_test
/libraries/vendor/simplepie/simplepie/build
/libraries/vendor/simplepie/simplepie/idn/ReadMe.txt
/libraries/vendor/simplepie/simplepie/composer.json
138 changes: 31 additions & 107 deletions administrator/components/com_admin/script.php
Expand Up @@ -36,7 +36,7 @@ public function update($installer)
$this->clearRadCache();
$this->updateAssets();
$this->clearStatsCache();
$this->convertTablesToUtf8mb4();
$this->convertTablesToUtf8mb4(true);
$this->cleanJoomlaCache();

// VERY IMPORTANT! THIS METHOD SHOULD BE CALLED LAST, SINCE IT COULD
Expand Down Expand Up @@ -240,8 +240,6 @@ protected function updateManifestCaches()
array('component', 'com_postinstall', '', 1),

// Libraries
array('library', 'phpmailer', '', 0),
array('library', 'simplepie', '', 0),
array('library', 'phputf8', '', 0),
array('library', 'joomla', '', 0),
array('library', 'idna_convert', '', 0),
Expand Down Expand Up @@ -341,6 +339,8 @@ protected function updateManifestCaches()
array('plugin', 'updatenotification', 'system', 0),
array('plugin', 'module', 'editors-xtd', 0),
array('plugin', 'stats', 'system', 0),
array('plugin', 'packageinstaller','installer',0),
array('plugin', 'urlfolderinstaller','installer', 0),

// Templates
array('template', 'beez3', '', 0),
Expand Down Expand Up @@ -1409,6 +1409,15 @@ public function deleteUnexistingFiles()
'/libraries/joomla/document/xml/xml.php',
'/administrator/components/com_installer/views/languages/tmpl/default_filter.php',
'/administrator/components/com_joomlaupdate/helpers/download.php',
// Joomla 3.6.0
'libraries/simplepie/README.txt',
'libraries/simplepie/simplepie.php',
'libraries/simplepie/LICENSE.txt',
'libraries/simplepie/idn/LICENCE',
'libraries/simplepie/idn/ReadMe.txt',
'libraries/simplepie/idn/idna_convert.class.php',
'libraries/simplepie/idn/npdata.ser',
'administrator/manifests/libraries/simplepie.xml',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down Expand Up @@ -1502,6 +1511,9 @@ public function deleteUnexistingFiles()
'/libraries/joomla/document/opensearch',
'/libraries/joomla/document/raw',
'/libraries/joomla/document/xml',
// Joomla 3.6
'libraries/simplepie/idn',
'libraries/simplepie',
);

jimport('joomla.filesystem.file');
Expand Down Expand Up @@ -1666,32 +1678,27 @@ public function flushSessions()
/**
* Converts the site's database tables to support UTF-8 Multibyte.
*
* Note that this is a modified of InstallerModelDatabase::convertTablesToUtf8mb4()
* that doesn't use JDatabase functions introduced in 3.5.0 which would cause errors
* when upgrading from a version before 3.5.0
* @param boolean $doDbFixMsg Flag if message to be shown to check db fix
*
* @return void
*
* @since 3.5
*/
private function convertTablesToUtf8mb4()
public function convertTablesToUtf8mb4($doDbFixMsg = false)
{
$db = JFactory::getDbo();

// This is only required for MySQL databases
$name = $db->getName();
$serverType = $db->getServerType();

if (stristr($name, 'mysql') === false)
if ($serverType != 'mysql')
{
return;
}

// Check if utf8mb4 is supported and set required conversion status
$utf8mb4Support = false;

if ($this->serverClaimsUtf8mb4Support($name))
// Set required conversion status
if ($db->hasUTF8mb4Support())
{
$utf8mb4Support = true;
$converted = 2;
}
else
Expand All @@ -1710,7 +1717,14 @@ private function convertTablesToUtf8mb4()
}
catch (Exception $e)
{
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'), 'error');
// Render the error message from the Exception object
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');

if ($doDbFixMsg)
{
// Show an error message telling to check database problems
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'), 'error');
}

return;
}
Expand Down Expand Up @@ -1757,15 +1771,9 @@ private function convertTablesToUtf8mb4()
{
foreach ($queries2 as $query2)
{
// Downgrade the query if utf8mb4 isn't supported
if (!$utf8mb4Support)
{
$query2 = $this->convertUtf8mb4QueryToUtf8($query2);
}

try
{
$db->setQuery($query2)->execute();
$db->setQuery($db->convertUtf8mb4QueryToUtf8($query2))->execute();
}
catch (Exception $e)
{
Expand All @@ -1778,8 +1786,7 @@ private function convertTablesToUtf8mb4()
}
}

// Show if there was some error
if ($converted == 0)
if ($doDbFixMsg && $converted == 0)
{
// Show an error message telling to check database problems
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'), 'error');
Expand All @@ -1790,89 +1797,6 @@ private function convertTablesToUtf8mb4()
. ' SET ' . $db->quoteName('converted') . ' = ' . $converted . ';')->execute();
}

/**
* Does the database server claim to have support for UTF-8 Multibyte (utf8mb4) collation?
*
* This is a modified version of the function in JDatabase::serverClaimsUtf8mb4Support() - it is
* duplicated here for people upgrading from a version lower than 3.5.0 through extension manager
* which will still have the old database driver loaded at this point.
*
* @param string $format The type of database connection.
*
* @return boolean
*
* @since 3.5.0
*/
private function serverClaimsUtf8mb4Support($format)
{
$db = JFactory::getDbo();

switch ($format)
{
case 'mysql':
$client_version = mysql_get_client_info();
$server_version = $db->getVersion();
break;
case 'mysqli':
$client_version = mysqli_get_client_info();
$server_version = $db->getVersion();
break;
case 'pdomysql':
$client_version = $db->getOption(PDO::ATTR_CLIENT_VERSION);
$server_version = $db->getOption(PDO::ATTR_SERVER_VERSION);
break;
default:
$client_version = false;
$server_version = false;
}

if ($client_version && version_compare($server_version, '5.5.3', '>='))
{
if (strpos($client_version, 'mysqlnd') !== false)
{
$client_version = preg_replace('/^\D+([\d.]+).*/', '$1', $client_version);

return version_compare($client_version, '5.0.9', '>=');
}
else
{
return version_compare($client_version, '5.5.3', '>=');
}
}

return false;
}

/**
* Downgrade a CREATE TABLE or ALTER TABLE query from utf8mb4 (UTF-8 Multibyte) to plain utf8. Used when the server
* doesn't support UTF-8 Multibyte.
*
* This is a modified version of the function in JDatabase::convertUtf8mb4QueryToUtf8() - it is duplicated here for
* people upgrading from a version lower than 3.5.0 through extension manager which will still have the old database
* driver loaded at this point. This is missing the check for utf8mb4 in JDatabaseDriver we make this check in the
* updater elsewhere.
*
* @param string $query The query to convert
*
* @return string The converted query
*
* @since 3.5
*/
private function convertUtf8mb4QueryToUtf8($query)
{
// If it's not an ALTER TABLE or CREATE TABLE command there's nothing to convert
$beginningOfQuery = substr($query, 0, 12);
$beginningOfQuery = strtoupper($beginningOfQuery);

if (!in_array($beginningOfQuery, array('ALTER TABLE ', 'CREATE TABLE')))
{
return $query;
}

// Replace utf8mb4 with utf8
return str_replace('utf8mb4', 'utf8', $query);
}

/**
* This method clean the Joomla Cache using the method `clean` from the com_cache model
*
Expand Down
@@ -1 +1 @@
UPDATE `#__menu` SET `title` = 'com_contact_contacts' WHERE `id` = 8;
UPDATE `#__menu` SET `title` = 'com_contact_contacts' WHERE `client_id` = 1 AND `level` = 2 AND `title` = 'com_contact';
@@ -0,0 +1,5 @@
--
-- Add ACL check for to #__menu_types
--

ALTER TABLE `#__menu_types` ADD COLUMN `asset_id` INT(11) NOT NULL AFTER `id`;
@@ -0,0 +1 @@
DELETE FROM `#__extensions` WHERE `type` = 'library' AND `element` = 'simplepie';
@@ -1 +1 @@
UPDATE "#__menu" SET "title" = 'com_contact_contacts' WHERE "id" = 8;
UPDATE "#__menu" SET "title" = 'com_contact_contacts' WHERE "client_id" = 1 AND "level" = 2 AND "title" = 'com_contact';
@@ -0,0 +1,5 @@
--
-- Add ACL check for to #__menu_types
--

ALTER TABLE "#__menu_types" ADD COLUMN "asset_id" bigint DEFAULT 0 NOT NULL;
@@ -0,0 +1 @@
DELETE FROM "#__extensions" WHERE "type" = "library" AND "element" = "simplepie";
@@ -1 +1 @@
UPDATE [#__menu] SET [title] = 'com_contact_contacts' WHERE [id] = 8;
UPDATE [#__menu] SET [title] = 'com_contact_contacts' WHERE [client_id] = 1 AND [level] = 2 AND [title] = 'com_contact';
@@ -0,0 +1,5 @@
--
-- Add ACL check for to #__menu_types
--

ALTER TABLE [#__menu_types] ADD [asset_id] [bigint] NOT NULL DEFAULT 0;
@@ -0,0 +1 @@
DELETE FROM [#__extensions] WHERE [type] = "library" AND [element] = "simplepie";
38 changes: 38 additions & 0 deletions administrator/components/com_cache/controller.php
Expand Up @@ -96,6 +96,44 @@ public function delete()
$this->setRedirect('index.php?option=com_cache');
}

/**
* Method to delete all cache groups.
*
* @return void
*
* @since 3.6.0
*/
public function deleteAll()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

$app = JFactory::getApplication();
$model = $this->getModel('cache');
$data = $model->getCache()->getAll();
$allCleared = true;

foreach ($data as $cache)
{
if ((int) $model->clean($cache->group) !== 1)
{
$app->enqueueMessage(JText::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', $cache->group), 'error');
$allCleared = false;
}
}

if ($allCleared)
{
$app->enqueueMessage(JText::_('COM_CACHE_MSG_ALL_CACHE_GROUPS_CLEARED'), 'message');
}
else
{
$app->enqueueMessage(JText::_('COM_CACHE_MSG_SOME_CACHE_GROUPS_CLEARED'), 'warning');
}

$this->setRedirect('index.php?option=com_cache&view=cache');
}

/**
* Purge the cache.
*
Expand Down
Expand Up @@ -77,6 +77,7 @@ protected function addToolbar()
}

JToolbarHelper::custom('delete', 'delete.png', 'delete_f2.png', 'JTOOLBAR_DELETE', true);
JToolbarHelper::custom('deleteAll', 'delete.png', 'delete_f2.png', 'JTOOLBAR_DELETE_ALL', false);
JToolbarHelper::divider();

if (JFactory::getUser()->authorise('core.admin', 'com_cache'))
Expand Down
Expand Up @@ -86,7 +86,7 @@ protected function getInput()
$html[] = ' <select'
. ' name="' . $this->name . '[' . $group->value . '][filter_type]"'
. ' id="' . $this->id . $group->value . '_filter_type"'
. ' class="novalidate" data-chosen="true"'
. ' class="novalidate"'
. '>';
$html[] = ' <option value="BL"' . ($group_filter['filter_type'] == 'BL' ? ' selected="selected"' : '') . '>'
. JText::_('COM_CONFIG_FIELD_FILTERS_DEFAULT_BLACK_LIST') . '</option>';
Expand Down
Expand Up @@ -917,6 +917,8 @@
<option value="30">J30</option>
<option value="50">J50</option>
<option value="100">J100</option>
<option value="200">J200</option>
<option value="500">J500</option>
</field>

<field
Expand Down

0 comments on commit e19edeb

Please sign in to comment.