Skip to content

Commit

Permalink
Merge branch 'staging' into solves-8109
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed May 8, 2016
2 parents e59c551 + c14cd55 commit f2f12a2
Show file tree
Hide file tree
Showing 1,016 changed files with 40,742 additions and 29,990 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Expand Up @@ -64,6 +64,8 @@ Desktop.ini
/libraries/vendor/ircmaxell/password-compat/phpunit.xml.dist
/libraries/vendor/ircmaxell/password-compat/README.md
/libraries/vendor/ircmaxell/password-compat/version-test.php
/libraries/vendor/joomla/*/.gitignore
/libraries/vendor/joomla/*/.gitmodules
/libraries/vendor/joomla/*/docs
/libraries/vendor/joomla/*/Tests
/libraries/vendor/joomla/*/vendor
Expand Down Expand Up @@ -126,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
19 changes: 17 additions & 2 deletions .travis.yml
Expand Up @@ -11,6 +11,7 @@ env:
- INSTALL_REDIS="yes"

matrix:
fast_finish: true
include:
- php: 5.3
env: INSTALL_APC="yes"
Expand All @@ -23,6 +24,18 @@ matrix:
- php: 7.0
env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved
- php: hhvm
sudo: true
dist: trusty
group: edge # until the next update
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- mysql
- postgresql
env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled items that currently do not work in travis-ci hhvm
allow_failures:
- php: hhvm
Expand All @@ -36,8 +49,10 @@ before_script:
# Make sure all dev dependencies are installed
- composer install
# Set up databases for testing
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/schema/mysql.sql
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql -e 'create database joomla_ut;'; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql joomla_ut < tests/unit/schema/mysql.sql; fi
- if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root -e 'create database joomla_ut;'; fi
- if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root joomla_ut < tests/unit/schema/mysql.sql; fi
- psql -c 'create database joomla_ut;' -U postgres
- psql -d joomla_ut -a -f tests/unit/schema/postgresql.sql
# Set up Apache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,7 +10,7 @@ What is this?
---------------------
* This is a Joomla! 3.x installation/upgrade package.
* Joomla's [Official website](https://www.joomla.org).
* Joomla! 3.5 [version history](https://docs.joomla.org/Joomla_3.5_version_history).
* Joomla! 3.6 [version history](https://docs.joomla.org/Joomla_3.6_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/master).

What is Joomla?
Expand Down
2 changes: 1 addition & 1 deletion README.txt
@@ -1,7 +1,7 @@
1- What is this?
* This is a Joomla! installation/upgrade package to version 3.x
* Joomla! Official site: https://www.joomla.org
* Joomla! 3.5 version history - https://docs.joomla.org/Joomla_3.5_version_history
* Joomla! 3.6 version history - https://docs.joomla.org/Joomla_3.6_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master

2- What is Joomla?
Expand Down
6 changes: 4 additions & 2 deletions administrator/components/com_admin/models/sysinfo.php
Expand Up @@ -251,6 +251,7 @@ public function &getPhpSettings()
'zip' => function_exists('zip_open') && function_exists('zip_read'),
'mbstring' => extension_loaded('mbstring'),
'iconv' => function_exists('iconv'),
'mcrypt' => extension_loaded('mcrypt'),
'max_input_vars' => ini_get('max_input_vars'),
);

Expand Down Expand Up @@ -463,10 +464,11 @@ public function getExtensions()
$installed[$extension->name] = array(
'name' => $extension->name,
'type' => $extension->type,
'state' => $extension->enabled ? JText::_('JENABLED') : JText::_('JDISABLED'),
'author' => 'unknown',
'version' => 'unknown',
'creationDate' => 'unknown',
'authorUrl' => 'unknown'
'authorUrl' => 'unknown',
);

$manifest = json_decode($extension->manifest_cache);
Expand All @@ -480,7 +482,7 @@ public function getExtensions()
'author' => $manifest->author,
'version' => $manifest->version,
'creationDate' => $manifest->creationDate,
'authorUrl' => $manifest->authorUrl
'authorUrl' => $manifest->authorUrl,
);

$installed[$extension->name] = array_merge($installed[$extension->name], $extraData);
Expand Down
145 changes: 36 additions & 109 deletions administrator/components/com_admin/script.php
Expand Up @@ -19,7 +19,7 @@ class JoomlaInstallerScript
/**
* Method to update Joomla!
*
* @param JInstallerFile $installer The class calling this method
* @param JInstallerAdapterFile $installer The class calling this method
*
* @return void
*/
Expand All @@ -31,13 +31,12 @@ public function update($installer)
JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update');

$this->deleteUnexistingFiles();
$this->updateManifestCaches();
$this->updateDatabase();
$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 @@ -236,13 +235,13 @@ protected function updateManifestCaches()
array('component', 'com_config', '', 1),
array('component', 'com_redirect', '', 1),
array('component', 'com_users', '', 1),
array('component', 'com_finder', '', 1),
array('component', 'com_tags', '', 1),
array('component', 'com_contenthistory', '', 1),
array('component', 'com_postinstall', '', 1),
array('component', 'com_joomlaupdate', '', 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 @@ -342,6 +341,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 @@ -1408,6 +1409,17 @@ public function deleteUnexistingFiles()
'/libraries/joomla/document/opensearch/opensearch.php',
'/libraries/joomla/document/raw/raw.php',
'/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 @@ -1501,6 +1513,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 @@ -1665,32 +1680,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 @@ -1709,7 +1719,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 @@ -1756,15 +1773,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 @@ -1777,8 +1788,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 @@ -1789,89 +1799,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';
Expand Up @@ -3,4 +3,5 @@
-- to force a new conversion when updating from version 3.5.0
--

UPDATE `#__utf8_conversion` SET converted = 0 WHERE (SELECT COUNT(*) FROM `#__extensions` WHERE `extension_id`=700 AND `manifest_cache` LIKE '%"version":"3.5.0"%') = 1;
UPDATE `#__utf8_conversion` SET `converted` = 0
WHERE (SELECT COUNT(*) FROM `#__schemas` WHERE `extension_id`=700 AND `version_id` LIKE '3.5.0%') = 1;
@@ -0,0 +1,4 @@
UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/core/list.xml' WHERE `name` = 'Joomla! Core' AND `type` = 'collection';
UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/jed/list.xml' WHERE `name` = 'Joomla! Extension Directory' AND `type` = 'collection';
UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/language/translationlist_3.xml' WHERE `name` = 'Accredited Joomla! Translations' AND `type` = 'collection';
UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml' WHERE `name` = 'Joomla! Update Component Update Site' AND `type` = 'extension';
@@ -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,4 @@
UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/core/list.xml' WHERE "name" = 'Joomla! Core' AND "type" = 'collection';
UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/jed/list.xml' WHERE "name" = 'Joomla! Extension Directory' AND "type" = 'collection';
UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/language/translationlist_3.xml' WHERE "name" = 'Accredited Joomla! Translations' AND "type" = 'collection';
UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/core/extensions/com_joomlaupdate.xml' WHERE "name" = 'Joomla! Update Component Update Site' AND "type" = 'extension';

0 comments on commit f2f12a2

Please sign in to comment.