PHP Debugging Create a Simple Library
File downloads and blog article at http://www.lonhosford.com/lonblog/2014/02/28/creating-a-simple-php-debug-library/
Creating a Simple PHP Debug Library
Produced By Lon Hosford
You are going to learn about a basic setup for handling debugging and testing in your PHP scripts.
This can help you get more work done and with better quality.
You can use this setup in both procedural and objected oriented PHP applications.
Also you might find this handy for PHP applications that you have inherited and did not leave you any breadcrumbs for testing and debugging.
We start by looking at the script serving as a central point for all debugging and testing.
Consider it your debugging dashboard.
At a minimum you want a quick way to display key information:
For example we are displaying the PHP versions both expected and detected.
You want to add the same information for other libraries and technologies you are using as well.
For example a database like MySQL.
You also want to see the PHP date and time setting for your target time zone.
And key PHP debugging settings.
All of these we will explore in the code.
As you proceed with development, you then add links to the debugging dashboard for testing your code.
The effort to design your code to run from one or more test links on the debugging dashboard, forces you to build smaller testable code units.
For example a database login script, you might add a link for a valid login,
a link for invalid user name,
a link link for an invalid password,
maybe a small form to let you try any testing values
and so on for all the tests that need checking when your code changes.
Also you want a library for configuring your debugging environment.
For example you would use it to turn on and off debugging messages.
When you go to deploy to other environments such as staging or production, you can quickly visit the library and configure the debugging options appropriate for that environment.
For example you can turn on or off the PHP option to return its errors along with the content output.
Something good for debugging but not so good for your web site visitors.
At a minimum you want a quick way to display key information: about the running software environment, tests you are running, and debugging choices.
For example we are displaying the PHP versions both expected and detected.
You want to add the same information for other libraries and technologies you are using as well.
For example a database like MySQL.
You also want to see the PHP date and time setting for your target time zone. And key PHP debugging settings.
As you proceed with development, you then add links to the debugging dashboard for testing your code.
The effort to design your code to run from one or more test links on the debugging dashboard, forces you to build smaller testable code units.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «PHP Debugging Create a Simple Library», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.