2014-05-01 14:35:26 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @package PatchTester
|
|
|
|
*
|
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pulls controller class
|
|
|
|
*
|
|
|
|
* @package PatchTester
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2014-05-02 19:59:17 +00:00
|
|
|
class PatchtesterControllerPulls extends JControllerLegacy
|
2014-05-01 14:35:26 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Fetch pull request data from GitHub
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
|
|
|
public function fetch()
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
$this->getModel('pulls')->requestFromGithub();
|
|
|
|
|
|
|
|
$msg = JText::_('COM_PATCHTESTER_FETCH_SUCCESSFUL');
|
|
|
|
$type = 'message';
|
|
|
|
}
|
|
|
|
catch (Exception $e)
|
|
|
|
{
|
|
|
|
$msg = $e->getMessage();
|
|
|
|
$type = 'error';
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type);
|
|
|
|
}
|
|
|
|
}
|