Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
composer.phar
examples/export.txt
tests/Unit/export.txt
tests/Unit/Fixtures/export.txt
/vendor/
/.idea
.DS_Store
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: php
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
Expand Down
100 changes: 52 additions & 48 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
{
"name": "bvanhoekelen/performance",
"description": "PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.",
"keywords": [
"php",
"performance",
"performance tool",
"php performance tool",
"php performance analyser",
"php-performance",
"database",
"query",
"query analyser",
"query log",
"database query log",
"laravel",
"analyser",
"compressor",
"web",
"terminal",
"command line",
"export",
"memory",
"time"
],
"license": "Apache-2.0",
"authors": [
{
"name": "B. van Hoekelen",
"homepage": "https://github.com/bvanhoekelen/performance"
}
],
"require": {
"php": ">=5.6.0",
"bvanhoekelen/terminal-style": "^1.0"
},
"require-dev": {
"larapack/dd": "1.*",
"phpunit/phpunit": "^5.7",
"illuminate/database": "^5.4",
"illuminate/events": "^5.4"
},
"autoload": {
"psr-4": {
"Performance\\": "src/"
}
},
"archive": {
"exclude": ["assets"]
"name": "bvanhoekelen/performance",
"description": "PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.",
"keywords": [
"php",
"performance",
"performance tool",
"php performance tool",
"php performance analyser",
"php-performance",
"database",
"query",
"query analyser",
"query log",
"database query log",
"laravel",
"analyser",
"compressor",
"web",
"terminal",
"command line",
"export",
"memory",
"time"
],
"license": "Apache-2.0",
"authors": [
{
"name": "B. van Hoekelen",
"homepage": "https://github.com/bvanhoekelen/performance"
}
],
"require": {
"php": ">=7.1.0",
"bvanhoekelen/terminal-style": "^1.0",
"ext-json": "*",
"ext-mbstring": "*"
},
"require-dev": {
"larapack/dd": "1.*",
"phpunit/phpunit": "^5.7",
"illuminate/database": "^5.4",
"illuminate/events": "^5.4"
},
"autoload": {
"psr-4": {
"Performance\\": "src/"
}
},
"archive": {
"exclude": [
"assets"
]
}
}
4 changes: 2 additions & 2 deletions examples/01_simply_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand All @@ -13,8 +14,7 @@
Performance::point();

// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
}

Expand Down
4 changes: 2 additions & 2 deletions examples/02_simply_test_with_label.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Require Performance
*/
require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand All @@ -13,8 +14,7 @@
Performance::point('Task A');

// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
}

Expand Down
6 changes: 3 additions & 3 deletions examples/03_config_console_live.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

/*
* Set config item
Expand All @@ -19,8 +20,7 @@
Performance::point();

// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
}

Expand Down
3 changes: 2 additions & 1 deletion examples/04_config_trim.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

// Bootstrap class
$foo = new Foo();
Expand Down
3 changes: 2 additions & 1 deletion examples/05_config_enable_tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

// Bootstrap class
$foo = new Foo();
Expand Down
4 changes: 2 additions & 2 deletions examples/06_display_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand All @@ -17,8 +18,7 @@
Performance::point('Na mij');

// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
}

Expand Down
5 changes: 2 additions & 3 deletions examples/07_config_query_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

require_once('../vendor/autoload.php');
require_once('helper/UseEloquent.php');
require_once('helper/user.php');
require_once('helper/User.php');

use Illuminate\Database\Capsule\Manager as DB;

use Performance\Performance;
use Performance\Config;
use Performance\Performance;

// Bootstrap class
$foo = new Foo();
Expand Down
6 changes: 3 additions & 3 deletions examples/08_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand All @@ -13,8 +14,7 @@

Performance::point();
// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
}

Expand All @@ -37,4 +37,4 @@
print_r($export->points()->toJson());

// Return file_put_contents() results
print_r($export->toFile('export.txt'));
print_r($export->toFile('tests/Unit/Fixtures/export.txt'));
3 changes: 2 additions & 1 deletion examples/09_config_nice_label.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

// Bootstrap class
$foo = new Foo();
Expand Down
6 changes: 3 additions & 3 deletions examples/10_config_run_information.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

/*
* Set config item
Expand All @@ -20,8 +21,7 @@
Performance::point();

// Run task A
for($x = 0; $x < 100; $x++)
{
for ($x = 0; $x < 100; $x++) {
echo ".";
usleep(3000);
}
Expand Down
1 change: 1 addition & 0 deletions examples/11_measurments_are_more_accurate.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand Down
1 change: 1 addition & 0 deletions examples/12_multiple_points.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

require_once('../vendor/autoload.php');

use Performance\Performance;

/*
Expand Down
3 changes: 2 additions & 1 deletion examples/13_prevent_clear_screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;

Config::setClearScreen(false);

Expand Down
7 changes: 4 additions & 3 deletions examples/14_use_exceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
*/

require_once('../vendor/autoload.php');
use Performance\Performance;

use Performance\Config;
use Performance\Performance;


Config::setClearScreen(false);
Expand All @@ -19,9 +20,9 @@
Performance::point('A');

try {
Performance::point('A');
Performance::point('A');
} catch (Exception $e) {
print_r($e);
print_r($e);
}


Expand Down
5 changes: 3 additions & 2 deletions examples/helper/UseEloquent.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

////Use laravel Eloquent for database connection
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Events\Dispatcher;

$capsule = new DB();
$capsule->addConnection([
Expand All @@ -14,8 +16,7 @@
]);

// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;

$capsule->setEventDispatcher(new Dispatcher(new Container));

// Make this Capsule instance available globally via static methods... (optional)
Expand Down
4 changes: 2 additions & 2 deletions examples/helper/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class User extends Illuminate\Database\Eloquent\Model
{
protected $table = 'user';

public $timestamps = false;

protected $table = 'user';
}

// Table info
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Test interface">
<testsuite name="Legacy test interface">
<directory suffix='.php'>./tests/Unit</directory>
</testsuite>
<testsuite name="Unit tests">
<directory suffix='.php'>./tests/src</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 1 addition & 1 deletion screenshots/examples/config-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_once('../../vendor/autoload.php');
require_once('../../examples/helper/UseEloquent.php');
require_once('../../examples/helper/user.php');
require_once('../../examples/helper/User.php');

use Performance\Performance;
use Performance\Config;
Expand Down
Loading