Feed aggregator

Community News: Packagist Latest Releases for 03.21.2014

PHPDeveloper.org - Fri, 21/03/2014 - 15:03
Recent releases from the Packagist:

June 2014

Planet-PHP - Fri, 21/03/2014 - 02:01
Functional PHP
Presented By
Larry Garfield

June 19, 2014 TIME

The post June 2014 appeared first on Nomad PHP.

Catégories: Open Source, PHP Community

June 2014 – EU

Planet-PHP - Fri, 21/03/2014 - 02:01
12 Reasons Your API Sucks
Presented By
Keith Casey

June 19, 2014 20:00 CEST

The post June 2014 – EU appeared first on Nomad PHP.

Catégories: Open Source, PHP Community

SitePoint PHP Blog: CMS Showdown: Nginx, Ghost, PHP and Phalcon

PHPDeveloper.org - Thu, 20/03/2014 - 19:58

On the SitePoint PHP blog today Bruno Skvorc has written up the first part of his look at installing Ghost with Nginx and Phalcon on his hosting provider. This is the first post in his "showdown" series of trials on various CMS systems.

You might be wondering why I'm writing about Ghost on a PHP oriented channel - this series will be a showdown of all the various PHP based CMS' I can find, benchmarked against each other and against Ghost, as I look for the next best alternative. Since my DigitalOcean droplet already runs Nginx as a reverse proxy for the blog, I'll also be deploying all the CMS' on that same installation, each on its own subdomain.

He walks you through the whole process from start to finish:

  • Installing PHP on Nginx
  • Setting up a virtual host on a subdomain
  • Installing Phalcon
Link: http://www.sitepoint.com/cms-showdown-nginx-ghost-php-phalcon

Master Zend Framework:Simplifying Unit Testing (and asking for help when needed)

PHPDeveloper.org - Thu, 20/03/2014 - 18:54

On Matthew Ssetter's "Master Zend Framework" blog today he talks about simplifying unit testing and some of his experience with getting too complicated in his own testing practices.

Recently I was a bit stuck, trying to figure out how to test a section of an application I've been developing. Specifically, I was trying to mock a HydratingResultSet in a controller test, so it could be the return value of a method call on a datasource, my controller needed. I was sure it was the right approach to help ensure the functionality in question was working properly. But no matter what I tried, my tests didn't work, because I wasn't mocking it correctly. [...] I asked for help [on IRC], laying out the problem as I saw it. The first response which came back, from Ocramius, stopped me dead in my tracks: "Why are you trying to do that?"

He includes a bit of background on what he was trying to test and the functionality around it and how, when he stopped to think about it, wondered why he was testing it too. He talks about the refactor he made to his code with a positive end result - the tests now passed. He suggests a few questions to ask yourself when writing your tests such as "am I doing too much?" or "am I testing code in the right place?" Chances are, if you step back and really look at what you're testing, you might realize that the answer to these questions is just to simplify.

He finishes the post with a few suggestions, some of his own personal favorites, of places you can go for help when questions do pop up. He points out that the usual excuses shouldn't be a blocker on asking for help. He is "encouraging you to set your pride, ego and excuses aside and when you're stuck: ask for help."

Link: http://www.masterzendframework.com/people/right-approach-unit-testing-asking-help

The PHP.cc Blog: Disintegration Testing

PHPDeveloper.org - Thu, 20/03/2014 - 17:20

In this new post on thePHP.cc blog today Sebastian Bergmann relates the unfortunate disintegration of the Mars Climate Orbiter (back in 1999) back to a lesson on software testing and errors.

One of the most important tasks in software testing is to find the smallest scope in which a test case can be implemented. The smaller the scope in which a test is run, the faster it can be executed and the more precise its result. Unit Tests exercise one unit of code in isolation from all collaborators. Integration Tests verify the interaction of two or more collaborators in isolation from the rest of the system. Edge-to-Edge Tests run the software as end-to-end as possible in a single process (and without using a web browser or a web server). End-to-End Tests, or System Tests, look at the whole system and in the case of a web application send a HTTP request from a web browser to a web server running the software to inspect the HTTP response that is sent back.

He talks some about the difference between unit tests and acceptance tests and how "easy and seductive" functional tests can be over unit testing. He points out how fragile (and sometimes slow) this can be though, and how their failure only shows a problem and not where it is.

The promise of being able to develop both the business model as well as the software that implements it in an agile fashion should be reason enough for enterprises to invest in a modern, highly decoupled software architecture. And when the members of the software development team communicate well, both among themselves and with the other stakeholders, then there is not much that can really impede the success of the project. Link: http://thephp.cc/viewpoints/blog/2014/03/disintegration-testing

