This debugger for PHP gives you the ability to inspect and understand what is going on in your application. It helps you to develop your code, improve the processes, increase the security and build a greener environment!
* yes, we don't need Internet Explorer 6 for PHP development!
This debugger is build with serveral interacting technologies. The core element is a PHP based function, which can be integrated into the application files. This function can be used to inspect PHP elements at nearly every point of code. Finally the function will be executed again as shutdown function after the application is finished. At this point an HTML output is generated and placed at the end of the server response to the browser.
We aim to fulfil the needs of PHP development by testing the application in Google’s Chrome Browser and Mozilla Firefox, because we consider them the most common browsers in web development. The application will run in Microsoft’s Internet Explorer as well, but this browser is not supported primarily.
You might be asking yourself how a debugger can help to develop software and support the developer?
There are many kinds of different PHP projects out in the world and every project has its own requirements for debugging and quality insurance. But every project has common problems like the first implementation or the debugging of an old application when the original developer is not longer available! Commonly it requires a lot of time to set up a debugging / development environment or to analyse an existing PHP application. You have to install server and / or client software to do so, finally it will cost money and time.
Imagine there would be a single file which you can place in your web directory, include it into the program code before the first output comes and the only thing to do is to switch it on. You don't have to touch your server configuration, you don't have to install a client application or an over sized IDE (Integrated Development Environment) for this case. Only access to the web directory and a supported web browser is required, sounds beautiful?
If you like this imagination, you could understand the idea and the simplicity of the xn.debug function.
Most of the debuggers print their output directly into the HTML page and destroy the present layout, or cause problems by overlaying the original CSS-styles with their own. In order to avoid harming the present layout, the debugging output needs to be printed to a separate client software then.
The xn.debug outputs its data directly into a virtual debugging window inside the current HTML document, without affecting the page layout, and without the need for additional client software.
Did you ever experience debugging output inside a productive environment or at a customer presentation? Then you know how convenient it could be to disable all this kind of messages with a central switch! The debugger is build to work only if you want him to work. Not only the output will be hidden, the whole function will refuse the work and just give back what it takes, with nearly none performance lost. So if you decide to measure your PHP performance with an external tool, you can switch of the debugger and will get realistic results.
There is no need to remove every single debug function call from your application. You can remove them when you go live with your application or just replace the debug function with a simple mockup function which returns the first argument. This makes it very easy to write the function call in a single line or just around a functions argument inline.
This tool is developed to optimize the development process and to support the developer. Sparing the developer to be tied up with maintenance will save time and money!
You might be asking yourself how a debugger can help to improve software and its development process?
Many interesting insights can be found within this debugger: the idea was to present relevant information just when needed. Given variables are analysed and linked to their occurrences. Files can be browsed and opened directly into the debugger window for viewing and verifying that every file is at the right place. An integration of php_info() provides fast access to the system configuration and the possibility to inspect the installed modules. The request of your PHP script is described within the system area, where you can see every given parameter, so that you don't have to manually inspect each global variable.
These are only few features of the current debugger, but you can imagine how fast a developer can learn about the environment in which he is moving and deepen his insight on how PHP really works. Getting the information you need faster, will result in an improved development process!
A good quality can be reached, when errors and mistakes are identified in an early stage of development. The integrated error handler helps to identify minor and major bugs from the beginning. The content of a variable or the response of a function can be validated early, by inspecting them in the debugger.
Sure, it can't replace unit tests but it will improve the process to bring stable code into the tests, before they throw exceptions.
The integrated performance monitor keeps track of the memory used and of execution time. Every debugger event will cause a measuring point to be created, helping to analyse the executed PHP application from the initialisation to the output of your script. This makes it very easy to see how much resources your application needs and find potentially bottlenecks. The result is displayed within a diagram directly into your browser whenever your need.
Of course the debugger uses the same resources like your application, but the main load is addressed after your script was done.
This tool is developed to help constant code improvement and to identify potentially problems early.
You might be asking yourself how a debugger can help to produce secure software?
It is always important to verify that your expectations are proofed. The best point to do so is to inspect the behaviours while developing. No matter what kind of behaviour should be watched, you can inspect nearly every part of the application with this debugger. Most of the applications have central services like database interfaces which can easily be watched by passing the query to the debug function. Measure which and how many calls are running through your functions or just verify a single given value. Keeping track of the data flow within your application will result in a better understanding and increase the security, because every value can be verified.
Finding bugs can be an obfuscating task, especially when they are hiding in applications supposed to be stable. It is always easy to install the debugger, even in existing applications. You can analyse your code step by step, needing only a web browser and access to the file system, which is given in most development environments. The debugger provides extensive information related to your trace, so that you can easily investigate your presumptions and save a lot of time.
There are several known methods to identify security issues and to avoid them, but time limitations due to commercial aspects are often conflicting with development best practice, so that developers under pressure may not see a leak when it occurs. The debugger is trying to help the developers is such situations with detailed information and a complete picture of the running script. It shows which parts of the application are involved and what information is going in and out on the server. This should help preventing security issues, before the pressure is too high.
Preventing security leaks is a never ending story, some people would say that it is impossible to write 100% secure code, but we should do our best to reach such a high security level.
You might be asking yourself how a debugger can help to produce greener software?
As little as possible - as much as necessary! Keep your application clean, identify complex structures and try to find simpler solutions. It is very easy to compare different solutions and get direct information about the resource usage with time and memory measurement within the debugger.
Simple software takes less effort to use and develop it. Most of the use cases need clever solutions to use the given resources and to find the most efficient way. The debugger can also help you to identify bottle necks and forgotten memory eaters.
Improve the performance by analysing the application workflow with the history panel, mark common events like function calls with the debugger and compare the statistics. The debugger notes the current memory usage and micro time, when it was called to give you an individual overview of the application just in the case you need.
Use the performance or system panel of the debugger to see the resource usage, even every message gives you details about the included files in your application.
The performance panel gives you a total overview about the used and available system resources like hard disk space, memory usage and time limits. You can easily see if your application gets close to the system limitations.
Making software more green helps saving costs, time and resources. Optimizing existing applications could save you from buying expensive high performance server. Green software could be a significant competitive advantage and is even better for our environment!