DOMpdf failing to render certain accented characters

Posted on Thu 21 August 2014 in PHP • Tagged with dompdf

logo-adobe-pdf

I've noticed some issues with DOMpdf when trying to generate PDFs using their internal Helvetica font. After banging my head against a wall for a few hours trying to "fix" UTF-8 support, it turned out UTF-8 support was working fine. Essentially DOMpdf's internal Helvetica font didn't support a few polish …


Continue reading

Manage background tasks with PHP-Resque and Supervisor

Posted on Thu 03 July 2014 in PHP • Tagged with php, system, yii

image0

PHP-Resque, the PHP equivalent to Ruby's really nice background process runner is a great way to execute long running PHP processes. Supervisor is a python-based process control system, essentially it's a convenient way to manage custom system processes you need to handle. Combining the two to manage long running PHP …


Continue reading

Simple API Mocking with Guzzle and Charles

Posted on Thu 26 June 2014 in PHP • Tagged with guzzle, http, testing

If you've ever had to try unit test code that's dependent on external services, you'll know the pain of trying to mock-up fake API requests by hand. It's painful to setup and painful to maintain, this little tutorial attempts to make the whole process as easy as possible.

Step 1 …


Continue reading

PHP and big numbers

Posted on Wed 05 January 2011 in PHP • Tagged with lolphp, security

PHP isn't friends with big numbers.

Wonder where I can stick this number to cause some serious problems.


Continue reading

8 randomly useful php tricks

Posted on Mon 22 February 2010 in PHP • Tagged with php, tricks

In keeping with my series of 8's.

1 ) debug_print_backtrace()- I use this one a lot, print a debug-style list of what was called to get thethe point where this function is called. Very, very useful.

2 )__autoload()- Called when you attempt to load a class that hasn't been defined. Example …


Continue reading

Php Beautifier

Posted on Sat 23 January 2010 in PHP • Tagged with code, php

Why?

When you're faced with an ugly PHP file(or files) with little to do but trawl through it, there is a solution.

Php beautifier is a pear package that will process PHP files and reformat them in a (hopefully) nicer format.

Installation

You can install it using pear with …


Continue reading