Application Architecture

In this section, you will find articles, tutorials, and snippets covering all areas of Application Architecture in PHP.

Other Categories: Databases, News, Pear, PHP Functions, Setup & Installation, Site Operation, Tools, Tricks & Hacks.

Results via Envato Market

PHP has always had a few simple ways to implement password hashing to an extent. MD5 and SHA1 are examples of this, but the security of these methods is not what it should be. Many developers use MD5 and SHA1 without even adding a SALT, which is a string that helps to add complexity to the application. Some developers use something as awful as base 64 encoding and decoding simply because they can be easily manipulated. But these things are not secure folks, and the clever people who want to hack your site or steal your money can see right through them. Yes, they can.

Debugging is one of the most important and significant part of software development. Finding bugs and errors in any application is a tedious task for the developers. So, proper debugging mechanism should be adopted to make the process easier. Without following proper debugging process, software bugs and errors can not be detected easily and efficiently. As per PHP programming model, we should be aware of all the tools available for debugging and eliminating malfunctioning components from our software system. In this article we will concentrate on the core PHP debugging process. The core mechanism consists of the process of using the program to trace errors and discrepancies. The out-put is gathered through the script execution and displayed at the end of the script.

One way of constructing the mock object is to replace functions with stubs that just return NULL. This is useful for utility functions that call an external resource such as an API or database. This is useful for when you don’t care what comes back, but the code you are testing calls a function that needs to be accounted for.

A developer may consider his code as perfect if it runs successfully without any compile-time or run-time error. But there is always a scope of improvement in working code and refactoring improves the structure of existing code. The code, if not improved, may hamper the performance of an application considering factors such as memory, speed, reusability, etc.

One of the common problems with PHP used to be that if you chose to use a particular framework, you were only able to use the libraries and plugins that are made specifically for that PHP framework. It was difficult to switch the frameworks or to re-use the code between frameworks. However, PHP has experienced major changes recently. Composer, a package manager widely used by PHP developers, and latest generation frameworks, such as Laravel and Symfony, have enabled PHP developers to create framework-agnostic packages.