Joshua Thijssen: Dynamic form modification in Symfony2

PHPDeveloper.org - Thu, 20/03/2014 - 16:42

Joshua Thijssen has a new post to his site looking at a way to dynamically modify forms in a Symfony2-based application. Form handling can be a bit tricky (especially with more complex elements), and modifying them on the fly can be even more difficult.

Sometimes (or actually, a lot of the time), handling forms will go beyond the basics. And even though symfony2 gives you out-of-the-box a really clean way of creating forms, it sometimes just isn't enough. Fortunately, you are not alone in writing forms, and many posts exists with information on how to handle complex forms. In this post, I will try and demonstrate how to create a dynamic form where you can select a city based on the chosen province.

His example lets the user pick their province and then populates the other select with cities in that area. He includes the code for the form to create these two selects and how to pull out the list of provinces to populate the first. He goes through each part of the example code explaining the methods, what they're doing and how a pre-submit event can be used to populate the second list.

Link: https://www.adayinthelifeof.nl/2014/03/19/dynamic-form-modification-in-symfony2

Community News: Packagist Latest Releases for 03.20.2014

PHPDeveloper.org - Thu, 20/03/2014 - 15:09
Recent releases from the Packagist:

Disintegration Testing

Planet-PHP - Thu, 20/03/2014 - 09:00
Catégories: Open Source, PHP Community

PostgreSQL updates 9.3.4, 9.2.8, 9.1.13, 9.0.17, and 8.4.21 released

Postgresql.org - Thu, 20/03/2014 - 02:00

The PostgreSQL Global Development Group has released an update to all supported version of the database system, including versions 9.3.4, 9.2.8, 9.1.13, 9.0.17, and 8.4.21. This minor release fixes a data corruption issue with replication and crash recovery in version 9.3, as well as several other minor issues in all versions. All users of version 9.3 are urged to update their installations at the next possible downtime. Users of older versions should update at their convenience.

The data corruption issue in PostgreSQL 9.3 affects binary replication standbys, servers being recovered from point-in-time-recovery backup, and standalone servers which recover from a system crash. The bug causes unrecoverable index corruption during recovery due to incorrect replay of row locking operations. This can then cause query results to be inconsistent depending on whether or not an index is used, and eventually lead to primary key violations and similar issues. For this reason, users are encouraged to replace each of their standby databases with a new base backup after applying the update.

Other PostgreSQL 9.3-only fixes in this update include:

  • Make sure that statistics files for dropped databases get deleted
  • Allow materialized views to be referenced in UPDATE and DELETE queries
  • Add read-only data_checksum parameter
  • Prevent erroneous operator push-down in postgres_fdw

This release resolves some other issues in all versions of PostgreSQL, including:

  • Fix timing consistency issue with NOTIFY
  • Allow regular expression execution to be cancelled
  • Improve performance of index checks for newly added rows
  • Prevent premature walsender disconnection
  • Prevent memory errors on newer Windows versions
  • Update timezone files

Additional changes and details of some of the above issues can be found in the Release Notes. Two of the issues which affect version 9.3 have additional information on the 9.3.4 Update Wiki Page.

Users of version 8.4 should note that it will reach End-of-Life (EOL) three months from now, per our Versioning Policy. This means that this is likely to be the next-to-last update for version 8.4, and users should be planning to upgrade to a newer version of PostgreSQL.

As with other minor releases, users are not required to dump and reload their database or use pg_upgrade in order to apply this update release; you may simply shut down PostgreSQL and update its binaries. Users who have skipped multiple update releases may need to perform additional post-update steps; see the Release Notes for details.

Links: * Download * Release Notes * 9.3.4 Update Wiki Page

Catégories: PHP Community

Medium.com: Getting Started With Laravel 4 - A Book Review

PHPDeveloper.org - Wed, 19/03/2014 - 19:52

On Medium.com there's a recent post reviewing the book "Getting Started with Laravel 4". In the review Christopher Pitt briefly covers both the good and bad parts of the book.

This book is aimed at newcomers to PHP development, and to Laravel 4 in particular. It doesn't disappoint. It starts slow, talking about the need for, and role filled by frameworks. It explains what Composer does, and why it's useful for frameworks like Laravel. It's not the typical "Laravel needs Composer, here's the code you use" stuff. There are 40 pages of what is essentially a very gentle introduction, before you even start writing code.

He talks about the sample application the book walks you through creating and some other topics around it including unit testing and artisan commands. He mentions the more popular Code Bright book and points out that he believes it (Code Bright) to be a better deal for the money if you're looking for the more comprehensive intro to Laravel.

