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

NetTuts.com:
Laravel, BDD and You The First Feature
November 26, 2014 @ 12:19:37

NetTuts.com has posted the second part of their "Laravel, BDD and You" series (part one is here) building on their introduction in part one and building a first feature (what BDD tools call their tests).

In the second part of this series called Laravel, BDD and You, we will start describing and building our first feature using Behat and PhpSpec. In the last article we got everything set up and saw how easily we can interact with Laravel in our Behat scenarios. [...] In short, we are going to use the same .feature to design both our core domain and our user interface. I have often felt that I had a lot of duplication in my features in my acceptance/functional and integration suites. When I read everzet's suggestion about using the same feature for multiple contexts, it all clicked for me and I believe it is the way to go.

He starts in with the creation of the first feature - a simple "welcome" test that evaluates the main Laravel start page. He uses this example to set up a Laravel trait that can be reused in other parts of the testing and how to use it in a Feature Context file. He then starts to create the tests for the sample time tracking application started in part one. He gives an example of the feature file's contents, the result from its execution and the "small refactors" that it will suggest to add functionality to the feature file. With this skeleton in place, he then fleshes out the test to make it actually work with the requests. He walks through each function and provides the code needed for both the test and other tools/objects they need.

0 comments voice your opinion now!
laravel tutorial bdd feature series part2 testing behat phpspec

Link: http://code.tutsplus.com/tutorials/laravel-bdd-and-you-the-first-feature--cms-22486

SitePoint PHP Blog:
Building an Internationalized Blog with FigDice
November 26, 2014 @ 09:55:44

On the SitePoint PHP blog they've posted the second part of the series looking at using the FigDice for the templates in your application. In this new post they expand on the basics presented in part one and look at internationalization.

In part one of this two-part series I started looking at FigDice, a PHP templating system that takes a slightly different approach to most. [...] In this second and final part we're going to add a simple blog to our example site, which allows us to look in more detail at Figdice's concept of data feeds. We'll also look at internationalization, translating some of the site's content into a couple of additional languages.

In this part of the series (part two of two) they create a simple blog application based on their "Feed" class from before, faking some basic content. He then creates the factory class the FigDice templating will fetch the data from and makes a view to use it. He also talks about the optional functionality to add additional data to the feed output as attributes on the element. Finally he shows how to work all of this back into the HTTP framework under a "blog/post" URL.

0 comments voice your opinion now!
internationalization figdice template library tutorial series part2

Link: http://www.sitepoint.com/building-internationalized-blog-figdice/

SitePoint PHP Blog:
Getting Started with FigDice
November 21, 2014 @ 12:19:12

The SitePoint PHP blog has posted the second part of their series highlighting the FigDice template rendering system. In this latest article Lukas White focuses on FigDice's ability to "pull" data into templates as needed rather than having it injected.

Amongst the many templating systems out there, most work in pretty much the same way; variables are "injected" using some syntax or another, be it curly braces, percentage signs or whatever that library's convention happens to be. They'll usually have basic control structures, such as if...then and, of course, iteration. FigDice, however, takes an altogether different approach. Inspired by PHPTAL - the subject of a future article - it gives the view layer the responsibility of "pulling" in the data it requires, rather than relying on controllers to assemble and "push" it into the templates.

He walks you through the installation of the tool (via Composer) and how to create a basic FigDice view to work with (including template loading). He uses a sample Silex-based application for his examples, making a layout with the FigDice additions to the attributes. He then shows how to make the template for the main index page with a "mute" region for the include logic. He shows how to include this basic template into the view and render it directly as output. Next he shows how to integrate data with the template, pulling in "tweets" from an array dataset via a loop (walk) and a factory to provide the template the data.

0 comments voice your opinion now!
figdice template tutorial series part2 data integration

Link: http://www.sitepoint.com/getting-started-figdice/

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/

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/

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 2 of 8)
August 29, 2014 @ 11:55:04

Matthew Weier O'Phinney has posted the second part of his series with some tips around application deployment with Zend Server. In this latest post he shares his second tip related to recurring jobs.

This is the second in a series of eight posts detailing tips on deploying to Zend Server.The previous post in the series detailed getting started with zf-deploy to create ZPK packages to deploy to Zend Server. Today, I'm looking at how to created scheduled/recurring jobs using Zend Server's Job Queue; think of this as application-level cronjobs.

