News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
5 Easy Ways to Get Started with PHP on Vagrant
October 30, 2014 @ 10:44:49

On the SitePoint PHP blog there's a new tutorial showing you how to get started with Vagrant and PHP to create easier, more flexible development environments via virtual machines.

Vagrant is a tool for creating and managing virtual environments that help many developers not have to care about the "works on my machine…" problem. Vagrant creates reusable development systems that can be used again and again, helping you keep your system clean of too many installations.

They offer "five easy ways" to get started including various tools and services:

You can find summaries about each of the items on the list as well as links to more information in the full post.

0 comments voice your opinion now!
vagrant introduction getstarted service tool virtualmachine vm development

Link: http://www.sitepoint.com/5-easy-ways-getting-started-php-vagrant/

SitePoint PHP Blog:
Where are you? Implementing geolocation with Geocoder PHP
October 23, 2014 @ 11:45:17

The SitePoint PHP blog has a new tutorial posted by Arno Slatius showing you how to use geocoding in PHP to find the latitude and longitude of a point given its address or name. He makes use of the geocoder-php library to make things a bit simpler.

The beauty of SitePoint, to me, is that you can get inspired to try something or be told about some cool project out there. The internet is simply too big for one person to scout out on their own. Geocoder was one of those for me. I had never heard about it and came across it on the authors Trello board. I love working with maps and geographic information and I use (reverse) geocoding heavily for a project I did for a client; CableTracks. [...] I found out that Geocoder PHP actually is what I was missing for the integration of various services that we use.

He starts by helping you get the library installed (either via Composer or manually) and the creation of a simple Google Maps goecode request for a location. He includes an example of the results and mentions how the library handles locales in both the input and output. He also shows how the tool lets you do reverse geocoding - given a latitude and longitude, it can provide you address and location information. It also includes lookup support for IP addresses and output formatting and examples using both are also included.

0 comments voice your opinion now!
geolocation geocoder tutorial library introduction geocoderphp

Link: http://www.sitepoint.com/implementing-geolocation-geocoder-php/

NetTuts.com:
Basic Functional Testing With Symfony 2's Crawler
October 23, 2014 @ 10:21:33

In this new tutorial on the NetTuts.com site Andrew Perkins shares a way that you can use Symfony2's own Crawler to do some simple functional testing.

Testing your web applications is one of the best things you can do to ensure its health, safety, and security, both for the app and your app's visitors. Symfony 2 offers a complete integration testing suite that you can use to make sure your applications run just as you expect. Today we'll look at how we can use Symfony 2 and PHPUnit, the testing framework that it employs, to write basic functional tests using the Crawler.

He starts off by helping you get a Symfony2 instance installed, the Standard edition, and grabbing the latest PHPUnit phar file from the project's site. He then gets into the actual development of the Crawler bundle, using the command line Symfony tool to do some of the automatic code generation for you. They show how to execute the PHPUnit tests and make the first controller/action/routes for the sample pages to test. He then makes the first test file, extending the "WebTestCase" class from the Symfony2 components. He makes a simple client, executes the request and shows how to test various parts of the response (including an example of mimicking the clicking of a link).

0 comments voice your opinion now!
crawler symfony2 functional testing tutorial introduction

Link: http://code.tutsplus.com/tutorials/basic-functional-testing-with-symfony-2s-crawler--cms-20666

NetTuts.com:
Design Patterns The Facade Pattern
October 20, 2014 @ 13:17:46

NetTuts.com has continued their series covering common design patterns and their implementation in some example PHP scripts today. In their latest post they focus on the Facade pattern, a member of the "structural" family of patterns.

When it comes to design patterns, you may have questions: Why should we use design patterns in programming? Our code can work just fine without it. [...] Code that employs design patterns is easy to understand, easy to maintain, and easy to extend.[...] In this tutorial, we are going to cover the facade design pattern. It falls under the category of structural patterns because it deals with how your code should be structured to make it easily intelligible and keep it well maintained in the long term.