Link: https://medium.com/tech-reviews/f8881d2014c7

php[architect]: March 2014 Issue Released - The New PHP

PHPDeveloper.org - Wed, 19/03/2014 - 18:17

The php[architect] publishing group has just released the latest edition of their magazine, the March 2014 issue. This issue, titled "The New PHP" includes articles like:

  • "Leveraging PHP 5.5" (Dirk Merkel)
  • "Coming Soon to a PHP Near You!" (David Rogers)
  • "The Confident Coder: Confident, Not Cocky" (Aaron Saray)
  • "Education Station: Getting Started with Phavour-Template" (Matt Setter)
  • "Laravel Tips: Adding Real Template Engines to Laravel 4" (Dirk Merkel)

You can pick up a single copy of you own from the php[architect] site or you can subscribe to a fill year of their print or PDF versions and get PHP goodness like this all year long.

Link: http://www.phparch.com/2014/03/march-2014-phparchitect-magazine-released/

CMS Showdown: Nginx, Ghost, PHP and Phalcon

Planet-PHP - Wed, 19/03/2014 - 18:00

This entry is part 1 of 1 in the series CMS ShowdownBack in January, I made it one of my New Year’s resolutions to walk 4000 kilometers for the sake of fitness. I’ve been documenting this virtual journey (which is taking place on a DIY treadmill desk), on a Ghost deployed blog. My Ghost subscription […]

Continue reading %CMS Showdown: Nginx, Ghost, PHP and Phalcon%

Catégories: Open Source, PHP Community

SitePoint PHP Blog: Understanding Drupal's EntityFieldQuery

PHPDeveloper.org - Wed, 19/03/2014 - 17:02

On the SitePoint PHP blog there's a recent post that aims to help you understand the EntityFieldQuery class in the Drupal framework. The class lets you find entities based on properties, field values and other generic metadata.

When building complex web apps, you'll eventually have to interact with a database. To retrieve data in Drupal one can use the database abstraction layer provided, which requires some SQL knowledge to be used properly. From Drupal 7 EntityFieldQuery API is provided, which lets you fetch information about entities from Drupal without actually building SQL queries. In this article, let's see how we can use the EntityFieldQuery API to fetch data from Drupal and use it in our modules.

He starts by explaining a bit about the class and includes a bit of code showing how to create an instance of it. He then moves into the creation of a sample module that only locates an entity and relays the results back to the calling script. As a part of the example, he shows how to make the query to locate all "node" entity types and create a sidebar with links to each. He shows the addition of conditionals to the location call for properties, values and fields (as well as ordering the results).

Link: http://www.sitepoint.com/understanding-drupals-entityfieldquery/

VG Tech: Comparing Your Privates in PHP

PHPDeveloper.org - Wed, 19/03/2014 - 16:56

In a new post to their blog, the VG Tech folks talk about "comparing your privates" with a "hidden" feature of PHP. Don't worry, they're referring to private class properties on object instances here...

I was going to compare several private properties between to objects and started making a piece of code to perform the actual comparison using getters for the properties. I felt the approach sucked, and started looking into alternatives way to do this.

He shares what the current PHP documentation shares about comparing objects, but neither of them take private properties into account. He remembers, however, that object visibility is at the class level not instance level, allowing two object instances of the same class to have access to all properties of the other, regardless of exposure level. He includes a code snippet showing how to use this to compare those private properties.

Link: http://tech.vg.no/2014/03/14/comparing-your-privates-in-php/

Community News: Packagist Latest Releases for 03.19.2014

PHPDeveloper.org - Wed, 19/03/2014 - 15:03
Recent releases from the Packagist:

ServerGrove Blog: Symfony2 components overview: Translation

PHPDeveloper.org - Tue, 18/03/2014 - 23:37

The ServerGrove blog has posted their latest up-close look at the various components that make up the Symfony2 framework. In their latest post, they focus in on the Translator component.

Modern applications need to be internationalized and localized to be able to reach people from all over the world. Internationalization - aka i18n - is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization - aka l10n - is the process of adapting internationalized software for a specific region or language by adding locale-specific components such as dates or currency. The Translation component provides different tools to get your application internationalized, but not localized.

The post covers the three main parts of the component - Catalogues, Loaders and Dumpers - and includes a simple example of creating the object, adding resources and calling "trans" to translate. There's also an example of using the YAML file loader to include the translated strings. There's also mentions of pluralization, translation "domains" and custom loaders.

Link: http://blog.servergrove.com/2014/03/18/symfony2-components-overview-translation/
Syndiquer le contenu