diff --git a/administrator/components/com_admin/postinstall/statscollection.php b/administrator/components/com_admin/postinstall/statscollection.php new file mode 100644 index 0000000000000..42e84803ceaab --- /dev/null +++ b/administrator/components/com_admin/postinstall/statscollection.php @@ -0,0 +1,24 @@ +updateDatabase(); $this->clearRadCache(); $this->updateAssets(); + $this->clearStatsCache(); + } + + /** + * Method to clear our stats plugin cache to ensure we get fresh data on Joomla Update + * + * @return void + * + * @since 3.5 + */ + protected function clearStatsCache() + { + $db = JFactory::getDbo(); + + try + { + // Get the params for the stats plugin + $params = $db->setQuery( + $db->getQuery(true) + ->select($db->quoteName('params')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) + ->where($db->quoteName('element') . ' = ' . $db->quote('stats')) + )->loadResult(); + } + catch (Exception $e) + { + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
'; + + return; + } + + $params = json_decode($params, true); + + // Reset the last run parameter + if (isset($params['lastrun'])) + { + $params['lastrun'] = ''; + } + + $query = $db->getQuery(true) + ->update($db->quoteName('#__extensions')) + ->set($db->quoteName('params') . ' = ' . $db->quote($params)) + ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) + ->where($db->quoteName('element') . ' = ' . $db->quote('stats')); + + try + { + $db->setQuery($query)->execute(); + } + catch (Exception $e) + { + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
'; + + return; + } } /** @@ -275,6 +333,7 @@ protected function updateManifestCaches() array('plugin', 'yubikey', 'twofactorauth', 0), array('plugin', 'updatenotification', 'system', 0), array('plugin', 'module', 'editors-xtd', 0), + array('plugin', 'stats', 'system', 0), // Templates array('template', 'beez3', '', 0), diff --git a/administrator/components/com_admin/sql/updates/mysql/3.5.0-2015-11-05.sql b/administrator/components/com_admin/sql/updates/mysql/3.5.0-2015-11-05.sql new file mode 100644 index 0000000000000..4f75f640e3a56 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.5.0-2015-11-05.sql @@ -0,0 +1,6 @@ +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(454, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); + +INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) +VALUES +(700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-11-05.sql b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-11-05.sql new file mode 100644 index 0000000000000..e099d77e49c1d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.5.0-2015-11-05.sql @@ -0,0 +1,5 @@ +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(454, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); + +INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") VALUES +(700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql new file mode 100644 index 0000000000000..225b844bd91d9 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql @@ -0,0 +1,9 @@ +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SELECT 454, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT [#__extensions] OFF; + +INSERT INTO #__postinstall_messages ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +SELECT 700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1; diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index f5542e76d0d86..d8f93f539e879 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -27,6 +27,8 @@ COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP t COM_CPANEL_MSG_PHPVERSION_TITLE="Your PHP Version Will Be Unsupported in Joomla! 3.3" COM_CPANEL_MSG_ROBOTS_TITLE="robots.txt Update" COM_CPANEL_MSG_ROBOTS_BODY="A change to the default robots.txt files was made in Joomla! 3.3 to allow Google to access templates and media files by default to improve SEO. This change is not applied automatically on upgrades and users are recommended to review the changes in the robots.txt.dist file and implement these change in their own robots.txt file." +COM_CPANEL_MSG_STATS_COLLECTION_BODY="Joomla collects anonymous data on your Joomla, PHP and Database Version as well as your Server Type. For more information please read more at . If you do not wish to provide the Joomla! project with this information you can simply disable the plugin called System - Joomla! Statistics" +COM_CPANEL_MSG_STATS_COLLECTION_TITLE="Stats Collection in Joomla" COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

Community resources are available for new users