News Feed
Sections




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

Web Development Blog:
Add a MailChimp subscribe feature to your contact form
May 05, 2015 @ 12:14:13

The Web Development Blog has a tutorial posted showing how to add a Mailchimp "subscribe" feature to your current contact forms. They make use of the MailChimp API wrapper library to make the calls back to the service and subscribe the user at their request.

MailChimp is a great email marketing service provider with an easy to use control panel and features like: campaign management (RSS-driven, A/B Split, Plain-text and regular), statistics, auto-responder and a complete set of list management tools. They offer different ways to place a subscriber form on your website or blog. If you to like add the MailChimp subscribe feature to your existing contact form you need to add some custom code.

They start with a few things you'll need to do to prepare for the connection including the setup of an API key to make the request. He provides a simple "Contact Us" form for reference and the code needed on submit to validate the input and make the subscription call to the API with the email the user provided. He also includes a bit of response handling.

0 comments voice your opinion now!
mailchimp tutorial subscribe contactus form api request

Link: http://www.web-development-blog.com/archives/mailchimp-subscribe-contact-form/

SitePoint PHP Blog:
Automatic PHP Code Generation with Memio
May 05, 2015 @ 11:52:07

On the SitePoint PHP blog a new tutorial shows you how to generate code with Memio, a relatively new PHP-based tool that lets you define "models" as structures for the code you need generated.

Ever thought of writing code responsible for generating certain PHP classes, methods, properties automatically? Read on to get the details on when exactly automatic code generation may be helpful and - what's most important - how to implement it properly using the Memio library.

He starts with a bit of introduction to the basic concept of code generation and mentions a few places it's currently used. Then he gets into the examples, starting with a bit of code showing how to get Twig loaded and injected into the Memio instance. From there he shows a simple example of creating a class with a single method and single line of code. With the basics understood, he gets into a more "real world" example of generating ORM classes with getters and setters for the different properties/column names.

0 comments voice your opinion now!
tutorial generate code memio library example orm realworld

Link: http://www.sitepoint.com/automatic-php-code-generation-memio/

Michelangelo van Dam:
popen for cli commands and pipes in php
May 05, 2015 @ 10:53:38

Michelangelo van Dam has a quick new post to his site talking about popen and pipes in command-line PHP as an alternative to the "exec" functions PHP provides to make command lines calls.

I got a question today about using commands that pipe output to other commands within PHP applications. There are two functions in PHP that are perfect for the task: popen and proc_open. But when you want to run it as a complete process, you can go about using exec, shell_exec, passthru or system and fiddle with escapeshellcmd. But often this looks messy and not reusable. A better approach would be to use "popen".

He includes a code example of how to use this method, showing a call to a command line tool and piping the results back into a PHP variable for later use. You can find out more about the use of popen in the PHP manual and accompanying examples.

0 comments voice your opinion now!
popen procopen commandline cli pipe result example

Link: http://www.dragonbe.com/2015/05/popen-for-cli-commands-and-pipes-in-php.html

Marc Morera:
Visithor, Testing Your Routes Without Pain
May 05, 2015 @ 09:25:57

In his latest post Marc Morera shares a new tool he's created to help with testing routes for specific HTTP code responses and other attributes of your "HTTP layer" - Visithor.

Many years ago I was thinking about a simple and fast tool to test specific routes, expecting specific HTTP codes and providing an easy environment of ensuring properly your HTTP layer. So… I present you Visithor, a PHP based library that provides you this functionality, with a simple configuration definition and a very easy way of installation.

He starts with a few quick commands to get the library installed (either globally or local to the project) and how to create the first configuration file. This file defines the tests to execute as a set of URLs with allowed HTTP response codes. He also shares a Symfony2 bundle that can be used to integrate it with your current application, allowing for more flexibility in route check configuration and environment settings. He also includes a quick example of integrating it with your Travis-CI build as a "script" command to be executed.

0 comments voice your opinion now!
visithor library testing http response code symfony2 bundle integration

Link: http://mmoreram.com/blog/2015/05/04/visithor/

Voices of the ElePHPant:
It's the Booze Talking - The PHP Ecosystem
May 05, 2015 @ 08:54:48

The Voices of the ElePHPant podcast has released the latest in their "It's the Booze Talking" series of episodes. This time host Cal Evans recorded a session at the Lone Star PHP conference with a long list of PHP community members all about the PHP Ecosystem.

Guests include Beth Tucker Long, Jordi Boggiano, Daniel Cousineau, Adam Culp, Ben Ramsey and Michelangelo van Dam (along with about twelve others). You can listen to this latest episode either using the in-page player, grabbing the mp3 or using the player embedded in this post:

0 comments voice your opinion now!
voicesoftheelephpant community boozetalking ecosystem lonestarphp lsp15

Link: https://voicesoftheelephpant.com/2015/05/05/its-the-booz-talking-ecosystem/

Community News:
Latest PECL Releases for 05.05.2015
May 05, 2015 @ 07:03:03

