Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanhoekelen committed Jul 17, 2017
2 parents 5786bf0 + 14f38ad commit 4a6c886
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 111 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log

## [v2.1.0](https://github.com/bvanhoekelen/performance/tree/v2.0.1) - 2017-06-28
## [v2.2.0](https://github.com/bvanhoekelen/performance/tree/v2.2.0) - 2017-07-17
### Added
- In the web interface can be hidden and the preference is store.

## [v2.1.0](https://github.com/bvanhoekelen/performance/tree/v2.1.0) - 2017-06-28
### Added
- Run user and process id information.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"authors": [
{
"name": "B. van Hoekelen",
"homepage": "https://github.com/bvanhoekelen/performace"
"homepage": "https://github.com/bvanhoekelen/performance"
}
],
"require": {
Expand Down
2 changes: 0 additions & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,4 @@ public static function instanceReset()
{
self::$config = null;
}


}
7 changes: 1 addition & 6 deletions src/Lib/Handlers/ConfigHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getAllItemNames()
private function setDefaultTimeZone()
{
// Check date function
if( ! ini_get('date.timezone') )
if( ! ini_get('date.timezone'))
date_default_timezone_set('UTC');
}

Expand Down Expand Up @@ -255,9 +255,4 @@ public function isRunInformation()
{
return $this->runInformation;
}





}
5 changes: 1 addition & 4 deletions src/Lib/Handlers/ExportHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function toJson()
$points[] = $point->export();
}


if($multiExport)
$return['points'] = $points;
else
Expand All @@ -104,6 +103,4 @@ public function toJson()
// Return
return json_encode($return);
}

}

}
4 changes: 1 addition & 3 deletions src/Lib/Handlers/PerformanceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PerformanceHandler
/*
* Version
*/
const VERSION = '2.1.0';
const VERSION = '2.2.0';

/*
* Hold point stack
Expand Down Expand Up @@ -285,7 +285,5 @@ private function checkAndSetMessageInToLabel(Point $point)

// Reset
$this->messageToLabel = '';

}

}
2 changes: 0 additions & 2 deletions src/Lib/Holders/CalculateTotalHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ public function __construct($totalTime, $totalMemory, $totalMemoryPeak)
$this->totalMemory = $totalMemory;
$this->totalMemoryPeak = $totalMemoryPeak;
}


}
2 changes: 0 additions & 2 deletions src/Lib/Holders/InformationHolder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Performance\Lib\Holders;


use Performance\Lib\Handlers\ConfigHandler;

class InformationHolder
Expand Down Expand Up @@ -52,7 +51,6 @@ private function setRunInformation()
$this->currentUser = '?';
$this->currentProcessId = '?';


// Set current user
try{
$this->currentUser = get_current_user();
Expand Down
2 changes: 0 additions & 2 deletions src/Lib/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Point implements ExportInterface
const POINT_CALIBRATE = 'Calibrate point';

private $config;

private $active;
private $label;
private $startTime;
Expand Down Expand Up @@ -266,5 +265,4 @@ public function addNewLineMessage($newLineMessage)
{
$this->newLineMessage[] = $newLineMessage;
}

}
3 changes: 1 addition & 2 deletions src/Lib/Presenters/Calculate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Performance\Lib\Holders\CalculateTotalHolder;


class Calculate
{
/*
Expand All @@ -21,7 +20,7 @@ public function totalTimeAndMemory($pointStack)
$max_memory += $point->getDifferenceMemory();
}

return new CalculateTotalHolder($max_time, $max_memory, memory_get_peak_usage(true));;
return new CalculateTotalHolder($max_time, $max_memory, memory_get_peak_usage(true));
}

/*
Expand Down
2 changes: 0 additions & 2 deletions src/Lib/Presenters/ConsolePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,10 @@ private function clearScreen()
private function printPointNewLineMessage(Point $point)
{
if(count($point->getNewLineMessage()))
{
foreach ($point->getNewLineMessage() as $message)
{
$this->printMessage($message);
}
}
}

public function printMessage($message = null, $time = '-- ', $memory = '-- ', $peak = '-- ')
Expand Down
47 changes: 31 additions & 16 deletions src/Lib/Presenters/DisplayHtml.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.performance *{
#performance-tool *{
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Times;
}

.performance{
#performance-tool{
display: block;
position: fixed;
border: solid #ccc 1px;
Expand All @@ -25,7 +25,7 @@
body{
margin-bottom: 350px;
}
.performance {
#performance-tool {
bottom: 0px;
left: 0;
right: 0;
Expand All @@ -34,68 +34,83 @@
}
}

.performance .overflow{
#performance-tool .overflow{
overflow: auto;
height: 77%;
border-top: solid #bababa 1px;
}

.performance .table-title{
#performance-tool .table-title{
width: 100%;
background-color: #fff;
}
.performance .table-title td{
#performance-tool .table-title td{
text-align: center;
padding: 8px;
font-size: 28px;
}
.performance .table-point .t-l{
#performance-tool .table-point .t-l{
text-align: left;
}
.performance .table-point .new-line-message{
#performance-tool .table-point .new-line-message{
color: #333;
text-align: left;
padding-left: 14px;
}

.performance .table-title td span{
#performance-tool .table-title td span{
font-size: 12px;
}

.performance .table-point {
#performance-tool .table-point {
width: 100%;
}

.performance .table-point th{
#performance-tool .table-point th{
background-color: #e2e2e2;

}

.performance .table-point tr:nth-child(odd) {
#performance-tool .table-point tr:nth-child(odd) {
background-color: #f2f2f2;
}
.performance .table-point tr:hover{
#performance-tool .table-point tr:hover{
background-color: #e2e2e2;

}

.performance .table-point td{
#performance-tool .table-point td{
padding: 4px;
text-align: right;
}

.performance .table-more-info{
#performance-tool .table-more-info{
border-top: solid #ccc 2px;
color: #555;
padding: 14px 10px;
text-align: center;
}

.performance code {
#performance-tool code {
background-color: #2b542c;
margin: 20px;
padding: 20px;
display: block;
background:#F8F8FF;
border:black dashed 1px;
}

#performance-btn-close{
position: absolute;
right: 0;
top: 0;
margin: 0px;
padding: 10px;
color: #ccc;
text-decoration: none;
border-radius: 100%;
}

#performance-btn-close:hover{
color: #e09a0f;
}
37 changes: 37 additions & 0 deletions src/Lib/Presenters/DisplayScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Set web store
if (typeof(Storage) !== "undefined")
{
if( ! localStorage.performanceToolDisplay)
localStorage.performanceToolDisplay = 'show';

if(localStorage.performanceToolDisplay == 'hide')
performanceDisplayToggle(false);
}


function performanceDisplayToggle(show)
{
x = document.getElementById('hiddenContent');
y = document.getElementById('performance-tool');
z = document.getElementById('performance-btn-close');
status = null;
if( x.style.display == 'none' || show == true)
{
x.style.display = 'block';
y.style.height = 300;
y.style.maxWidth = 500;
z.innerHTML = '&#9660;';
status = 'show';
}
else
{
x.style.display = 'none';
y.style.height = 40;
y.style.maxWidth = 36;
z.innerHTML = '&#9650;';
status = 'hide';
}

if(typeof(Storage) !== "undefined" && show == null)
localStorage.performanceToolDisplay = status;
}
4 changes: 1 addition & 3 deletions src/Lib/Presenters/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

class Formatter {

public function __construct()
{
}
public function __construct(){}

public function timeToHuman($microTime, $unit = 'auto', $decimals = 2)
{
Expand Down
Loading

0 comments on commit 4a6c886

Please sign in to comment.