CoreFiles by mySites.guru
updatecachetime.php55 lines, 1,423 bytes, from Joomla_3.6.5-Stable-Full_Package.zip
Raw History Compare with 3.6.4
md5
7f5b2e949e39992bdbe1524ccea733a6
sha1
c368120e97516f5bb80802bc443a22fc1a1f0c4f
sha256
a9a910569386235e80b66db3d0f8c1c7652099636fd8f41b1d113cd33198777e
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  System.updatenotification
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

/**
 * Checks if the com_installer config for the cache Hours are eq 0 and the updatenotification Plugin is enabled
 *
 * @return  boolean
 *
 * @since   3.6.3
 */
function updatecachetime_postinstall_condition()
{
	$cacheTimeout = (int) JComponentHelper::getComponent('com_installer')->params->get('cachetimeout', 6);

	// Check if cachetimeout is eq zero
	if ($cacheTimeout == 0 && JPluginHelper::isEnabled('system', 'updatenotification'))
	{
		return true;
	}

	return false;
}

/**
 * Sets the cachtimeout back to the default (6 hours)
 *
 * @return  void
 *
 * @since   3.6.3
 */
function updatecachetime_postinstall_action()
{
	$installer = JComponentHelper::getComponent('com_installer');

	// Sets the cachtimeout back to the default (6 hours)
	$installer->params->set('cachetimeout', 6);
	
	// Save the new parameters back to com_installer
	$table = JTable::getInstance('extension');
	$table->load($installer->id);
	$table->bind(array('params' => $installer->params->toString()));

	// Store the changes
	if (!$table->store())
	{
		// If there is a error show it to the admin
		JFactory::getApplication()->enqueueMessage($table->getError(), 'error');
	}
}

The same content is in 6 releases, Joomla 3.6.3-rc1 to 3.6.5. See them all, or every version of this file.