- md5
- d58b9b6fc33048f5e6adbd51261753cf
- sha1
- dc5db78c0558a22d4cb43c4f2ec97d3089ba1136
- sha256
- 67a3d769a8ad032b48807c0d4e1666b67e350b092e3ef0f00ad99c47fa9decd5
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
<?php
/**
* @package Joomla.Installation
* @subpackage Controller
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @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 26 releases, Joomla 3.9.2-rc to 3.9.14. See them all, or every version of this file.