Displaying posts tagged: php
2011-11-26 18:05:53
No Comments
I wrote this recently and thought it might be useful to someone:
2011-11-22 03:27:31
No Comments
I just tried to compile the Debian PHP packages, so I could make some minor tweaks to the source, to fix a bug I'm hopefully going to document shortly. This turned out to be very problematic, mainly due to the testing phase!
To build the Debian packages you typically do the following:
mkdir php
cd php
...
2011-11-02 03:41:16
No Comments
PHP's lack of a finally keyword is apalling, and even though there seems to be some hacks around it, I have come up with own today. I'm following the C++ concept of allocating objects on the stack, and letting them cleanup any resources when the stack is rolled back.
Take an example. I am creating some ...
2011-10-25 21:46:13
No Comments
I encountered the following odd exception:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2053 ' in /home/bramp/my.php:29
Stack trace:
#0 /home/bramp/my.php(29): PDOStatement->fetch(2)
Searching on Google didn't reveal much help, but I eventually figure out the root cause. Spot the mistake:
...
$sql = 'SELECT TRIGGER_NAME, TRIGGER_GROUP, JOB_NAME FROM QRTZ_TRIGGERS';
$sth = $dbh->prepare($sql) ...
2011-09-23 00:55:57
No Comments
Today I needed to work out the MD5 Digest hash for SIP authorisation. A quick search on Google revealed instructions on how to generate the hash, and then I made this simple PHP script.
<?php
$username = '1234';
$realm = 'asterisk';
$password = 'PASSWORD';
$uri = 'sip:1.2.3.4';
$nonce = 'abcdef01';
$str1 = md5("$username:$realm:$password");
$str2 = md5("REGISTER:$uri");
...
