News

On Error Handling and Closures

The error suppression operator in PHP (“@”) is often seen as a necessary
evil. Many, many low-level function will return a value indicating an error,
but also raise an E_NOTICE or E_WARNING — things
you might be able to recover from, or conditions where you may want to raise
an exception.

So, at times, you find yourself writing code like this:


if (false === ($fh = @fopen($filename, 'r'))) {
    throw new RuntimeException(sprintf(
        'Could not open file "%s" to read', $filename
    ));
}

Seems straight-forward enough, right? But it’s wrong on so many levels.

Author: Matthew Weier O’Phinney

by News Robot on March 31, 2012 in News, No Comments »
tags: , ,

WEBINAR: Cryptography made easy using Zend Framework

Cryptography is a powerful tool but sometimes it’s difficult to use. The component ZendCrypt of Zend Framework 2 makes the usage of cryptography easy, for instance to protect sensitive data. During this webinar we will present the ZendCrypt features with some examples: how to store a password in a secure way, how to encrypt/decrypt data using symmetric algorithms, and how to apply digital sign using public key cryptography.

Presenter: Enrico Zimuel

        

Author:
Source: Zend Events

Why Conventions Matter

When I started teaching myself scripting languages, I started with Perl. One
Perl motto is “TMTOWTDI”
— “There’s More Than One Way To Do It,” and pronounced “tim-toady.” The
idea is that there’s likely multiple ways to accomplish the very same thing,
and the culture of the language encourages finding novel ways to do things.

I’ve seen this principle used everywhere and in just about every programming
situation possible, applied to logical operations, naming conventions,
formatting, and even project structure. Everyone has an opinion on these
topics, and given free rein to implement as they see fit, it’s rare that two
developers will come up with the same conventions.

TMTOWTDI is an incredibly freeing and egalitarian principle.

Over the years, however, my love for TMTOWTDI has diminished some. Freeing
as it is, is also a driving force behind having coding standards and
conventions — because when everyone does it their own way, projects become
quickly hard to maintain. Each person finds themselves reformatting code to
their own standards, simply so they can read it and follow its flow.

Additionally, TMTOWTDI can actually be a foe of simple, elegant solutions.

Why do I claim this?

Author: Matthew Weier O’Phinney

by News Robot on March 30, 2012 in News, No Comments »
tags: ,

WEBINAR: Develop PHP mobile applications with Zend Framework

Zend Framework offers a component, Zend_Http_UserAgent, that can be used to recognize mobile devices. Using this class you can easily build web applications for multiple mobile platforms. During the webinar we will show how to use the Zend_Http_UserAgent in a simple web application built with Zend Framework 1.12.

Presenter: Enrico Zimuel

        

Author:
Source: Zend Events

Call A Spade A Spade

I don’t often get political on my blog, or over social media. But those of
you who follow me on twitter
lately have been treated to a number of tweets and retweets from me about
some bills before the US legislative bodies called “SOPA” and “PIPA”. Over
the last couple days, I realized exactly why I disagree with them, and
felt 140 characters is not enough.

Author: Matthew Weier O’Phinney

by News Robot on March 30, 2012 in News, No Comments »
tags: ,