They start with a UML layout of a typical Facade and include a typical problem/solution where it could be used. They get into a code example that creates a simple checkout process. In this process, they use the Facade pattern to create a more maintainable, extensible ordering workflow.

0 comments voice your opinion now!
designpattern facade introduction tutorial uml series

Link: http://code.tutsplus.com/tutorials/design-patterns-the-facade-pattern--cms-22238

SitePoint PHP Blog:
How to use RabbitMQ with PHP
October 17, 2014 @ 12:43:04

The SitePoint PHP blog has published a new tutorial today by Miguel Ibarra Romero introducing you to the RabbitMQ queuing tool and shows you how to use it in PHP-based applications via the php-amqplib library.

AMQP (Advanced Message Queueing Protocol) is a network protocol that can deliver messages from one application endpoint to another application endpoint. It does not care about the platform or language of said applications, as long as they support AMQP. [...] The advantage of having a message broker such as RabbitMQ, and AMQP being a network protocol, is that the producer, the broker, and the consumer can live on different physical/virtual servers on different geographic locations.

With some of the introductions out of the way (common terms, flow of the data, etc) he walks through the installation of the RabbitMQ software on your system. He uses a Ubuntu install, but the commands could be easily ported for other distributions. From there he shows how to install the PHP library and a simple example of a pizza ordering system where orders are sent to be processed offline. Complete code is included to make the "SimpleSender" class and push the request out to the queue. With that working, he also shows how to create a SimpleReceiver class that consumes the data from the queue and sends the data to be processed.

0 comments voice your opinion now!
rabbitmq tutorial introduction installation library phpamqplib

Link: http://www.sitepoint.com/use-rabbitmq-php/

NetTuts.com:
Unit Testing Succinctly Why Unit Test?
October 16, 2014 @ 12:06:05

NetTuts.com has kicked off a new series of posts today that answers the question "Why unit test?" The series, Unit Testing Succinctly aims to define what unit testing is, approaches to implementing them and what they can do to help you and your application.

The usual mantra we hear regarding any software methodology is that it improves usability and quality, reduces development and testing time, and brings the product to market faster and with fewer bugs. These are lofty goals, but I have yet to see a methodology deliver the Grail of software development. Ultimately, the primary reason to write unit tests is to prove correctness, and this happens only if you write unit tests well.

In this first post they cover three of the more general reasons for making the dive into unit testing your applications at all. These are more "business value" kinds of ideas but they trickle down into the development level, providing value for the developers too.

  • Measuring Correctness
  • Repetition, Repetition, Repetition
  • Code Coverage

Their main point to reinforce is the first of the three, though. Unit testing helps to measure and ensure correctness of both the code itself and the functionality it performs.

0 comments voice your opinion now!
unittest introduction why correctness coverage repeatability

Link: http://code.tutsplus.com/articles/unit-testing-succinctly-why-unit-test--cms-22410

Matt Stauffer:
Laravel 5.0 - Middleware (replacing Filters)
October 15, 2014 @ 10:18:00

In a new post to his site Matt Stauffer looks at a feature of the upcoming version 5 of the Laravel framework, middleware, and how it will replace the current Filter handling. This is part nine in a series about the new features coming in Laravel (the rest are linked at the top of the article).

If you've been following along with my previous blog posts about Laravel 5.0, you may have noticed that route filters were first moved to be their own directory and class structure, and then eventually they mysteriously disappeared. You may have even noticed that references to Middleware showed up in their place.

He starts off by defining what "middleware" actually is and how it fits into the overall execution flow of the application. He describes it as "a series of wrappers around your application that decorate the requests and the responses in a way that isn't a part of your application logic." He then gets into the code examples, showing how to write a simple Laravel-friendly middleware that blocks odd port requests to the application. He includes the configuration updates to integrate it, how to control where it runs and using before and after "filters" inside the middleware.

0 comments voice your opinion now!
series part9 tutorial laravel framework filter middleware introduction

Link: http://mattstauffer.co/blog/laravel-5.0-middleware-replacing-filters

