Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a03db79
Fix total time in DoctrinePannel
EvilKraft Sep 28, 2018
ba51ced
Use declared settings; fix disable panels
trasher Oct 12, 2018
268b9c3
Test on php 7.2, drop hhvm
trasher Oct 12, 2018
d6282bf
Update .travis.yml
EvilKraft Oct 31, 2018
28e0dfb
Update .travis.yml
EvilKraft Oct 31, 2018
a5df4ac
Update .travis.yml
EvilKraft Oct 31, 2018
c4be184
fix
EvilKraft Oct 31, 2018
49de9ce
Merge branch 'glpi-project-master'
EvilKraft Oct 31, 2018
98b20b7
Update VendorVersionsPanel.phtml
EvilKraft Oct 31, 2018
094826d
Update PhpInfoPanel.php
EvilKraft Nov 8, 2018
bedc68b
Update PanelSelector.php
EvilKraft Nov 8, 2018
c3487e6
Update SlimRequestPanel.php
EvilKraft Nov 8, 2018
6aabb94
fix
EvilKraft Nov 8, 2018
7596fc8
add encoding console output
EvilKraft Dec 28, 2018
25cf352
fix RunTracyConsole
EvilKraft Dec 28, 2018
aa2dbd2
fix terminal
EvilKraft Jan 3, 2019
6837e97
start slim4
EvilKraft Dec 17, 2019
b9e1d9d
fix
EvilKraft Dec 17, 2019
6cdd2cf
fix
EvilKraft Dec 19, 2019
80d89e3
fix
EvilKraft Dec 19, 2019
3accf7a
fix
EvilKraft Dec 19, 2019
6dc45c8
fix
EvilKraft Dec 20, 2019
4bf3e15
fix
EvilKraft Dec 20, 2019
a81db7b
fix
EvilKraft Dec 25, 2019
759c07f
fix
EvilKraft Dec 25, 2019
acf7a5c
fix TwigPanel
EvilKraft Feb 6, 2020
e66fa04
fix TwigPanel
EvilKraft Feb 6, 2020
6592300
Update TracyMiddleware.php
EvilKraft Sep 17, 2020
c92b122
Update TracyMiddleware.php
EvilKraft Sep 17, 2020
0877b35
fix
EvilKraft Jan 7, 2022
b9bdaa0
fix
EvilKraft Jan 7, 2022
7082496
fix
EvilKraft Jan 7, 2022
63a4026
fix
EvilKraft Jan 7, 2022
18693cc
fix
EvilKraft Jan 7, 2022
3d40ebc
fix
EvilKraft Jan 7, 2022
632a9f3
fix Slim Router Pannel
EvilKraft Jan 11, 2022
d01b0c2
fix Slim Router Pannel
EvilKraft Jan 11, 2022
ae54dba
disable idiorm Panel if ORM class not exist
darkalchemy Mar 5, 2022
e5ac885
docs: add remark-cli to format README
darkalchemy Mar 5, 2022
3fbbef3
Upgrade to 0.2.12
darkalchemy Mar 5, 2022
f1cc766
fix: set visibility to public
darkalchemy Mar 5, 2022
64a1bc7
feat: add tracy functions.php to composer.json files
darkalchemy Mar 7, 2022
8754a18
fix: hide orm panels if class not exist
darkalchemy Mar 7, 2022
8fdd3a4
0.2.14
darkalchemy Mar 7, 2022
be5a0fd
revert: add functions.php to composer.json was not needed
darkalchemy Mar 7, 2022
e40ac62
0.2.15
darkalchemy Mar 7, 2022
a57c07b
Merge pull request #3 from darkalchemy/master
EvilKraft Mar 5, 2024
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea/
Thumbs.db
.DS_Store
.env
.phpunit.result.cache
.dccache
/vendor/*
.vscode/
/composer.lock
node_modules/
33 changes: 33 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src/')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new PhpCsFixer\Config();

return $config
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PhpCsFixer' => true,
'binary_operator_spaces' => ['operators' => ['=' => 'align_single_space', '=>' => 'align_single_space']],
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'no_superfluous_phpdoc_tags' => false,
'ternary_to_null_coalescing' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_strict_types' => true,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'function_to_constant' => true,
'native_constant_invocation' => true,
'no_alias_functions' => true,
'ternary_to_elvis_operator' => true
])
->setFinder($finder);
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ php:
- 5.6
- 7.0
- 7.1
- hhvm
- 7.2
- nightly

matrix:
allow_failures:
- php: nightly

before_script:
- composer install --no-suggest ;
Expand Down
230 changes: 188 additions & 42 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Example/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@
// '' || '/tmp' || ['user1' => '/home/user1', 'user2' => '/home/user2']
'ConsoleHomeDirectory' => DIR,
// terminal.js full URI
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
'ConsoleTerminalJs' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.9.0/js/jquery.terminal.min.js', //'/assets/js/jquery.terminal.min.js'
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ConsoleTerminalCss' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery.terminal/2.9.0/css/jquery.terminal.min.css', //'/assets/css/jquery.terminal.min.css'
'ConsoleFromEncoding' => 'CP866', // or false
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
// 'primaryValue' => 'effective', // or 'absolute'
Expand Down
118 changes: 71 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
[![Code Climate](https://codeclimate.com/github/runcmf/runtracy/badges/gpa.svg)](https://codeclimate.com/github/runcmf/runtracy)
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Software License][ico-license]][link-license]
[![Software License][ico-license]][link-license]

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/2d080724-9e10-4770-9220-0678381eb341/big.png)](https://insight.sensiolabs.com/projects/2d080724-9e10-4770-9220-0678381eb341)

# Slim Framework Tracy Debugger Bar #
# Slim Framework 4 Tracy Debugger Bar

configure it by mouse
---

***

![example](ss/tracy_panel.png "Tracy Panel")

now in package:
---
now in package:

***

| Panel | Description |
| --- | --- |
| **Slim Framework** | - |
Expand All @@ -26,48 +32,51 @@ now in package:
| [Idiorm](https://github.com/j4mie/idiorm) | time, sql. panel & collector. **Note:** Idiorm support only one collector and if you use own this will not work. |
| [Illuminate Database](https://github.com/illuminate/database) | sql, bindings |
| **Template** | - |
| [Twig](https://github.com/twigphp/Twig) | Twig_Profiler_Dumper_Html() |
| [Twig](https://github.com/twigphp/Twig) | \Twig\Profiler\Dumper\HtmlDumper() |
| **Common** | - |
| PanelSelector | easy configure (part of fork from [TracyDebugger](https://github.com/adrianbj/TracyDebugger)) |
| PanelSelector | easy configure (part of fork from [TracyDebugger](https://github.com/adrianbj/TracyDebugger)) |
| PhpInfo | full phpinfo() |
| Console | PTY (pseudo TTY) console (fork from [web-console](https://github.com/nickola/web-console)) |
| Profiler | time, mem usage, timeline (fork from [profiler](https://github.com/netpromotion/profiler)) |
| Included Files | Included Files list |
| XDebug | start and stop a Xdebug session (fork from [Nette-XDebug-Helper](https://github.com/jsmitka/Nette-XDebug-Helper)) |
| VendorVersions | version info from composer.json and composer.lock (fork from [vendor-versions](https://github.com/milo/vendor-versions)) |

---
| VendorVersions | version info from composer.json and composer.lock (fork from [vendor-versions](https://github.com/milo/vendor-versions)) |

***

# Install

**1.**
``` bash

```bash
$ composer require runcmf/runtracy
```

**2.** goto 3 or if need Twig, Doctrine DBAL, Doctrine ORM, Eloquent ORM then:

**2.1** install it
``` bash

```bash
$ composer require doctrine/dbal
$ composer require doctrine/orm
$ composer require slim/twig-view
$ composer require illuminate/database
```

**2.2** add to your dependencies (Twig, Twig_Profiler) and/or Eloquent ORM like:
**2.2** add to your dependencies (Twig, Twig\_Profiler) and/or Eloquent ORM like:

```php
// Twig
$c['twig_profile'] = function () {
return new Twig_Profiler_Profile();
return new \Twig\Profiler\Profile();
};

$c['view'] = function ($c) {
$settings = $c->get('settings')['view'];
$view = new \Slim\Views\Twig($settings['template_path'], $settings['twig']);
$view = new \Slim\Views\Twig::create($settings['template_path'], $settings['twig']);
// Add extensions
$view->addExtension(new Slim\Views\TwigExtension($c->get('router'), $c->get('request')->getUri()));
$view->addExtension(new Twig_Extension_Profiler($c['twig_profile']));
$view->addExtension(new Twig_Extension_Debug());
$view->addExtension(new \Twig\Extension\ProfilerExtension($c['twig_profile']));
$view->addExtension(new \Twig\Extension\DebugExtension());
return $view;
};

Expand Down Expand Up @@ -111,28 +120,33 @@ $c['em'] = function ($c) {
// possible return or ORM\EntityManager or ORM\QueryBuilder
return \Doctrine\ORM\EntityManager::create($settings['doctrine']['connection'], $config);
};
```
```

**3.** register middleware
``` php
$app->add(new RunTracy\Middlewares\TracyMiddleware($app));

```php
$app->add(RunTracy\Middlewares\TracyMiddleware::createFromContainer($app));
```

**4.** register route if you plan use PTY Console
``` php

```php
$app->post('/console', 'RunTracy\Controllers\RunTracyConsole:index');
```
also copy you want `jquery.terminal.min.js` & `jquery.terminal.min.css` from vendor/runcmf/runtracy/web and correct path in 'settings' below.

also copy you want `jquery.terminal.min.js` & `jquery.terminal.min.css` from vendor/runcmf/runtracy/web and correct path in 'settings' below.
add from local or from CDN (https://code.jquery.com/) or copy/paste
``` html

```html
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
```

**5.** add to your settings Debugger initialisation and 'tracy' section.
``` php
```

**5.** add to your settings Debugger initialisation and 'tracy' section.

```php
use Tracy\Debugger;

defined('DS') || define('DS', DIRECTORY_SEPARATOR);
Expand Down Expand Up @@ -183,6 +197,7 @@ return [
'ConsoleTerminalJs' => '/assets/js/jquery.terminal.min.js',
// terminal.css full URI
'ConsoleTerminalCss' => '/assets/css/jquery.terminal.min.css',
'ConsoleFromEncoding' => 'CP866', // or false
'ProfilerPanel' => [
// Memory usage 'primaryValue' set as Profiler::enable() or Profiler::enable(1)
// 'primaryValue' => 'effective', // or 'absolute'
Expand All @@ -196,7 +211,6 @@ return [
]
```


see config examples in vendor/runcmf/runtracy/Example

![example](ss/panel_selector.png "Panel Selector")
Expand All @@ -221,10 +235,10 @@ see config examples in vendor/runcmf/runtracy/Example

![example](ss/console_panel.png "PTY Console Panel")

Profiler Example in new installed [slim-skeleton](https://packagist.org/packages/slim/slim-skeleton)
`public/index.php`

Profiler Example in new installed [slim-skeleton](https://packagist.org/packages/slim/slim-skeleton)
`public/index.php`
``` php
```php
<?php
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
Expand Down Expand Up @@ -267,41 +281,47 @@ require __DIR__ . '/../src/routes.php';
$app->run();
RunTracy\Helpers\Profiler\Profiler::finish('App');
```

![example](ss/profiler_panel.png "Profiler Panel")

![idormDBAL](ss/idiorm_and_dbal.png "Idiorm and Doctrine DBAL Panels")

---
***

## HOWTO
[how-open-files-in-ide-from-debugger](https://pla.nette.org/en/how-open-files-in-ide-from-debugger)
## HOWTO

[how-open-files-in-ide-from-debugger](https://pla.nette.org/en/how-open-files-in-ide-from-debugger)

***

---
## Tests

```bash
$ cd vendor/runcmf/runtracy
$ composer update
$ vendor/bin/phpunit
```
---

## Security
***

If you discover any security related issues, please email to 1f7.wizard( at )gmail.com instead of using the issue tracker.
## Security

If you discover any security related issues, please email to 1f7.wizard( at )gmail.com instead of using the issue tracker.

***

---
## Credits

* https://bitbucket.org/1f7
* https://github.com/1f7
* http://runetcms.ru
* http://runcmf.ru
* https://bitbucket.org/1f7
* https://github.com/1f7
* http://runetcms.ru
* http://runcmf.ru

***

---
## License
```

```bash
Copyright 2016 1f7.wizard@gmail.com

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -318,9 +338,13 @@ limitations under the License.
```

[ico-version]: https://img.shields.io/packagist/v/runcmf/runtracy.svg

[ico-license]: https://img.shields.io/badge/license-Apache%202-green.svg

[ico-downloads]: https://img.shields.io/packagist/dt/runcmf/runtracy.svg

[link-packagist]: https://packagist.org/packages/runcmf/runtracy

[link-license]: http://www.apache.org/licenses/LICENSE-2.0

[link-downloads]: https://github.com/runcmf/runtracy
Loading