Upgrade to KH 3.1.3.1
This commit is contained in:
@@ -29,7 +29,7 @@ class Bench_DateSpan extends Codebench {
|
||||
public static function bench_span_original($remote, $local = NULL, $output = 'years,months,weeks,days,hours,minutes,seconds')
|
||||
{
|
||||
// Array with the output formats
|
||||
$output = preg_split('/[^a-z]+/', strtolower((string) $output));
|
||||
$output = preg_split('/[^a-z]+/', strtolower( (string) $output));
|
||||
|
||||
// Invalid output
|
||||
if (empty($output))
|
||||
@@ -116,7 +116,7 @@ class Bench_DateSpan extends Codebench {
|
||||
public static function bench_span_use_array($remote, $local = NULL, $output = 'years,months,weeks,days,hours,minutes,seconds')
|
||||
{
|
||||
// Array with the output formats
|
||||
$output = preg_split('/[^a-z]+/', strtolower((string) $output));
|
||||
$output = preg_split('/[^a-z]+/', strtolower( (string) $output));
|
||||
|
||||
// Invalid output
|
||||
if (empty($output))
|
||||
|
@@ -17,7 +17,9 @@ class Controller_Codebench extends Kohana_Controller_Template {
|
||||
{
|
||||
// Convert submitted class name to URI segment
|
||||
if (isset($_POST['class']))
|
||||
{
|
||||
$this->request->redirect('codebench/'.trim($_POST['class']));
|
||||
}
|
||||
|
||||
// Pass the class name on to the view
|
||||
$this->template->class = (string) $class;
|
||||
|
@@ -155,10 +155,10 @@ abstract class Kohana_Codebench {
|
||||
foreach ($codebench['benchmarks'] as & $method)
|
||||
{
|
||||
// Calculate percentage difference relative to fastest and slowest methods
|
||||
$method['percent']['fastest']['time'] = (empty($fastest_method['time'])) ? 0 : $method['time'] / $fastest_method['time'] * 100;
|
||||
$method['percent']['fastest']['memory'] = (empty($fastest_method['memory'])) ? 0 : $method['memory'] / $fastest_method['memory'] * 100;
|
||||
$method['percent']['slowest']['time'] = (empty($slowest_method['time'])) ? 0 : $method['time'] / $slowest_method['time'] * 100;
|
||||
$method['percent']['slowest']['memory'] = (empty($slowest_method['memory'])) ? 0 : $method['memory'] / $slowest_method['memory'] * 100;
|
||||
$method['percent']['fastest']['time'] = (empty($fastest_method['time'])) ? 0 : ($method['time'] / $fastest_method['time'] * 100);
|
||||
$method['percent']['fastest']['memory'] = (empty($fastest_method['memory'])) ? 0 : ($method['memory'] / $fastest_method['memory'] * 100);
|
||||
$method['percent']['slowest']['time'] = (empty($slowest_method['time'])) ? 0 : ($method['time'] / $slowest_method['time'] * 100);
|
||||
$method['percent']['slowest']['memory'] = (empty($slowest_method['memory'])) ? 0 : ($method['memory'] / $slowest_method['memory'] * 100);
|
||||
|
||||
// Assign a grade for time and memory to each method
|
||||
$method['grade']['time'] = $this->_grade($method['percent']['fastest']['time']);
|
||||
@@ -168,10 +168,10 @@ abstract class Kohana_Codebench {
|
||||
foreach ($method['subjects'] as & $subject)
|
||||
{
|
||||
// Calculate percentage difference relative to fastest and slowest subjects for this method
|
||||
$subject['percent']['fastest']['time'] = (empty($fastest_subject['time'])) ? 0 : $subject['time'] / $fastest_subject['time'] * 100;
|
||||
$subject['percent']['fastest']['memory'] = (empty($fastest_subject['memory'])) ? 0 : $subject['memory'] / $fastest_subject['memory'] * 100;
|
||||
$subject['percent']['slowest']['time'] = (empty($slowest_subject['time'])) ? 0 : $subject['time'] / $slowest_subject['time'] * 100;
|
||||
$subject['percent']['slowest']['memory'] = (empty($slowest_subject['memory'])) ? 0 : $subject['memory'] / $slowest_subject['memory'] * 100;
|
||||
$subject['percent']['fastest']['time'] = (empty($fastest_subject['time'])) ? 0 : ($subject['time'] / $fastest_subject['time'] * 100);
|
||||
$subject['percent']['fastest']['memory'] = (empty($fastest_subject['memory'])) ? 0 : ($subject['memory'] / $fastest_subject['memory'] * 100);
|
||||
$subject['percent']['slowest']['time'] = (empty($slowest_subject['time'])) ? 0 : ($subject['time'] / $slowest_subject['time'] * 100);
|
||||
$subject['percent']['slowest']['memory'] = (empty($slowest_subject['memory'])) ? 0 : ($subject['memory'] / $slowest_subject['memory'] * 100);
|
||||
|
||||
// Assign a grade letter for time and memory to each subject
|
||||
$subject['grade']['time'] = $this->_grade($subject['percent']['fastest']['time']);
|
||||
|
Reference in New Issue
Block a user