Quality Assurance in PHP is a valuable but very rarely seen aspect. In a world focused on rapid deployment and a “ship now, worry later” mentality, a focus on quality is a rare sight, especially when dealing with the web. One of our authors recently directed my attention to Sebastian Bergmann’s
The fabled PHP 6 is long overdue. This unicorn of the web dev world has been “coming” for decades now, and it’s still not clear whether or not it’s actually something that’s going to happen in this decade, or just an idea, a fantasy of the PHP userbase. Minor versions like 5.4 > 5.5 and 5.5
In this part, we will have a look at how we can make sure people don’t have multiple accounts after signing into our application through different means.
If you allow users to sign up through different social networks and perhaps your own registration system, there is a good chance some users will have multiple accounts. How annoying can it be for a user who signed up through Facebook earlier, to come back later and log in through Twitter because he thought he used that one?We can prevent this by letting the user merge manually or try to use an automatic system to try and identify duplicated users.
I suggest a setup of two database tables. The first table is the general user table, which contains all information about the user.
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `password` varchar(255) DEFAULT NULL, `firstname` varchar(50) NOT NULL, `lastname` varchar(50) NOT NULL, `emailaddress` varchar(50) NOT NULL, `city` varchar(50) NOT NULL, `birtdate` date NOT NULL, `gender` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Note: As you can see, I used the fields that we also used in our
SocialLoginInterface. You might need more or less fields depending on your application. You even could decide to split this table in a
user_profiletable if you wish.
The second table contains all data regarding any third party logins the user used.
boosts in your PHP applications. Over the web you will easily find a lot of tutorials covering all the OpCache installation and configuration steps (it is enabled by default on 5.5, but can be installed as an extension on older versions). Read the article below to find the answers to some
application to work, our constructor will receive these 3 variables as parameters and set the properties. Until now, our code looks like this. <?php namespace SitePoint\SocialLogin\Google; use SitePoint\SocialLogin\Interfaces\SocialLoginInterface; class GoogleLogin implements
primitive, but due to backwards compatibility could not be solved sooner - Magento 2 will use ZF2, modern PHP and namespaces. Request Flow Let’s see how a Magento application handles a request starting from the main index.php file. Application Initialization 1) If you use Nginx, you should
. First, check out this Vimeo screencast on making your first Zephir extension. Creating your first PHP extension with Zephir from Phalcon Framework on Vimeo. Next, follow through the tutorial, read the docs, and play around. If you end up making anything other than what the tutorials teach
in this article won’t be strictly PHP related, but you can be sure they’ll bring your application to a whole new level if used properly. Note that we won’t be covering the usual stuff - fewer requests for CSS, JS and images meaning faster websites and similar hints are common knowledge. Instead, we’ll be focusing
- some quick tips (which is pretty much covered in above tutorials) then the code. You store you scripts under ~/.gnome2/nautilus-scripts Make sure you've got the php5-cli package installed ($ sudo apt-get install php5-cli) You need to add the PHP shebang line at the top of your script (I omitted