Latest PECL Releases:
  • ev 0.2.15 Issue #12: marked as CLI-only extension (the changes are actually missing in 0.2.14)

  • ev 0.2.14 Issue #12: marked as CLI-only extension

  • mongo 1.6.7 ** Bug * [PHP-1425] - explain() does not raise appropriate exception for $err conditions * [PHP-1431] - Fix database name validation to include '$external', to allow execution of user admin commands * [PHP-1435] - MongoCollection::getIndexInfo on non-existing collection makes segmentation fault ** Improvement * [PHP-1427] - MongoCollection::distinct() should ensure query is serialized as BSON object * [PHP-1433] - MongoCollection::distinct() should allow array or object for query * [PHP-1434] - MongoCollection::findAndModify() should allow array or object for query, update, and fields

0 comments voice your opinion now!



php[architect]:
May 2015 Issue Released - "Hunting for Clues"
May 04, 2015 @ 12:07:31

The May 2015 edition of php[architect] magazine has officially been released - "Hunting for Clues".

"Hunting for Clues" is the theme title for this month's issue. It focuses on automated testing and how it can help you hunt down bugs as they appear. In Michael Bodnarchuk's Codeception: Testing for Human Beings he talks about integrating automated testing in your workflow. Xander Guzman discusses two testing and mocking libraries for PHP in Integrating Mockery and Hamcrest into a Project, and Brad Bonkoski discusses leveraging Docker for Reusable Containers for Automated Testing.

Other articles include the continuation of the series for creating PHP extensions, manipulating images with Glide, Facebook's accessibility toolkit and Phpspec testing. You can pick up a copy (physical or digital) directly from the php[architect] site. They also provide one article for free if you'd like a sample of the magazine content.

0 comments voice your opinion now!
phparchitect magazine may2015 hunting clues release

Link: http://www.phparch.com/2015/05/may-2015-phparchitect-issue-launched/

SitePoint PHP Blog:
Automated Testing of Drupal 8 Modules
May 04, 2015 @ 11:06:08

The SitePoint PHP blog has a tutorial posted talking about the automated testing of Drupal 8 modules, the components of the popular PHP-based content management system. In it author Daniel Sipos shows how to create a few tests for some functionality created in previous articles.

In this article we are going to look at automated testing in Drupal 8. More specifically, we are going to write a few integration tests for some of the business logic we wrote in the previous Sitepoint articles on Drupal 8 module development. [...] But before doing that, we will talk a bit about what kinds of tests we can write in Drupal 8 and how they actually work.

He makes use of the SimpleTest unit testing tool for PHP (versus something like PHPUnit) as it has become a standard for Drupal's own testing. He talks briefly about what SimpleTest is, how it integrates with Drupal and what kinds of tests already exist. He then gets into testing his own functionality - checking route information, that the page exists, the contents of the resulting page and the addition of a custom block plugin. He shows how to create these simple tests, extending the WebTestBase class, and checking each item on the list. He also includes an example of the resulting output of the successful testing, including time to execute and the detailed results of each test.

0 comments voice your opinion now!
drupal8 automated testing tutorial simpletest introduction exists form custom plugin

Link: http://www.sitepoint.com/automated-testing-drupal-8-modules/

NetTuts.com:
Localize Your Web Application for Any Country With the Google Translate API
May 04, 2015 @ 10:56:34

In this new tutorial to the NetTuts.com site author Jeff Reifman shows you how to use the Google Translate API to translate the content in your application/website to the language of your choosing. In his examples, he shows how to integrate it with a Yii framework application.

In this tutorial, I'll walk you through my extensions to the Yii I18n extract script which do exactly this. And I'll demonstrate translating my startup application, Meeting Planner, into a handful of languages. Keep in mind, Google Translate isn't perfect and it doesn't address issues related to time and date formats and currencies. But for a quick and affordable (free) way to build default translations for your web application into 50+ languages, this is an ideal solution.

He starts with a brief introduction to the Google Translate API, the languages it supports and how to install the library he's chosen to make the connection. He then gets into the internationalization (i18n) functionality that Yii has (an introduction to that is here) and how to define the "messages" files with the different content strings. These files are defined to there's no need to call out to the API for every piece of content that loads. He shows how to extend the message extraction handling to add in the API request and parsing the result. This information is then added to the current message information files, making it simpler to add in new strings. He then integrates this into the Meeting Planner application and shows how to run the script to call the Google API and switch the language with image results in several different languages of the finished output.

0 comments voice your opinion now!
tutorial internationalization i18n googletranslate api yii framework messages

Link: http://code.tutsplus.com/tutorials/localize-your-web-application-for-any-country-with-the-google-translate-api--cms-23126

Laravel Podcast:
Episode 26 - Illuminated Tesla Micro-Services
May 04, 2015 @ 09:29:27

The Laravel Podcast has released their latest episode, #26 - Illuminated Tesla Micro-Services with host Matt Stauffer and guests Taylor Otwell and Jeffrey Way.

In this episode, the crew discusses the recent release of Lumen, micro-services, Laravel 5.1 event broadcasting, and their favorite cars.

You can listen to this latest show either using the in-page audio player, by downloading the mp3 or subscribing to their feed and getting the latest as they're released (including this latest episode).

0 comments voice your opinion now!
laravel podcast ep26 illuminated tesla microservices mattstauffer taylorotwell jeffreyway

Link: http://www.laravelpodcast.com/episodes/11108-episode-26-illuminated-tesla-micro-services


Community Events

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


introduction application community podcast library voicesoftheelephpant interview symfony2 laravel series performance php7 release version opinion api example framework extension testing

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