CoreFiles by mySites.guru
sample.php60 lines, 1,337 bytes, from Joomla_3.2.1-Stable-Full_Package.zip
Raw History Compare with 3.2.0
md5
997f3122a8a0e74176cf3e60b3bd8ed6
sha1
ed7e0be5ada4f3ac91a5279b017d47e47df0492f
sha256
9ee80d71f938503580f7a1728f9a9b399e1a4a8eecf5d179f1dcae117355e4fa
<?php
/**
 * @package     Joomla.Installation
 * @subpackage  Controller
 *
 * @copyright   Copyright (C) 2005 - 2013 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.
 *
 * @package     Joomla.Installation
 * @subpackage  Controller
 * @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'), 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 7 releases, Joomla 3.1.0 to 3.2.1. See them all, or every version of this file.