- md5
- d843cf9ca58cc98b49476fc5bda38a81
- sha1
- 39e79b387d8d60cb7b49d422eb05384d8b2714dc
- sha256
- 69c71b35d03ab062caa90b638572c8d6e41dd3d65260581c67de18046a787bc1
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file contains post-installation message handling for eAccelerator compatibility.
*/
defined('_JEXEC') or die;
/**
* Checks if the eAccelerator caching method is enabled. This check should be
* done through the 3.x series as the issue impacts migrated sites which will
* most often come from the previous LTS release (2.5). Remove for version 4 or
* when eAccelerator support is added.
*
* This check returns true when the eAccelerator caching method is user, meaning
* that the message concerning it should be displayed.
*
* @return integer
*
* @since 3.2
*/
function admin_postinstall_eaccelerator_condition()
{
$app = JFactory::getApplication();
$cacheHandler = $app->getCfg('cacheHandler', '');
return (ucfirst($cacheHandler) == 'Eaccelerator');
}
/**
* Disables the unsupported eAccelerator caching method, replacing it with the
* "file" caching method.
*
* @return void
*
* @since 3.2
*/
function admin_postinstall_eaccelerator_action()
{
$prev = new JConfig;
$prev = JArrayHelper::fromObject($prev);
$data = array('cacheHandler' => 'file');
$data = array_merge($prev, $data);
$config = new JRegistry('config');
$config->loadArray($data);
jimport('joomla.filesystem.path');
jimport('joomla.filesystem.file');
// Set the configuration file path.
$file = JPATH_CONFIGURATION . '/configuration.php';
// Get the new FTP credentials.
$ftp = JClientHelper::getCredentials('ftp', true);
// Attempt to make the file writeable if using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644'))
{
JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'));
}
// Attempt to write the configuration file as a PHP class named JConfig.
$configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
if (!JFile::write($file, $configuration))
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');
return;
}
// Attempt to make the file unwriteable if using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0444'))
{
JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'));
}
}
The same content is in 2 releases, Joomla 3.2.0 to 3.2.1. See them all, or every version of this file.