Instead of running the jobs as cron tasks (which may or may not be installed if there's multiple servers), he opts for a software-based approach. He walks you through the use of the Zend Server Job Queue to create a simple reoccurring execution to run a PHP script at a certain time. He includes some code examples with one showing just the scheduling of a job and the other showing how to detach previous jobs and add only the new ones that weren't scheduled before.

0 comments voice your opinion now!
deployment zendserver tip series part2 cron reoccurring jobs

Link: http://mwop.net/blog/2014-08-28-zend-server-deployment-part-2.html

SitePoint PHP Blog:
PINQ - Querify Your Datasets - Faceted Search
August 26, 2014 @ 10:58:22

The SitePoint PHP blog has continued their series showing the use of the PINQ library for PHP (a PHP implementation of the LINQ tool). In part one they introduced the tool and showed how to it could be used to query and sort data. In this second part they move on and show how to perform a multi-faceted search on data from a MySQL database.

We are not going to cover the full aspect of faceted search in this series. Interested parties can refer to relevant articles published on Sitepoint and other Internet publications. [...] Unfortunately, faceted search is not a built-in feature provided by MySQL yet. What can we do if we are using MySQL but also want to provide our users with such a feature? With PINQ, we'll see there is an equally powerful and straightforward approach to achieving this as when we are using other DB engines - at least in a way.

Building from the code from the first part of the series, they create a few more simple routes that let you define the different facets to use for the searching/sorting. He creates a custom facet class that uses the "traversable" handling of the PINQ to do the data manipulation. He creates a few different facet objects, each creating a customized filter. finally, he ties it all back into the endpoint and includes the updated markup to show the results. He finishes up the post mentioning a few limitations and improvements that could be made on the example as well.

0 comments voice your opinion now!
pinq query dataset mysql faceted search tutorial series part2

Link: http://www.sitepoint.com/pinq-querify-datasets-faceted-search/

NetTuts.com:
Understanding and Working with Relationships Between Data in WordPress
August 01, 2014 @ 09:21:54

NetTuts.com has posted the second part of their series looking at the "guts" of a typical WordPress installation. In the first part they gave an overview of the structure and contents of the various database tables. In this second part they get more into the relationships between them.

In the first part of this series on data in WordPress, I gave an overview of the WordPress database tables, and which tables are used to store what kind of data. In this second part, I'll outline how WordPress manages the relationships between that data. As you'll see, WordPress uses three kinds of data relationship - one-to-one, one-to-many and many-to-many. I'll look at each of these and what they mean for your WordPress site.

He goes through each of the relationship types and includes examples from the WordPress database to illustrate them. He then gets into a bit more depth, talking about the specifics of some relationships like: posts-to-users, posts-to-comments, comment-to-comment and the structure of the many-to-many relationships too.

0 comments voice your opinion now!
wordpress series data database relationship tutorial part2

Link: http://code.tutsplus.com/tutorials/understanding-and-working-with-relationships-between-data-in-wordpress--cms-20632

SitePoint PHP Blog:
Automate PHP with Phake - Real World Examples
July 10, 2014 @ 12:51:07

The SitePoint PHP blog has posted part two of their series looking at using Phake for automation in your applications. In this second part they take some of the basics they shared in part one and apply them in some more practical examples.

In part one, we covered the basics of Phake and demonstrated ways of executing tasks with it, covering groups, dependencies, and arguments. In this part, we'll look at some sample real world applications of Phake. Note that the following examples are largely based on things that I usually do manually that need some sort of automation.

He includes three different task examples, each with the code to make them happen (and descriptions of what it's doing):

  • Uploading Files to Server with a Phake task
  • Seeding the Database
  • Syncing Data

You can find out more about Phake on the project's GitHub page (including grouping, aborting and describing tasks).

0 comments voice your opinion now!
phake automate library tutorial part2 practical example

Link: http://www.sitepoint.com/automate-php-phake-real-world-examples/

Matthias Noback:
Symfony2 Framework independent controllers parts 2 & 3
June 19, 2014 @ 09:45:34

Matthias Noback has posted the next two parts of his "framework independent controllers" series (it started here) looking at avoiding annotations and tying up some loose ends.

From part two about annotations:

In the previous part of this series we decreased coupling of a Symfony controller to the Symfony2 framework by removing its dependency on the standard Controller class from the FrameworkBundle. Now we take a look at annotations. They were initially introduced for rapid development (no need to create/modify some configuration file, just solve the issues inline!) [...] This might not seem such a big problem at all, but the SensioFrameworkExtraBundle is a bundle, which means it only works in the context of a Symfony2 application. We don't want our controller to be coupled like this to the framework (at least, that is the point of this series!), so we need to remove the dependency.

He shows how to decouple this functionality through a proper routing configuration, fetching the needed data yourself for the request and generating the request object yourself. In part three he covers some of the comments already made about the series and how to take the final steps to abstracting out the controllers: removing bundle names from templates, removing the HttpFoundation dependency and letting go of "action methods".

0 comments voice your opinion now!
controller independent symfony series part2 part3

Link: http://php-and-symfony.matthiasnoback.nl/tags/controller/


Community Events





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


library interview tool introduction opinion composer framework version release symfony community language laravel security application voicesoftheelephpant podcast list conference series

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