CoreFiles by mySites.guru
sample.php58 lines, 1,277 bytes, from Joomla_3.9.0-beta-Beta-Full_Package.zip
Raw History Compare with 3.8.0-beta4
md5
bc86eff7b6ab72ad297ea989c6b22160
sha1
5052ade794e82f73d04e4df0f0579e55ab1411d7
sha256
48e8ab75a9a0dd77cd44f1ec5aba04593d259c3a66245bf76b27f4e3d23e1456
<?php
/**
 * @package     Joomla.Installation
 * @subpackage  Controller
 *
 * @copyright   Copyright (C) 2005 - 2018 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 install the sample data for the Joomla Installer.
 *
 * @since  3.1
 */
class InstallationControllerInstallSample 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;

		// Get the options from the session
		$options = $model->getOptions();

		// Get the database model.
		$db = new InstallationModelDatabase;

		// Attempt to create the database tables.
		$return = $db->installSampleData($options);

		$r = new stdClass;
		$r->view = 'install';

		// Check if the database was initialised
		if (!$return)
		{
			$r->view = 'database';
		}

		$app->sendJsonResponse($r);
	}
}

The same content is in 9 releases, Joomla 3.9.0-beta to 3.9.1. See them all, or every version of this file.