NetTuts.com:
Laravel, BDD And You Let's Get Started
October 10, 2014 @ 12:53:57

On NetTuts.com they've kicked off a new series of tutorials teaching you about Laravel development but using the principles and testing of behavior-driven development (BDD). In this first part of the series they get you started with the basic environment and a few simple tests.

Welcome to this series about developing Laravel applications using a behavior-driven development (BDD) approach. Full stack BDD can seem complicated and intimidating. There are just as many ways of doing it as there are developers. In this series, I will walk you through my approach of using Behat and PhpSpec to design a Laravel application from scratch. There are many resources on BDD in general, but Laravel specific material is hard to find. Therefore, in this series, we will focus more on the Laravel related aspects and less on the general stuff that you can read about many other places.

He talks about what it means to "describe behavior" versus other kinds of testing and introduces the sample application they'll be creating to show these principles: a time tracker. Following this, they help you install the needed tools (via Composer) and initialize the directory to be ready for the Behat/Phpspec tests you'll create. An example of a basic Feature is included, testing the initial Laravel "Welcome" page it defaults to and how to execute it. Finally, following the ideals of BDD, they show how to implement the "Given I am logged in" step first in the test then in the Laravel application.

0 comments voice your opinion now!
laravel bdd introduction series install configure feature loggedin

Link: http://code.tutsplus.com/tutorials/laravel-bdd-and-you-lets-get-started--cms-22155

SitePoint PHP Blog:
Build your own PHP Framework with Symfony Components
October 03, 2014 @ 09:12:05

On the SitePoint PHP blog today there's a post introducing you to the concept of building a framework with Symfony components, using only the ones you need from the Symfony framework ecosystem to create a customized framework to fit your needs.

You've probably met Symfony in your PHP career - or have at least heard of it. What you may not know is that Symfony is, at its core, composed of separate libraries called components, which can be reused in any PHP application. For example, the popular PHP framework Laravel was developed using several Symfony components we will also be using in this tutorial. The next version of the popular CMS Drupal is also being built on top of some of the main Symfony components. We'll see how to build a minimal PHP framework using these components, and how they can interact to create a basic structure for any web application.

He covers some of the main parts of the framework, how to grab the components that will help with some of the common functionality and integrating them to work together. He uses the HttpFoundation, HttpKernel, Routing and EventDispatcher (along with their own dependencies) to create a simple example that will respond to a few different route requests.

0 comments voice your opinion now!
framework components symfony tutorial introduction custom

Link: http://www.sitepoint.com/build-php-framework-symfony-components/

Piotr Pasich:
Rabbit behind the scenes
October 01, 2014 @ 12:19:53

In a recent post to his site Piotr Pasich shares an article about using a rabbit behind the scenes - making use of the RabbitMQ queuing system for behind the scenes work in your PHP applications.

In PHP business logic is usually put right in action's method or just behind it. Hence, every little piece of delaying and long-running code will be processed with a request. The problem is almost undetectable if a user sends an e-mail but with more complex actions it may take a little bit longer than preferred. [...] In this article I would like to make an attempt to present a solution to the very annoying everyday problem that probably many programmers came across in their organisations - deadlocks in databases caused by a vast number of requests in relatively short time. The main aim of this text is to introduce RabbitMQ, which I value as a very functional and practical message broker, to help you solve the queuing problems and decrease the amount of work you would otherwise have to spend on it.

He talks about why message brokers are even needed and how to pick the right one for your project. Then he gets into the "in practice" part of the article, showing the use of RabbitMQ through PHP to save various data to a database when a user is presented with an advertisement. He shows how to create both the producer and consumer objects, making interaction with the queue simpler. His examples are all using the php-amqplib by Alvaro Videla.

0 comments voice your opinion now!
rabbitmq introduction library tutorial message broker producer consumer

Link: http://piotrpasich.com/rabbit-behind-the-scenes/


Community Events





Don't see your event here?
Let us know!


laravel release voicesoftheelephpant framework install symfony api introduction podcast language series deployment opinion tips package bugfix library community interview list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework