4
4
<a href =" https://packagist.org/packages/laracraft-tech/laravel-xhprof " ><img src =" https://img.shields.io/packagist/dt/laracraft-tech/laravel-xhprof " alt =" Total Downloads " ></a >
5
5
<a href =" https://packagist.org/packages/laracraft-tech/laravel-xhprof " ><img src =" https://img.shields.io/packagist/v/laracraft-tech/laravel-xhprof " alt =" Latest Stable Version " ></a >
6
6
<a href =" https://packagist.org/packages/laracraft-tech/laravel-xhprof " ><img src =" https://img.shields.io/packagist/l/laracraft-tech/laravel-xhprof " alt =" License " ></a >
7
+ <a href =" https://github.com/laracraft-tech/laravel-xhprof/actions/workflows/check_imports.yml " ><img src =" https://github.com/laracraft-tech/laravel-xhprof/actions/workflows/check_imports.yml/badge.svg?branch=1.x " alt =" License " ></a >
7
8
</p >
8
9
9
10
<!--
16
17
17
18
## Introduction
18
19
19
- Laravel XHProf provides you with a simple setup to profile your laravel application
20
- with the well known XHProf PHP extension originally developed by facebook .
21
- It also leads you through the steps to install XHProf UI, a UI to visualize, save and analyze the results
20
+ Laravel XHProf provides you with a simple setup to profile your Laravel application
21
+ with the well- known XHProf PHP extension originally developed by Facebook .
22
+ It also leads you through the steps to install XHProf UI, a UI to visualize, save, and analyze the results
22
23
of the profiling.
23
24
24
25
<p align =" center " >
@@ -27,8 +28,8 @@ of the profiling.
27
28
28
29
## Installation
29
30
30
- First you'll need to install the PHP extension.
31
- It's highly recommended using ondrejs ppa.
31
+ First, you'll need to install the PHP extension.
32
+ It's highly recommended to use ondrejs ppa.
32
33
It's well maintained and provides quite all PHP versions.
33
34
34
35
### Normal environment
@@ -38,13 +39,13 @@ If you have a normal PHP environment, just install the XHProf extension:
38
39
``` bash
39
40
sudo add-apt-repository ppa:ondrej/php
40
41
sudo apt-get update
41
- sudo apt-get install php php-xhprof graphviz
42
- # you can now check if the extension was successfully installed
42
+ sudo apt-get install php php-xhprof Graphviz
43
+ # You can now check if the extension was successfully installed
43
44
php -i | grep xhprof
44
45
# maybe restart your webserver or php-fpm...
45
46
```
46
47
47
- Note: we need graphviz to generate callgraphs.
48
+ Note: we need Graphviz to generate callgraphs.
48
49
49
50
### Laravel Sail environment
50
51
@@ -54,12 +55,12 @@ If you are using laravel sail, here's a setup for you:
54
55
sail up -d
55
56
sail artisan sail:publish
56
57
# in docker-compose.yml check wich php version is used under build->context (eg. ./docker/8.1)
57
- # if you know the php-version you can type:
58
+ # If you know the php-version you can type:
58
59
nano docker/< php-version> /Dockerfile
59
- # find the block where all php extionsions are installed and add "php<php-version>-xhprof graphviz \"
60
- # now you need to rebuild sail
60
+ # find the block where all php extensions are installed and add "php<php-version>-xhprof graphviz \"
61
+ # Now you need to rebuild the sail
61
62
sail down ; sail build --no-cache ; sail up -d # this may take a while...
62
- # you can now check if the extension was successfully installed
63
+ # You can now check if the extension was successfully installed
63
64
sail php -i | grep xhprof
64
65
```
65
66
@@ -79,7 +80,7 @@ https://www.php.net/manual/en/xhprof.requirements.php
79
80
80
81
``` bash
81
82
mkdir public/vendor ; git clone git@github.com:preinheimer/xhprof.git ./public/vendor/xhprof
82
- # if you havent already, I recommend adding public/vendor to your .gitignore
83
+ # If you haven't already, I recommend adding public/vendor to your .gitignore
83
84
echo " /public/vendor" >> .gitignore
84
85
```
85
86
@@ -88,11 +89,11 @@ echo "/public/vendor" >> .gitignore
88
89
Since the database table name,
89
90
which the UI package is using behind to store and read data from the database,
90
91
is hard coded to `` details `` and you already may have a table named like that,
91
- you may need to make some additional steps. If not, here at first the simple way:
92
+ you may need to take some additional steps. If not, here at first the simple way:
92
93
93
94
<br />
94
95
95
- #### In case you DON'T already HAVE an own `` details `` table in your database:
96
+ #### In case you DON'T already HAVE your own `` details `` table in your database:
96
97
97
98
``` bash
98
99
php artisan vendor:publish --provider=" LaracraftTech\LaravelXhprof\XHProfServiceProvider" --tag=" migrations"
@@ -102,7 +103,7 @@ php artisan migrate
102
103
103
104
#### In case you already HAVE an own `` details `` table in your database:
104
105
105
- I recommend to just use a different database.
106
+ I recommend just using a different database.
106
107
107
108
``` mysql
108
109
CREATE DATABASE xhprof ;
@@ -134,17 +135,17 @@ CREATE TABLE IF NOT EXISTS `details` (
134
135
) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
135
136
```
136
137
137
- Note: you also need to create a user which has privileges on that new database!
138
+ Note: you also need to create a user who has privileges on that new database!
138
139
139
140
### Config
140
141
141
142
Now let's configure some settings!
142
143
143
144
``` bash
144
145
cp public/vendor/xhprof/xhprof_lib/config.sample.php public/vendor/xhprof/xhprof_lib/config.php
145
- # 1. change the db credentials to your needs
146
+ # 1. Change the DB credentials to your needs
146
147
# 2. enable dot_binary section
147
- # 3. if you're local, set $controlIPs to false
148
+ # 3. If you're local, set $controlIPs to false
148
149
nano public/vendor/xhprof/xhprof_lib/config.php
149
150
```
150
151
@@ -154,7 +155,7 @@ Just set ``XHPROF_ENABLED=true`` in your .env file and
154
155
now every request you make to your application gets profiled. \
155
156
Visit `` <your-host>/vendor/xhprof/xhprof_html/ `` to see your profiling results.
156
157
157
- Happy analysing !
158
+ Happy analyzing !
158
159
159
160
160
161
<!--
@@ -173,7 +174,7 @@ composer test
173
174
174
175
## Security
175
176
176
- If you discover any security related issues, please email zacharias.creutznacher@gmail.com instead of using the issue tracker.
177
+ If you discover any security- related issues, please email zacharias.creutznacher@gmail.com instead of using the issue tracker.
177
178
178
179
## Credits
179
180
0 commit comments