This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/includes/kohana/modules/codebench/classes/Controller/Codebench.php

37 lines
917 B
PHP
Raw Normal View History

2011-01-13 14:49:56 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Codebench A benchmarking module.
*
* @package Kohana/Codebench
* @category Controllers
* @author Kohana Team
* @copyright (c) 2009 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class Controller_Codebench extends Kohana_Controller_Template {
// The codebench view
public $template = 'codebench';
2012-11-22 03:25:06 +00:00
public function action_index()
2011-01-13 14:49:56 +00:00
{
2012-11-22 03:25:06 +00:00
$class = $this->request->param('class');
2011-01-13 14:49:56 +00:00
// Convert submitted class name to URI segment
if (isset($_POST['class']))
2011-05-16 12:47:16 +00:00
{
2012-11-22 03:25:06 +00:00
throw HTTP_Exception::factory(302)->location('codebench/'.trim($_POST['class']));
2011-05-16 12:47:16 +00:00
}
2011-01-13 14:49:56 +00:00
// Pass the class name on to the view
$this->template->class = (string) $class;
// Try to load the class, then run it
if (Kohana::auto_load($class) === TRUE)
{
$codebench = new $class;
$this->template->codebench = $codebench->run();
}
}
}