Skip to content

Commit 45c3df4

Browse files
committed
Profiler v2
1 parent 17d6602 commit 45c3df4

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It helps to add profiler to your php-project easy.
1111
- Has 'counter' and 'timer' tools.
1212
- Has grouping for compare elements.
1313

14-
### How to add profiler to project
14+
### How to add the profiler to you project
1515

1616
All you need is open your 'autoload' function, and use the profiler's function for loading class.
1717

@@ -20,20 +20,24 @@ Example:
2020
// Path to autoloader class for SimpleProfiler
2121
include ('../php-simple-profiler/src/autoloader.php');
2222

23-
// It is some function for load your classes
24-
spl_autoload_register(function($class) {
25-
if (0 !== strpos($class, __NAMESPACE__.'\\')) {
26-
return;
27-
}
28-
$classPath = __DIR__ . '/' . str_replace('\\', '/', $class) . '.php';
29-
if (file_exists($classPath)) {
30-
// Disable old way to include class by classPath
31-
//include $classPath;
32-
33-
// Use Profiler function for load a class
34-
\SimpleProfiler\Profiler::loadFile($classPath);
35-
}
36-
}, false, true);
23+
// It is some function for loading your classes
24+
spl_autoload_register(
25+
function($class) {
26+
if (0 !== strpos($class, __NAMESPACE__.'\\')) {
27+
return;
28+
}
29+
$classPath = __DIR__ . '/' . str_replace('\\', '/', $class) . '.php';
30+
if (file_exists($classPath)) {
31+
// Disable old way to include class by classPath
32+
//include $classPath;
33+
34+
// Use Profiler function for load a class
35+
\SimpleProfiler\Profiler::loadFile($classPath);
36+
}
37+
},
38+
false,
39+
true
40+
);
3741
```
3842

3943
### Examples

0 commit comments

Comments
 (0)