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
using buildpacks - sets of open source code that describe how a slug is to be generated. Here’s an example of a PHP buildpack. Heroku uses “dynos” as units of computing power which spin up your slugs. Dynos are lightweight, isolated containers for your apps which can execute any process type
: For our demonstration, I created a subfolder Laravel under Code in the VM, added a subfolder called “public”, and put an index.php file inside with the following content: <?php echo "Hello Test"; In homestead.yaml, I called this site “homestead.app”, and in my hosts file on my
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
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
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
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