PHPackages                             jaroslawzielinski/diagnostics-m2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jaroslawzielinski/diagnostics-m2

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

jaroslawzielinski/diagnostics-m2
================================

This module is for diagnostics in project

1.2.20(2mo ago)22742MITPHP

Since Apr 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/JaroslawZielinski/Diagnostics-M2)[ Packagist](https://packagist.org/packages/jaroslawzielinski/diagnostics-m2)[ Fund](https://www.buymeacoffee.com/jaroslawzielinski)[ RSS](/packages/jaroslawzielinski-diagnostics-m2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (49)Used By (0)

Diagnostics-M2
==============

[](#diagnostics-m2)

a diagnostic module in magento2 project that can be used as a scaffolding for Your new code.

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/jaroslawzielinski)

Why do you need this module in Your Project?
--------------------------------------------

[](#why-do-you-need-this-module-in-your-project)

### Introduction

[](#introduction)

Have you ever needed to...

- ...test/debug a part of Your code using separate controller in the backend area?
- ...test/debug a part of Your code using separate controller in the frontend area?
- ...test/change something in the database really quick using shell command?
- ...test some of Your frontend work like js/css/html in some separate place of the project and keep it there for some time?
- ...fix something in the project for some reason only locally and you did not know where to put it?
- ...do any from the above issues plus having dedicated configuration for it?
- ...do any from the above issues plus having the changes only in local env without repo modification?

If Your answer is yes for any of these, and additionally You recall it happend more then once or it happens often, please acknowledge that this diagnostic module is for You and is for free.

It will help You in Your work and You will find it usefull in any kind of magento2 project.

### Overall idea of the module

[](#overall-idea-of-the-module)

You will install the core module via composer require --dev call. This way this module will not be in repo in the production mode.

You will override the core module by your own Vendor\_Diagnostics module (The core module is only the basis for Your Custom Code added to Vendor\_Diagnostics module).

You will add all of Your changes to .git/info/exclude if you are a git user:

```
echo "app/code/Vendor/Diagnostics/" >> .git/info/exclude
```

### What do You gain by using the Diagnostic Module?

[](#what-do-you-gain-by-using-the-diagnostic-module)

You will have an easy way to test/debug backend controller (1.), frontend controller in new tab (2.) and view/edit Your dedicated configuration (3.) in the admin panel from the menu. You may do it all from one place, without affecting the repo (You may change Your branches, and the module will stay there, all the time unaffected...). See the screenshot below:

[![](docs/module_in_admin.png)](docs/module_in_admin.png)

Also you have a CLI command that you may use/modify whatever way You like:

```
bin/magento jaroslawzielinski:diagnostics:test --help
```

or after overriding **getName** and **getDescription** methods you may use e.g. this way:

```
bin/magento vendor:diagnostics:customer --help
```

How to install the Diagnostic Module via shell (1 Step out of 3)
----------------------------------------------------------------

[](#how-to-install-the-diagnostic-module-via-shell-1-step-out-of-3)

in [packagist](https://packagist.org/packages/jaroslawzielinski/diagnostics-m2)

```
cd YourProject
composer require --dev jaroslawzielinski/diagnostics-m2
```

How to override the core module by Your Custom Code (2 Step out of 3):
----------------------------------------------------------------------

[](#how-to-override-the-core-module-by-your-custom-code-2-step-out-of-3)

### Create a module (see [docs/module.zip](docs/module.zip)):

[](#create-a-module-see-docsmodulezip)

#### Vendor/Diagnostics/registration.php

[](#vendordiagnosticsregistrationphp)

```

```

### Override Admin Panel Configuration:

[](#override-admin-panel-configuration)

#### Vendor/Diagnostics/etc/adminhtml/system.xml

[](#vendordiagnosticsetcadminhtmlsystemxml)

```

                    My option

```

#### Vendor/Diagnostics/etc/config.xml

[](#vendordiagnosticsetcconfigxml)

```

                Test]]>

```

#### Vendor/Diagnostics/Model/Config.php

[](#vendordiagnosticsmodelconfigphp)

```
