- md5
- 501b50b5b3ed7bd84fdd7d659f9d28a4
- sha1
- 7e20f3105aca78010bd33b6673754f2c6402ca2d
- sha256
- ff3ba9bb52be0d3dc3f1b67fd5abc9733f4c8c0bf66ca0f73830ea75e3c7b70e
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
<?php
/**
* @package Joomla.Installation
* @subpackage Controller
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Controller class to initialise the database for the Joomla Installer.
*
* @since 3.1
*/
class InstallationControllerDatabase extends JControllerBase
{
/**
* Execute the controller.
*
* @return void
*
* @since 3.1
*/
public function execute()
{
// Get the application
/* @var InstallationApplicationWeb $app */
$app = $this->getApplication();
// Check for request forgeries.
JSession::checkToken() or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN_NOTICE'), 403));
// Get the setup model.
$model = new InstallationModelSetup;
// Check the form
$vars = $model->checkForm('database');
// Determine if the configuration file path is writable.
$path = JPATH_CONFIGURATION . '/configuration.php';
$useftp = file_exists($path) ? !is_writable($path) : !is_writable(JPATH_CONFIGURATION . '/');
$r = new stdClass;
$r->view = $useftp ? 'ftp' : 'summary';
// Get the database model.
$db = new InstallationModelDatabase;
// Attempt to initialise the database.
$return = $db->createDatabase($vars);
// Check if the database was initialised
if (!$return)
{
$r->view = 'database';
}
$app->sendJsonResponse($r);
}
}
The same content is in 8 releases, Joomla 3.10.0-alpha4 to 3.10.0-rc2. See them all, or every version of this file.