Loosely Coupled Podcast:
Episode 2 My Code Is Perfect
April 16, 2014 @ 13:59:40
voice your opinion now!
The Loosely Coupled podcast (with PHP community member hosts Jeff Carouth and Matt Frost) has released their latest episode, Episode #2: My Code is Perfect.
Writing clean code isn't something you pick up overnight, nor is it a brand new topic. In this episode Jeff and Matt discuss the characteristics and mechanics of creating clean code and how to approach your project from a clean code perspective. [...] In this episode, Jeff and Matt talk about code quality and beautiful code. Beautiful code follows a standard. If you don't have one, find one and adopt it.
There's some great notes in the post to accompany the recording with other suggestions, resources and links to other sources that can help you write cleaner, better code. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. You can also subscribe to their feed to get the latest episodes as they're released.
SitePoint PHP Blog:
Implementing Multi-Language Support
April 16, 2014 @ 12:18:39
voice your opinion now!
The SitePoint PHP blog has a new post from Jacek Barecki talking about a few ways you can include multi-language support in your PHP applications. There's not much in the way of actual code here, but there are links to some other tools that can help get the job done.
Setting up a multilingual site may be a good way to attract new customers to your business or gain more participants in your project. Translating a simple site with a few static pages probably won't probably be complicated, but more complex PHP web applications may require a lot of work when launching multiple language support. In this article I'll present different types of content that need to be taken under consideration when internationalizing a site.
He breaks it down into five different types of content that you might want to translate:
- Multi-language Static Content
- Database content
- User submitted content
- Resources (images, videos, etc)
- Other types of content
He wraps it up with a few recommendations including making a checklist of the things you want to translate to figure out what tools you need to use.
Using PHP Configuration Patterns Properly
April 16, 2014 @ 11:52:11
voice your opinion now!
On PHPBuilder.com today they have a new post showing different configuration patterns for getting localized settings into your applications. They show the use of INI files, PHP scripts, text files, XML data and a database call.
PHP is a cross platform language. It is a server based application so we must think about the configuration settings of the PHP software. There are various ways of creating configurable PHP applications. The configuration flexibility comes as a built in feature in PHP. But we must understand the requirement clearly before making an application configurable. This article explores different PHP configuration patterns and their implementation.
For each of the options mentioned, there's a brief description of what the method is, some of the common uses and a code example showing a basic implementation. The database pattern is the only one without a code example as the database interface varies widely from application to application.
TDD Checking the return value of a Stub
April 16, 2014 @ 10:25:15
voice your opinion now!
Federico Cargnelutti has a helpful post to his site today for the unit testing/TDD crowd about checking the retuned value from a stub of an object in your tests. He's using the built-in mocking framework here, not something like Mockery.
State verification is used to ensure that after a method is run, the returned value of the SUT is as expected. Of course, you may need to use Stubs on a test double or a real object to tell the object to return a value in response to a given message. [...] In PHP, for example, you dynamically type the return value within the body of the method. This means that PHP mocking libraries cannot check the type of the return value and provide guarantees about what is being verified. This leads to the awkward situation where a refactoring may change the SUT behaviour and leave a stub broken but with passing tests.
He gives an example of a few classes - a Presenter and Collaborator - and a test that mocks out the Collaborator instance, calling a "getStories" method on it. He shows a situation where all tests pass in the initial version, but after some changes to the return type, a test that should fail doesn't. His solution for the issue revolves around DocBlock annotations and the Return Value instead of the built-in mock object return method.
Packagist Latest Releases for 04.16.2014
April 16, 2014 @ 08:05:26
voice your opinion now!
Recent releases from the Packagist:
- earthit/cmip-rest (0.0.6)
Collection-Modifiers-ID-Property REST framework
- earthit/dbc (0.0.3)
Database access utilities
- abeautifulsite/jquery-minicolors (2.1.3)
jQuery MiniColors Plugin
- mjohnson/decoda (6.5.1)
A lightweight lexical string parser for BBCode styled markup.
- leroy-merlin-br/larasniffer (1.0.1)
Larasniffer detect violations of a defined coding standard. It helps your code remains clean and consistent.
- bear/package (0.10.2)
BEAR.Sunday framework package
- mindscape/raygun4php (1.3.5)
Raygun.io client for PHP 5.3, to send errors and exceptions automatically.
- contao-community-alliance/composer-plugin (2.0.0-beta4)
Composer plugin that provide contao integration and installer.
- lakedawson/vocal (0.1.11)
Extended functionality for Eloquent in Laravel 4.1
- samvaughton/ldt (0.1.3)
Laravel 4 DataTables library to handle the server-side calls.
- drey/prefs-common (0.0.3, 0.0.2, 0.0.1)
user preferences common files
- condenast/pangea (1.1.46)
- playbloom/guzzle-bundle (v1.0.4)
Provide Symfony2 web profiler for Guzzle
- dannykopping/docblock (0.5.2, 0.5.1)
A simple library for parsing PHP DocBlock comments
- liip/monitor-bundle (2.0.0-RC1)
Liip Monitor Bundle
- sandfox-im/juick-xp (v0.3.1, v0.2)
A WordPress Plugin to crosspost your messages to Juick.com
- aheinze/cockpit (0.9.14)
An api-driven CMS without forcing you to make compromises in how you implement your site.
- hackzilla/password-generator (0.2)
Password Generator Library
- cypresslab/gitelephant (v1.0.7)
An abstraction layer for git written in PHP 5.3
- eventhorizon/assets-bundle (v1.0.4)
- cpliakas/dynamo-db-odm (0.3.0)
A lightweight ODM for DynamoDB
- siriusphp/filtration (1.2.5)
Data filtration library
- berg/ldap (v0.1.2, v0.1.1, v0.1.0)
A package for quickly setting up LDAP authentication
- leaseweb/memcache-bundle (v1.2.12)
Memcache Doctrine caching and session storage in the Web Debug Toolbar
- elcuro/nodeattachment (1.5)
- tomverran/robots-txt-checker (1.0)
Given a robots.txt file, user agent and URL path will tell you whether you're allowed to access a page
- webbuilders-group/silverstripe-gridfielditemtype (0.2.1)
Adds type/class picking functionality to SilverStripe 3.0's GridField
- sunnysideup/ecommerce (3.1.4, 3.1)
Silverstripe E-commerce Application
- traackr/sql-migration (0.4)
SQL migration plugin for CakePHP
- lablog/lablog (0.1.5, 0.1.4, 0.1.3)
A simple but powerful blogging platform built on Laravel 4.
- eventhorizon/page-bundle (v0.1.1)
- soli/qboke (v0.0.11)
Blogging with markdown, git and other awesome stuff.
- codeliner/shared-domain-set (1.1.0)
Collection of common DDD interfaces
- dreamfactory/azure-sdk-for-php (0.4.0.6)
This project provides a set of PHP client libraries that make it easy to access Windows Azure tables, blobs, queues, service runtime and service management APIs.
- csnemeth79/locasync (v1.2, v1.1, v1.0)
EASY and smart tool for keep language files syncronized.
- spacedmonkey/super-simple-events (1.0.2)
Super Simple Events plugin.
- crunch/symfony-standard-meta (v2.5.0-beta1)
- pear/mail_mime-decode (188.8.131.52)
More info available on: http://pear.php.net/package/Mail_mimeDecode
- eventhorizon/security-bundle (v1.0.2)
- tigefa4u/tigefa4u.github.io (v3.1.3)
tigefa jekyll template site
- zendframework/zenddiagnostics (v1.0.2)
A set of components for performing diagnostic tests in PHP applications
- traackr/traackr-api-php (0.2)
Traackr API PHP Library
- cebe/indent (1.0.0)
a small tool to convert text file indentation
- spiffy/spiffy-test (0.1.4)
PHPUnit bootstrapping module for ZF2
- roave/zf2-for-1 (0.1.0)
Compatibility layer for ZF1 application allowing usage of ZF2 features
- aamant/message (0.1.2, 0.1.1, 0.1.0)
Internal message for laravel
- beijer/evepi (0.1.1, 0.1.0)
A library to interact with the Eve Api in a fast and multithreading way.
- symfony-cmf/block-bundle (1.1.0-RC2)
Symfony CMF Block Bundle
- zendframework/zf1-extras (1.12.6)
Zend Framework 1 Extras
- symfony-cmf/content-bundle (1.1.0-RC2)
Symfony CMF Content Bundle
- bombayworks/zendframework1 (v1.12.6)
Zend Framework 1
- ilya/fuzzy (1.0.0)
Nice PHP library for fuzzy string searching
- srslygd/srslygd (v0.0.01, 0.0.1)
A collection for building web applications
- bach-pedersen/laravel-riak-auth (1.0.1)
Riak Auth provider for laravel
- paquettg/php-html-parser (1.6.3)
An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
- keboola/syrup (1.2.6)
Syrup - Concentrated extract(or)s
- paquettg/leaguewrap (0.3)
A wrapper for the League of Legends API.
- wp-cli/wp-cli (v0.15.0)
A command line interface for WordPress
- moszkva/hashing (v1.1)
Replacement of Hash facade. Solution for running of Laravel 4 with php 5.3 env.
- laravel/framework (v4.1.26)
The Laravel Framework.
- nth/permit (v0.0.1-alpha)
Bitwise based permission implementation for Lavarel 4.x
- geoffroy-aubry/supervisor (v1.6.0)
Oversee script execution, recording stdout, stderr and exit code with timestamping, and ensure email notifications will be sent (on start, success, warning or error).
- phpextra/event-manager-silex-provider (1.0.0)
- webfatorial/wordpress (3.8.3)
WordPress é um aplicativo web para você criar um lindo website ou blog.
- quexer69/yii-slit-slider (0.4.0, 0.3.9-patch1)
Yii Slit Slider for phundament 3, with packages from composer repository http://packages.phundament.com
- adambrett/array_search_keys (0.2, 0.1)
Provides functionality for searching a list of keys in order and returning the first match.
- zendframework/zend-version (2.2.7, 2.3.1)
- narit/helloworld (0.0.1)
- zendframework/zend-view (2.2.7, 2.3.1)
provides a system of helpers, output filters, and variable escaping
- zendframework/zend-form (2.2.7, 2.3.1)
- zendframework/zend-escaper (2.3.1)
- zendframework/zend-console (2.3.1)
- zendframework/zend-text (2.3.1)
- zendframework/zend-test (2.3.1)
- zendframework/zend-barcode (2.3.1)
provides a generic way to generate barcodes
- zendframework/zend-di (2.3.1)
- zendframework/zend-math (2.3.1)
- zendframework/zend-ldap (2.3.1)
provides support for LDAP operations including but not limited to binding, searching and modifying entries in an LDAP directory
- zendframework/zend-db (2.3.1)
- zendframework/zend-mvc (2.3.1)
- zendframework/zend-config (2.3.1)
provides a nested object property based user interface for accessing this configuration data within application code
- zendframework/zend-serializer (2.3.1)
provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover
- zendframework/zend-navigation (2.3.1)
provides support for managing trees of pointers to web pages
- zendframework/zend-cache (2.3.1)
provides a generic way to cache any data
- zendframework/zend-dom (2.3.1)
provides tools for working with DOM documents and structures
- zendframework/zend-feed (2.3.1)
provides functionality for consuming RSS and Atom feeds
- bignall/zf1compat-for-zf2 (v0.2.1, v0.2.0)
ZF1 (Zend Frameworks version 1) Compatibility Layer for ZF2 (Zend Frameworks version 2)
- zendframework/zend-mime (2.3.1)
- zendframework/zend-loader (2.3.1)
- zendframework/zend-mail (2.3.1)
provides generalized functionality to compose and send both text and MIME-compliant multipart e-mail messages
- zendframework/zend-modulemanager (2.3.1)
- zendframework/zend-code (2.3.1)
provides facilities to generate arbitrary code using an object oriented interface
- doubledashverbose/randomness (1.0.1, 1.0.0)
A random number generator based on MediaWiki's wfRandom() function.
- webignition/website-sitemap-finder (1.0.1)
Finds the sitemap(.xml) for a given website
- m6web/wsclient-bundle (v1.0.1)
Simple webservices client to call external urls
- zendframework/zendframework (2.3.1, 2.2.7)
Zend Framework 2
- aura/framework-project (2.0.0-beta1)
A minimal web+CLI framework built from Aura v2 packages
- aura/web-project (2.0.0-beta1)
A minimal web framework built from Aura v2 packages
- aura/web-kernel (2.0.0-beta1)
The kernel files for an Aura web project.
- anh/content-bundle (v1.1.11)
- g4/tasker (0.5.1)
Application asynchronous tasks manager and runner, cron-like PHP implementation
- plateau/garage (v0.1)
Laravel 4 File Catalog Package.
- zeroclipboard/zeroclipboard (2.0.0-beta.2)
- patchwork/dumper (v1.1.5, v1.1.4)
High accuracy and flexible dumping for PHP variables
- socialism/hashids (0.3.1)
Generate hashes like YouTube or Bitly from numbers to obfuscate your database IDs, or navigate to the right shard.
- krisanalfa/bono-blade (0.2.0)
Laravel Blade template engine for Bono PHP Framework
- jimphle/messaging (v0.1.0, 0.1)
Jimdo PHP library extraction of messaging component
- alcohol/currencylist (1.1.1, 1.1.0)
Currency library for PHP based on ISO 4217
- mekras/interfaces (v1.0.1)
General purpose and commonly used PHP interface definitions
- bartaakos/yii-skeleton (v1.0.1)
Basic Yii skeleton
- 66ru/unistorage-yii-client (v0.8.3, v0.8.2, v0.8.1)
Client for unistorage as yii component
- richardsjoqvist/silverstripe-blocks (1.2.2)
Blocks is a generic class which can be used to build small content blocks which can be associated globally or with a specific page.
- fbf/laravel-competitions (v0.2.0)
A Laravel 4 package to add simple competitions, with entries tied to a logged in user, to a site
- cansascityshuffle/puice (1.0.0)
- burzum/file-storage (0.4.2)
This plugin is giving you the possibility to store files in virtually and kind of storage backend. This plugin is wrapping the Gaufrette library (https://github.com/KnpLabs/Gaufrette) library in a CakePHP fashion and provides a simple way to use the storage adapters through the StorageManager class.
- anh/symfony-skeleton (v2.4.3)
- anlutro/php-form (0.3.2)
Dynamic form builder.
- anlutro/form (0.3.2)
Dynamic form builder.
- bitweb/zf2-error-reporting-module (1.0.0)
BitWeb Zend Framework module for sending errors to email.
- quexer69/yii-manual-widget (4.0.0, 3.0.0)
Generate TbTabs based yii manual widget. reads files from a directory and put each file from a set file extension in tabs
- rodgermd/ibanapide-bundle (v0.3, v0.2)
- bc/cmf (0.1.6.3)
simple cmf (application, controller, command, etc.)
- ladela/jquery-ui-bundle (v1.10.4)
jQuery UI bundle for Symfony2
- typo3/neos (1.1.0-beta2)
The next generation of the popular open-source CMS.
- typo3/neos-nodetypes (1.1.0-beta2)
Node type configuration for TYPO3 Neos
- typo3/neos-kickstarter (1.1.0-beta2)
A simple generator for Neos assets, like sites and plugins.
- typo3/neos-base-distribution (1.1.0-beta2)
TYPO3 Neos Base Distribution
- myclabs/acl (0.4.1)
ACL library for Doctrine
- v-six/silex-raven (0.1.3, 0.1.2)
A Silex Service Provider for Raven
- keboola/gooddata-writer-php-client (1.5.8)
PHP Client for KBC GoodData Writer
- jenssegers/mongodb (v1.2.7)
A MongoDB based Eloquent model and Query builder for Laravel 4
- penneo/penneo-sdk-php (v1.0.3)
Penneo SDK for PHP
- hylianshield/hylianshield (0.4.0)
Data validation and sanitizing
- purple-dbu/vcloud-sdk-helpers (v1.2.4)
Utility classes for vCloud Director PHP SDK
- beelab/user-bundle (v1.1.1)
Simple user provider for Symfony2
- alcohol/currencylist-serviceprovider (1.1.0)
CurrencyList Service Provider
- openbuildings/swiftmailer-css-inliner (0.1.1)
Inline the css of your html emails
- hostbox/nette-paypal-payment-buttons (v1.0.0)
PayPal payment buttons component for Nette Framework
- sarhanm/sms-survey (1.0.0)
SMS Driven Survey - PHP
- ilya/ron (0.1.0)
Extend classes and create implementations in runtime
- dlin/getopt (0.0.1)
PHP Command Line Argument Parser
- hostbox/nette-component-social-plugins (v1.5.0)
Social plugins component for Nette Framework
- sly/notification-pusher (v2.2.4)
Standalone PHP library for easy devices notifications push.
- fol/core (v2.2.1)
The core of FOL framework
- eleme/feature (v0.1.0)
Feature API used for operational Dark Launching ad A/B Testing.
- assetrinc/assetrinc (v0.4.0)
An unusually simple way to include assets
SitePoint PHP Blog:
Can Great Apps Be Written in PHP - An Interview Series
April 15, 2014 @ 13:05:34
voice your opinion now!
Matthew Setter has started off a series of posts on the SitePoint PHP blog with the first post interviewing community members to answer one main question, "can great apps be written in PHP?"
I read an old post, circa 2010, on the MailChimp blog a little while ago, about their experience using PHP. It struck a chord with me, because the sentiments they shared I've felt myself, and heard echoed many times over the years. [...] Despite its successes, or people's successes with it (a la Facebook, MailChimp, Hailo, Google, and others), it's inferred we should use languages which had their foundations as pure languages; not ones which came to be a language, as PHP evolved into over time.
He references some of the other comments in the Mailchimp article about their experience with the language along with mentions of a few others. He wonders if these negative comments are true and, to get some answers, searches out other developers and their opinions. In this first interview he talks with Bobby Deveaux about his background in the language, what he'd like to see added and more.
Master Zend Framework:
Howto Use Constructor Injection In ZF2
April 15, 2014 @ 12:50:33
voice your opinion now!
The Master Zend Framework site has a new tutorial posted today introducing you to constructor injection in Zend Framework 2 applications, specifically in controller classes.
s it right to use setter injection? Or is it evil, to be avoided at all costs, for the explicitness of constructor injection? In today's post, we explore that and how to implement constructor injection in ZF2 controller classes. Recently on Master Zend Framework, I wrote about using Setter Injection in Zend Framework 2, to supply dependencies to Controller classes.
He talks about the "magic" that can come with frameworks and how constructor injection of the ServiceManager can help clarify and remove some of the problems associated with "magic". He walks you through three steps to getting the ServiceManager injected into the classes:
- Implement a Class Constructor
- Initialise your controllers via FactoryInterface
- Use factories Instead of invokables
He also points out a few benefits to this method of injection, including that it makes the controllers easier to test and the main goal - lack of "magic" in dependencies.
How to Use New Relic With PHP & WordPress
April 15, 2014 @ 11:43:04
voice your opinion now!
The NetTuts.com Code blog has posted the second part of their series showing how to use the New Relic monitoring service in various kinds of web applications. In the previous article they looked at using it in a Ruby application, but in this new post it's all about PHP.
Today, we will look at how to monitor a PHP application using New Relic. More specifically, we will set up a basic WordPress installation and get some performance data about it, in the New Relic dashboards. [...] With the PHP version of the agent, the environment is a lot more important, as the agent is installed and lives on the box where the application will be deployed, rather than being part of any particular app.
They use an EC2 instance for their example, but the steps can be applied on other systems. They help you get the needed software installed, validate they're correctly configured and do a basic setup of WordPress. Next up is the steps to install the New Relic "newrelic-php5" software and get it fully installed. They also include the updates you'll need to make to your Apache configuration to configure the New Relic instance and how to keep the agent up to date.
Don't see your event here?
Let us know!