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:
PHP and RabbitMQ Advanced Examples
October 20, 2014 @ 14:19:33

On the SitePoint PHP blog Miguel Ibarra Romero continues his series looking at the use of RabbitMQ with PHP in part two. He builds on the code (and setup) from the first part of the series and gets into some more advanced examples this time.

In part 1 we covered the theory and a simple use case of the AMQP protocol in PHP with RabbitMQ as the broker. Now, let's dive into some more advanced examples.

The remainder of the post includes two examples of more advanced operations:

  • Example 1: send request to process data asynchronously among several workers
  • Example 2: send RPC requests and expect a reply

Each example includes a diagram of the overall flow of the process, the code to make it happen both for the sender and receiver.

0 comments voice your opinion now!
rabbitmq advanced example tutorial series part2

Link: http://www.sitepoint.com/php-rabbitmq-advanced-examples/

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

Joshua Thijssen:
Deepdive into the symfony2 security component part 1
October 20, 2014 @ 10:26:33

On the latest post on his site Joshua Thijssen has kicked off a series taking a deep dive into the Symfony security component, a key piece in the security of Symfony-based applications. In this first part of the series he introduces the component and starts in on some of the features it offers.

Once in a while I like diving into code and see how things work under the hood. And as the symfony2 framework consists of many different components, bundles and bridges, there is a lot to discover. But ultimately, the code itself mostly isn't really as complex as it might seem from the outside world: just like a good magic trick, once unraveled, it all seems very simple and makes sense.

However, this is not true for one of those components: the security component. This black box full of dark magic doesn't like to give up its secrets, and after some (miserably) failed attempts, I am trying to unravel it once more in a few blog posts. Either we achieve complete victory, or fail yet again.. At this point, I will give both fair odds.

He starts off with an overview of the component, pointing out the two main things is handles: authentication and authorization. He also pulls in a few other things to do with security in Symfony to give a more complete, well rounded picture - the component itself, the security bundle and security bridges. He gets into a bit more detail about this last one and describes their specific use.

0 comments voice your opinion now!
symfony security bundle component overview deepdive series part1

Link: https://www.adayinthelifeof.nl/2014/10/19/deepdive-into-the-symfony2-security-component-part-1/

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:
Bitcoin and PHP with Coinbase's API - Demo App
October 09, 2014 @ 09:25:51

The SitePoint PHP blog has posted the second part of their series about using the CoinBase API through PHP. In this new tutorial they use the API connection made in the first part via the Coinbase SDK.

In part 1, we covered basic installation and usage of Coinbase's Bitcoin PHP API and the accompanying SDK. In this second and final part, we'll be building our sample application.

He briefly shows how to send and receive bitcoins before diving into the application. His simple application includes a basic welcome page, a payment page, thanks page and a cancel page (in case of errors). Complete code for the HTML, CSS, and PHP (API calls) is included in the post. He shows how to create the button to start the payment process and add it to the page.

0 comments voice your opinion now!
coinbase bitcoin series tutorial part2 demo application

Link: http://www.sitepoint.com/bitcoin-php-coinbases-api-demo-app/

SitePoint PHP Blog:
Bitcoin and PHP with Coinbase's API - Basic Usage
October 07, 2014 @ 10:41:31

On the SitePoint PHP blog there's a recent post showing you how to combine PHP and the Coinbase API to add the ability to accept bitcoins as payment in your application. This is part one in a series of posts about making the connection and integrating it into the application.

Have you ever thought about selling your services in exchange for Bitcoins? It's not so strange - today, many big players are actually doing it. From OkCupid to KhanAcademy, even WordPress is accepting Bitcoin. Also, some countries are thinking about it as a currency. Today, we will see how to accept Bitcoin payments on your website/application in an easy way, with the Coinbase API (and its SDK).

He briefly explains what kind of services the Coinbase API provides and talks about some of the different integration methods they offer. While they do offer a "button" you can add to the site, this tutorial focuses on the PHP integration using their SDK. They help you get it installed and show how to use the Coinbase site to set up authentication and authorization handling. He helps you get an instance of the Coinbase object ready for use and shows how to use it to interact with your account. The SDK also allows you to create the same button as the Coinbase site does, just in a more programatic way.

0 comments voice your opinion now!
bitcoin api tutorial coinbase part1 series sdk interact

Link: http://www.sitepoint.com/bitcoin-php-coinbases-api-basic-usage/

NetTuts.com:
Refactoring Legacy Code - Part 10 Dissecting Long Methods with Extractions
September 19, 2014 @ 09:41:54

NetTuts.com is back with the latest part of their "Refactoring Legacy Code" series for PHP. In this latest article (part 10) they work on pulling apart longer methods into smaller, more manageable chunks.

In the sixth part of our series we talked about attacking long methods by leveraging on pair programming and viewing code from different levels. We continuously zoomed in and out, and observed both small things like naming as well as form and indentation. Today, we will take another approach: We will assume we are alone, no colleague or pair to help us. We will use a technique called "Extract till you drop" that breaks code in very small pieces. We will make all the efforts we can to make these pieces as easy to understand as possible so the future us, or any other programmer will be able to easily understand them.

This "extract 'till you drop" mentality (from Robert Martin) has you look at a piece of code and find the logic and lines that can be split out and isolated without removing functionality and interaction. They include some random code from a Stack Overflow post (checking if a number is a prime) and show how to split it out, making the logic and structure less complex and more understandable. They start with a unit test to ensure the result is the same post-refactor and fixing a few bugs along the way. They split it out into two different methods and move it from a more linear approach to something recursive.

0 comments voice your opinion now!
tutorial refactor legacy code part10 series extract method

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-10-dissecting-long-methods-with-extractions--cms-22182

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 8 of 8)
September 18, 2014 @ 11:20:04

Matthew Weier O'Phinney has posted the last part of his "Deployment with Zend Server" series with part eight. This part focuses on some hints around the actual deployment and automation.

This is the final in a series of eight posts detailing tips on deploying to Zend Server. Zend Server SDK to deploy your Zend Server deployment packages (ZPKs) from the command line. Today, I'll detail how I automate deployment with zf-deploy and zs-client (the Zend Server SDK), and wrap up the series with some closing thoughts.

He quickly summarizes the previous parts of the series as individual steps and wonders if there's a better way than doing each of them manually. He shows exactly this with the automation handling that zf-deploy and zs-client offer combined with a make script defining steps for the deploy, ZPK update and a cleanup/Composer update task.

0 comments voice your opinion now!
deployment zendserver tip series part8 automation make command zfdeploy zsclient

Link: https://mwop.net/blog/2014-09-18-zend-server-deployment-part-8.html

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 7 of 8)
September 17, 2014 @ 10:44:13

Matthew Weier O'Phinney has posted his next-to-last article in his "Deployment with Zend Server" series, part seven of eight concerning the "zs-client" tool.

This is the seventh in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed setting up and clearing page caching. Today, I'm sharing how to use the Zend Server SDK to deploy your Zend Server deployment packages (ZPKs) from the command line.

Zs-client is a handy tool that lets you interact directly with the Zend Server API is a more programatic way without having to worry about the request signing process. He walks you through a sample use of the tool and shows how to add a target application and use the tool to get its current status. He also includes a basic command that lets you run an automatic update on the application.

0 comments voice your opinion now!
zsclient deployment zendserver series part7 api

Link: https://mwop.net/blog/2014-09-16-zend-server-deployment-part-7.html


Community Events





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


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

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