background preloader

PHP

Facebook Twitter

HowToSetupDevelopmentEnvironmentWindows. This article explains how to setup a webserver, Eclipse (IDE), Debugging support (XDEBUG, how to setup breakpoint etc), SVN support on Windows. After following this article, you should be ready to start developing plugins or new features for Piwik, the open source web analytics platform'' UPDATE: You can also try the great tutorial on ​How To Setup a Free PHP Debugger using Eclipse PDT + XDebug Web Server ¶ You need php5 + Mysql + Apache 2 Download EasyPHP-2.0b1-setup.exe on ​ Install it. You can change the DocumentRoot value in the httpd.conf file to match your working directory (for example F:/piwik) IDE Eclipse ¶ You now need to get eclipse with PHP support.

Download Eclipse + PHP = PDT pdt-all-in-one-incubation-S20070910_RC1-win32.zip on ​ Unzip PHP Debugger Xdebug ¶ You need to download the Xdebug DLL for windows Copy the DLL in C:\Program Files\EasyPHP 2.0b1\php5\ext. Five common PHP design patterns. Editor's note: See the follow-up article "Five more PHP design patterns" to learn about five additional design patterns that you might find useful. Design patterns were introduced to the software community in Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (colloquially known as the "gang of four"). The core concept behind design patterns, presented in the introduction, was simple. Over their years of developing software, Gamma et al found certain patterns of solid design emerging, just as architects designing houses and buildings can develop templates for where a bathroom should be located or how a kitchen should be configured.

Having those templates, or design patterns, means they can design better buildings more quickly. The same applies to software. Design patterns not only present useful ways for developing robust software faster but also provide a way of encapsulating large ideas in friendly terms. The factory pattern The problem is tight coupling. PDO Tutorial for MySQL Developers - Hashphp.org. Why use PDO? Mysql_* functions are getting old. For a long time now mysql_* has been at odds with other common SQL database programming interfaces.

It doesn't support modern SQL database concepts such as prepared statements, stored procs, transactions etc... and it's method for escaping parameters with mysql_real_escape_string and concatenating into SQL strings is error prone and old fashioned. The other issue with mysql_* is that it has had a lack of attention lately from developers, it is not being maintained... which could mean things like security vulnerabilities are not getting fixed, or it may stop working altogether with newer versions of MySQL. Also lately the PHP community have seen fit to start a soft deprecation of mysql_* which means you will start seeing a slow process of eventually removing mysql_* functions altogether from the language (Don't worry this will probably be awhile before it actually happens!).

Connecting to MySQL old way: <? <? <? <? Error Handling <? <? <? <? <? Or <? <? <? Best way to stop SQL Injection in PHP.