Topic “PHP”

Extract images from an HTML snippet

Use PHP's DOM and XPath libraries to do the hard work.

The function here will take an HTML fragment and return an array of useful images it finds.

Tags:

Smelly PHP code

More tell tale signs that code needs refreshing

Adam Culp posted the 3rd article in his Clean Development Series this week, Dirty Code (how to spot/smell it). When you read it, you should keep in mind that he is pointing out practices which correlate with poorly written code not prescribing a list of things to avoid. It's a good list of things to look for and engendered quite a discussion in our internal Musketeers IRC.

Building CandiData

Thoughts from Election Hackathon 2012

This past weekend, my colleague and friend Sandy Smith participated in Election Hackathon 2012 (read his take of the hackathon). We built our first public Musketeers.me product, Candidata.me. This was my first hackathon, and it was exciting and exhausting to bring something to life in little more than 24 hours.

Using bcrypt to store passwords

An example for PHP and MySQL

The linkedin password breach highlighted once again the risks associated with storing user passwords. I hope you are not still storing passwords in the clear and are using a one-way salted hash before storing them. But, the algorithm you choose to use is also important. If you don't know why, go read You're Probably Storing Passwords Incorrectly.

Tags: , ,

Fix SSL timeouts with the Facebook PHP-SDK

I ran into SSL timeouts on in local development setup when I was re-factoring some integration code with facebook and using their SDK. It was tricky to diagnose, I was sure that my changes couldn't be the cause, and I finally confirmed it by running our production codebase. Since it was having the same timeout error, I knew the bug had to be in an underlying layer.

For the record, I'm running this version of curl on my Archlinux box:

Drupal finally using OOP

Entities will be real PHP Classes in Drupal 8

Finally. This is a huge step forward for Drupal. After eschewing OOP practices for a long time, its finally winning over core developers, which will make working with Drupal as a Framework easier in many ways. I copied the announcement below, but you can see that patch and discussion here.

Frustration with Drupal core growing

Is Drupal losing momentum?

When a prominent developer and contributor lashes out that Drupal is in dire straits, you better listen.  You ought to read his critique of how Drupal core development is stalling, or at least stuck in the mud.  That can't be good news for anyone looking to upgrade to Drupal 7.  My thoughts after the quote.

PHP 5.4 is Gathering Momentum (PHP and Oracle: Christopher Jones)

A much awaited release of PHP maybe coming soon. Find out how you can help contribute.

Discussion on the PHP mail lists and IRC channels in the past few days has been looking positive about an alpha release of PHP 5.4 soon. This will be taken from the "trunk" branch of PHP.

PHP 5.4 is Gathering Momentum (PHP and Oracle: Christopher Jones)

 

Tags:

Avoid PHP character set errors

Always tough to line up all the places where text passes through or is stored. HT PHP Developer.org

Character sets can be confusing at the best of times. This post aims to explain the potential problems and suggest solutions.

How to Avoid Character Encoding Problems in PHP « James Cohen

Tags:

Git PHP lint pre-commit hook

This post describes a small tweak to make to php lint checking via a git pre-commit hook.

Using git hooks to check syntax errors - Tim Akinbo’s Blog

Tags: ,

Recent Comments

Subscribe by Email

Enter your email address:

Delivered by FeedBurner