From 9a58d4bc08b79c6ce92ac52520d9adbb2b6f4a96 Mon Sep 17 00:00:00 2001 From: Iman Date: Sat, 6 Apr 2024 22:46:11 +0330 Subject: [PATCH 1/3] Create check_imports.yml --- .github/workflows/check_imports.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/check_imports.yml diff --git a/.github/workflows/check_imports.yml b/.github/workflows/check_imports.yml new file mode 100644 index 0000000..08ec978 --- /dev/null +++ b/.github/workflows/check_imports.yml @@ -0,0 +1,33 @@ +name: Check Imports + +on: + push: + branches: [ "1.x" ] + pull_request: + branches: [ "1.x" ] + +permissions: + contents: read + +jobs: + check_imports: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress && composer require imanghafoori/php-imports-analyzer --dev + + - name: Check Imports + run: ./vendor/bin/check_imports From c395e3ea551a52180e240421617de0175a849da9 Mon Sep 17 00:00:00 2001 From: Iman Date: Sat, 6 Apr 2024 22:54:18 +0330 Subject: [PATCH 2/3] fix typos in readme.md --- readme.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/readme.md b/readme.md index a17a5ab..563d544 100644 --- a/readme.md +++ b/readme.md @@ -16,9 +16,9 @@ ## Introduction -Laravel XHProf provides you with a simple setup to profile your laravel application -with the well known XHProf PHP extension originally developed by facebook. -It also leads you through the steps to install XHProf UI, a UI to visualize, save and analyze the results +Laravel XHProf provides you with a simple setup to profile your Laravel application +with the well-known XHProf PHP extension originally developed by Facebook. +It also leads you through the steps to install XHProf UI, a UI to visualize, save, and analyze the results of the profiling.

@@ -27,8 +27,8 @@ of the profiling. ## Installation -First you'll need to install the PHP extension. -It's highly recommended using ondrejs ppa. +First, you'll need to install the PHP extension. +It's highly recommended to use ondrejs ppa. It's well maintained and provides quite all PHP versions. ### Normal environment @@ -38,13 +38,13 @@ If you have a normal PHP environment, just install the XHProf extension: ``` bash sudo add-apt-repository ppa:ondrej/php sudo apt-get update -sudo apt-get install php php-xhprof graphviz -# you can now check if the extension was successfully installed +sudo apt-get install php php-xhprof Graphviz +# You can now check if the extension was successfully installed php -i | grep xhprof # maybe restart your webserver or php-fpm... ``` -Note: we need graphviz to generate callgraphs. +Note: we need Graphviz to generate callgraphs. ### Laravel Sail environment @@ -54,12 +54,12 @@ If you are using laravel sail, here's a setup for you: sail up -d sail artisan sail:publish # in docker-compose.yml check wich php version is used under build->context (eg. ./docker/8.1) -# if you know the php-version you can type: +# If you know the php-version you can type: nano docker//Dockerfile -# find the block where all php extionsions are installed and add "php-xhprof graphviz \" -# now you need to rebuild sail +# find the block where all php extensions are installed and add "php-xhprof graphviz \" +# Now you need to rebuild the sail sail down ; sail build --no-cache ; sail up -d # this may take a while... -# you can now check if the extension was successfully installed +# You can now check if the extension was successfully installed sail php -i | grep xhprof ``` @@ -79,7 +79,7 @@ https://www.php.net/manual/en/xhprof.requirements.php ``` bash mkdir public/vendor ; git clone git@github.com:preinheimer/xhprof.git ./public/vendor/xhprof -# if you havent already, I recommend adding public/vendor to your .gitignore +# If you haven't already, I recommend adding public/vendor to your .gitignore echo "/public/vendor" >> .gitignore ``` @@ -88,11 +88,11 @@ echo "/public/vendor" >> .gitignore Since the database table name, which the UI package is using behind to store and read data from the database, is hard coded to ``details`` and you already may have a table named like that, -you may need to make some additional steps. If not, here at first the simple way: +you may need to take some additional steps. If not, here at first the simple way:
-#### In case you DON'T already HAVE an own ``details`` table in your database: +#### In case you DON'T already HAVE your own ``details`` table in your database: ``` bash php artisan vendor:publish --provider="LaracraftTech\LaravelXhprof\XHProfServiceProvider" --tag="migrations" @@ -102,7 +102,7 @@ php artisan migrate #### In case you already HAVE an own ``details`` table in your database: -I recommend to just use a different database. +I recommend just using a different database. ``` mysql CREATE DATABASE xhprof; @@ -134,7 +134,7 @@ CREATE TABLE IF NOT EXISTS `details` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ``` -Note: you also need to create a user which has privileges on that new database! +Note: you also need to create a user who has privileges on that new database! ### Config @@ -142,9 +142,9 @@ Now let's configure some settings! ``` bash cp public/vendor/xhprof/xhprof_lib/config.sample.php public/vendor/xhprof/xhprof_lib/config.php -# 1. change the db credentials to your needs +# 1. Change the DB credentials to your needs # 2. enable dot_binary section -# 3. if you're local, set $controlIPs to false +# 3. If you're local, set $controlIPs to false nano public/vendor/xhprof/xhprof_lib/config.php ``` @@ -154,7 +154,7 @@ Just set ``XHPROF_ENABLED=true`` in your .env file and now every request you make to your application gets profiled. \ Visit ``/vendor/xhprof/xhprof_html/`` to see your profiling results. -Happy analysing! +Happy analyzing!