Passed
Pull Request — develop (#922)
by Tito
07:09
created

RedcoreControllerWebservice_History_Log   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFileData() 0 13 2
1
<?php
2
/**
3
 * @package     Redcore.Backend
4
 * @subpackage  Controllers
5
 *
6
 * @copyright   Copyright (C) 2008 - 2016 redCOMPONENT.com. All rights reserved.
7
 * @license     GNU General Public License version 2 or later, see LICENSE.
8
 */
9
10
defined('_JEXEC') or die;
11
12
/**
13
 * Webservice History Log Controller
14
 *
15
 * @package     Redcore.Backend
16
 * @subpackage  Controllers
17
 * @since       1.4
18
 */
19
class RedcoreControllerWebservice_History_Log extends RControllerForm
20
{
21
	/**
22
	 * Method to publish a list of items
23
	 *
24
	 * @return  void
25
	 */
26
	public function getFileData()
27
	{
28
		// Check for request forgeries
29
		JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
30
31
		// Get items to copy from the request.
32
		$id    = JFactory::getApplication()->input->get('id', 0, 'int');
33
		$table = RTable::getAdminInstance('Webservice_History_Log');
34
		$table->load($id);
35
36
		echo file_get_contents(JPATH_ROOT . '/' . $table->file_name);
37
38
		JFactory::getApplication()->close();
39
	}
40
}
41