Archive for August, 2013

Summary

Installing CakePHP instantly is the demand of the day in CakePHP developer community and composer can assists us a lot. We can manage multiple versions, plugins, and straight installation without the knowledge of complicated configurations with the help of composer.

Introduction

Generally, composer is consider as a package manager for PHP and good friend of PHP web developers in many ways. Nevertheless, this is not true at technical point of view because composer deals with packages or libraries but it manage them on per project basis, not anything globally. Moreover, it is installing packages in a directory inside your project. Thus, we can say that is truly a dependency manager, not a packages manager though it has inspired by node’s npm and ruby’s bundler (package managers).

In CakePHP development composer is helping us directly where our all CakePHP development projects are depending on the numbers of libraries. The real intricacy is that these libraries are again depending on the other libraries. Therefore, finding the things you depend on from such multiple stack is nothing but searching a needle in a haystack. Fortunately, composer can find out which version of which packages need to be installed ASAP, and it does that immediately for you.

At present, we won’t dive in coding part of composer but we will explore its capacities to manage CakePHP installation beautifully without any hurdle and wastage of time. Yes, it is true that composer can help us to install CakePHP, plugins and other vendor libraries. If we think only about the installation of CakePHP, we can say that we have two kinds of CakePHP developers who need the ultimate help of composer. The first group is consists of new developers who are not much familiar with command line setup and doesn’t know how to configure CakePHP installation righteously. Another group is of advance users who want to use CakePHP within next five minutes to start a project of a big clientele and using latest complicated configuration.

Fortunately, composer can help both groups to do things their own ways. In addition to these, composer solves our highly complicated problems related to multiple version installation. Using PEAR is a bit difficult without its advance knowledge. Therefore, depending on composer is the best idea for many seasoned CakePHP programmers too.

You can use composer along with PEAR packages where installing and managing plugins, vendor libraries, etc. far easier than we think. Let me tell that composer/installers can beautifully handles CakePHP plugins as well as can provide easy access to the robust external libraries of CakePHP.

Summary

Due to have, a big developer community PHP is suffering from the security related issues a lot. Therefore, it is advisable to use secure coding practices for all sort of PHP developments and save your website from the plenty of vulnerability. There are user input data checking system and keeping off the error reporting are among the most desirable security aspects.

Introduction

Among all the programming languages, PHP is the easiest one to learn and start coding if you have any programming background or not. You simply need some basic HTML coding knowledge and some ideas about the syntax of programming at basic level, and of course, plenty of learning stuff at your side, you can start website development or edit your existing site in order to add some interactive and dynamic pages.

At the flip side, coding done by a fresher or inexperienced programmers may prove their website vulnerable to malicious attacks or some security breaches. If you want to save your website from such vulnerability, you should know some rules of secure PHP development or coding practices. Therefore, in this series I would like to introduce you to some valuable tips and rules to do secure PHP programming.

Validate User Data

The first rule is to create a system that can check and prevent your website from the data input done by all the users of your website, without any exception. If you think your website is useless for hackers and don’t have any chances to have malicious user. You might going in wrong because if there is no bad intended user come on your site, but your good users can commit some mistakes that may cost you dearly.

Therefore, it is advisable to check each data entered or action done through effective security measures. Here simple client-side validations using some JavaScript like weak measure won’t work and you need some strong measures to avoid further security breaches. Thus, trusting any user is insane act at security point of view.

 Turn Off Error Messages

 For a PHP web developer error message is life line to get insight about the development and mistakes she had committed before. Therefore, we are keeping error messaging system turn on always during our PHP web development environment. That is good, but worst for a live website as it can handover all clues and information regarding to your code, documents and databases as well as related web applications in directly. Therefore, it is advisable that you set “error_reporting” to ‘0’ value in ,htaccess or php.ini files in source code.