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

Lars Strojny's Blog:
PHP Segfaulting with PECL/UUID and PECL/IMAGICK
Sep 08, 2010 @ 14:17:13

If you've been using (or will be using) the uuid and imagick extensions for PHP, you might be able to save yourself a lot of headache by reading this new post from Lars Strojny about his segfault woes.

Ran into a bug yesterday, where http://pecl.php.net/uuid in combination with http://pecl.php.net/imagick yielded a segfault when using uuid_create().

After trying to trace it down with a backtrace and cachegrind results, he (and Mikko & Pierre) found that both extensions were built against the libuuid.so.1 file. While that wasn't the issue directly, they did find a work-around that helped the issue - renaming some ini files so uuid was loaded first.

tagged: uuid imagick pecl extension segfault debug libuuid

Link:

Debuggable Blog:
String substitution using UUIDs
Aug 22, 2008 @ 12:04:39

On the Debuggable blog, Felix Geisendorfer shows how to create a string parser that allows you to pull out parts of the string you don't currently want manipulated to be put back later.

If you've ever written any non-trivial String processing code, you've probably ran into the situation where you wanted to exclude certain parts of your string for a certain operation. Usually that would mean you have to tokenize your string, or adjust the operation you want to run so it doesn't affect the part of the string you want to exclude from it. Both of those solutions can be fairly time intensive so I was looking for a shortcut and found one.

He provides the code for this string substitution class, a method substitute() that matches based on a regular expression and, if found, stores the parts for later use.

tagged: string substitution uuid manipulation regularexpression

Link:

The Bakery:
Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload Thumbnails
Jun 08, 2007 @ 09:37:00

The Bakery has four new items posted today including articles looking at load balancing, the Request component and UUID behavior in your CakePHP application.

  • Load Balancing and MySQL Master and Slaves - If you are currently using MySql master/slave replication for load balancing and wish to transport to cakePHP, it really couldn't be easier.
  • Request Information Component - Need more insight into how a controller structures a CakePHP request? This little component will log important information and variables for each request to your application's debug log.
  • Uuid Behavior - I have a requirement to use UUID's as primary keys. I was initially using MySQL triggers to call uuid() on insert but in the end decided a behavior makes more sense. This behavior adds a UUID to the field specified in your models.
  • Improved Upload Behaviour with Thumbnails and Name Correction - This is an improved version of Chris Partridge's upload behaviour (http://bin.cakephp.org/saved/17539). The behaviour is able to generate thumbnails if used for images (JPEG/PNG only).

CakePHP users can check out these and more great articles, tutorials and more on The Bakery.

tagged: cakephp tutorial article upload thumbnail uuid request loadbalance cakephp tutorial article upload thumbnail uuid request loadbalance

Link:

The Bakery:
Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload Thumbnails
Jun 08, 2007 @ 09:37:00

The Bakery has four new items posted today including articles looking at load balancing, the Request component and UUID behavior in your CakePHP application.

  • Load Balancing and MySQL Master and Slaves - If you are currently using MySql master/slave replication for load balancing and wish to transport to cakePHP, it really couldn't be easier.
  • Request Information Component - Need more insight into how a controller structures a CakePHP request? This little component will log important information and variables for each request to your application's debug log.
  • Uuid Behavior - I have a requirement to use UUID's as primary keys. I was initially using MySQL triggers to call uuid() on insert but in the end decided a behavior makes more sense. This behavior adds a UUID to the field specified in your models.
  • Improved Upload Behaviour with Thumbnails and Name Correction - This is an improved version of Chris Partridge's upload behaviour (http://bin.cakephp.org/saved/17539). The behaviour is able to generate thumbnails if used for images (JPEG/PNG only).

CakePHP users can check out these and more great articles, tutorials and more on The Bakery.

tagged: cakephp tutorial article upload thumbnail uuid request loadbalance cakephp tutorial article upload thumbnail uuid request loadbalance

Link: