The PHP Roundtable podcast, hosted by Sammy Powers, has a new show posted (#21) staring off a series about moving from just an idea to a production application. His guests for this episode are Steven Maguire, Jocelyn Lopez and Glen Hinkle.
We discuss an idea for a web app and identify ways to turn it into a real-life product on the web.
We start with describing the domain and the problems the app should solve. Then we identify the personas that will interact with the app. We discuss the features features the app should have to fix the problems and we sort all the features by priority. Finally we talk about timeline, deliverables and next steps. The app we discuss will be launched to production by the next airing of this multi-part series of taking an idea to code.
You can watch this latest episode either through the in-page video player or directly over on YouTube
A new guide has been posted showing you how to create custom OAuth2 providers for your Laravel application. In this case they wanted to hook the application in via Socialite to the VK social network but needed a custom connector to make it happen.
First of all let’s say that social authorization is very popular and frankly speaking it’s really handy tool. Surfing internet we can see a lot of sites and services which offer login with Facebook, Twitter, Google and other social networks. […] If you’re building your website in PHP using Laravel, probably you’ve noticed Socialite which provides OAuth / OAuth 2 authentication with Facebook, Twitter, Google, and GitHub. The most famous social network which provides OAuth2 authentication in Russian segment of the internet is vk. But there is a lack of such connector (provider) in Socialite library. Actually it’s not a hard problem, so let’s build new VkProvider on top of Socialite’s components.
He starts with a brief look at the typical OAuth2 authentication flow between the social network and your application. From there it gets more vk.com specific. He shows how to set up the custom application on their side, updating your configuration with the credentials and installing Socialite. He then implements a „VkProvider“ defining the required methods based on the interface. He then registers it as a „SocialiteServiceProvider“ and uses it in a „login“ request route.
In a recent post Nate Krantz has shared some of his own methods around writing functional and unit tests.
So…testing. That thing that everyone says is so important but you don’t really learn about it in school. I’ve had some trials and tribulations with testing so I’m going to just dump out some thoughts here.
He starts with a bit of background on his own experiences in development and how he finally decided that testing would „solve everything“. He started with unit tests (for a CodeIgniter application) and how he got them up and running. He talks about issues he found around dependencies (and static methods) and how he made use of mocks to reduce some of the issues with dynamic loading, at least how CodeIgniter does it. Unfortunately, this didn’t work out as planned so he fell back to a test database and create more effective and simpler functional tests. Code examples are sprinkled through out the post to show how he was trying to solve the problem at different points in the process.
Ross Tuck has posted a new article to his site today talking about how he uses traits in his applications and where he sees them having the most value.
Recently, a few folks asked about a trait in a new project I wrote. Right around the same time, Rafael Dohms showed me his new talk about complex cognitive processes we don’t notice. Because my brain is a big mushy sack, the two blended together. The result was this post, which tries to capture how I use traits but also how I decide to use them in the first place.
He starts off with a bit of talk about leverage versus abstraction and how the concepts relate to code. He includes a brief example of each and points out that, while each is good, abstraction tends to be more useful. He then applies this back to the world of traits, how they compare to the use of normal static methods and how they have an advantage of encapsulation without oversharing. He suggests that assertions are more fit as static methods and that traits are a better fit in cases where multiple inheritance is needed. He also touches in interfaces in traits and his opinion on when is the best time to use them.
The Laravel Podcast, with host Matt Stauffer and guests Taylor Otwell and Jeffrey Way, has posted their latest episode (#27): Jeffrey Way: Tau Ceti Murderer.
This week the crew discusses new Laravel 5.1 goodies, unit testing, Lifeline for iOS, and which album they would take to a desert island.
You can listen to this new episode using the in-page audio player or by downloading the mp3. If you enjoy the show, be sure to subscribe to their feed too and get more great episodes as they’re released.
The SitePoint PHP Blog has a new tutorial by Yones Rafie showing you how to log more effectively with Loggly, a remote log management service that’s easy to connect to your PHP application. (Note: this post is sponsored by Loggly but it’s still an interesting tool.)
When logging with PHP, we tend to use the error_log and trigger_error functions, or we can use an error handler to make the logging process more generic. […] But what would you do if you had to log to multiple places at the same time, or you were sending logs to a given service depending on the error level? Rather than using built-in tools, it’s often easier to use logging libraries.
They go on to talk about logging using a PSR-3 compliant logger and show how to integrate the Loggly service with your application via one of the most popular options, Monolog. The integration is made even easier by the fact that Monolog already comes with a LogglyHandler built-in. The post includes the code you’ll need to implement the logger, how to integrate it with a Laravel application, setting it up on Heroku and and a tour of the Loggly features for filtering, searching and examples of the graphs showing query results. Loggly is free to try out, so you can see if it will work for your application before making the commitment.
The Knp University site there’s a new post showing you an interesting thing you can do with Symfony2 service definitions – use more complex expressions to load and supply service dependencies.
[Using] the @= means that you’re using Symfony’s Expression Language, which let’s you mix dynamic logically into your normally-static service definitions. Normally, if you want to inject a repository, you need to register it as a service first, using a factory. And while that’s fine (and probably better if you’re injecting the factory a lot), using the expression language is well, kinda cool.
They include an example of the compiled container code that would be produced from the example expression. They also show how to use the same expression language to read configuration information and pass it in as an argument to the created service. The show the pull of a configuration setting „email_from_username“ and how to inject it via the expression language.
The PHP Roundtable podcast has posted their latest episode hosted by Sammy Powers and featuring guests Michael Kimsal, Gary Hockin, Yitzchok Willroth and Matt Stauffer. In this new episode they talk about the „Business of PHP“.
We discuss freelancing as a PHP developer, managing client expectations, niches, good customer service, project scope & scope creep, hourly rates vs value based pricing, and whether or not to run a SaaS.
You can catch this latest episode either through the in-page video player or by heading over to YouTube and catching the video there. If you enjoy the roundtable, be sure to subscribe to their feed.