Category Archives: PHP

WebComic RSS

I had a poke around my public services (the stuff on services.signpostmarv.name), cleaned up a bunch of crap that was no-longer in use, then decided to poke around the code for my WebComic RSS service. There’s a mix of UHU4 and UHU5 code in there, so I thought it was time to start upgrading the [...]

PHP5 LLSD Parser example


Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 1925

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 1925

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 2290

Warning: implode() [function.implode]: Argument must be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3242

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3265

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3265

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3306

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3357

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3357

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3502

Warning: Invalid argument supplied for foreach() in /home/signpostmarv/signpostmarv.name/wp-content/plugins/devformatter/geshi/geshi.php on line 3502

I recently committed my LLSD parser to the public SVN server, after someone posted on the RegAPI mailing list asking for a LLSD parser that worked under PHP5.First the example script, then a step by step explanation of the output.
01< ?php02header(’Content-Type:text/plain’); # makes it easier to read the output03define(’UHU_DEBUG_MODE’,true); # enables extended error reporting04define(’UHU_ERROR_AS_EXCEPTION’,true); #05define(’UHU_ROOT’,’s:/uhu [...]

UHU5 code snippets: LLSD/capabilities components

While trying to find a source-code sherpa, I’ve been working on an LLSD parser- it’s mostly complete now, so I started work on an interface to LL’s capabilities services- here’s some snippets that show off the geekiness of the code:
$marv = new uhu_SL_capability_user(‘SignpostMarv Martin’,PASSWORD);
$regapi = new uhu_capability_regapi($marv);
print_r($regapi->service_capabilities());
print_r($regapi->get_error_codes());
Here’s the kicker- uhu_capability_regapi::get_error_codes() doesn’t exist- overloading magic is [...]

Updates on sw.slr upgrade

The UHU5 upgrades to Regions & Places are coming along nicely, which should put off any further refactoring until PHP 5.3 is released (late static binding FTW!). The Region & Places upgrades are of course holding up the Events upgrade, since an Event object will have a Parcel sub-object (I’m sure I’ll have fun working [...]

PHP5 Certification – practice exam progress

Since I’ve read through PHP Objects, Patterns and Principles (2nd Edition) twice, I decided to take another one of the PHP5 Certification practice exams.

Updates on UHU5

Overview

The configuration check for headersBySAPI() is ran only once- compare the UHU4 implementation with the UHU5 implementation. Although headersBySAPI() is now wrapped in it’s own class, the same function wrapper exists in UHU5 as was present in UHU4.
is_uuid() is still a function wrapper to uhu::is_uuid() (previously uhu4::is_uuid()), however the UHU5 version caches the result of [...]

abstract PHP FTW!, or What I have learnt from "PHP Objects, Patterns and Principles"

I’m re-reading PHP Objects, Patterns and Principles (2nd Edition) to see if I skipped over something the first time through, but I thought I’d share something that I picked up.
I use Exceptions quite extensively in UHU4, but they’re not very elegant and tend to duplicate a lot of logic. One of the topics covered in [...]

PHP5 Certification – practice exam progress

Since the grid search query is going to take a while to complete and most of my projects are either being held up by the query or something else (if there’s a project I’ve forgotten about, please remind me!), I thought I’d use up one of my PHP5 Certification practice exam credits.
The Results
Things I failed

Database [...]

Bad Behavior has blocked 222 access attempts in the last 7 days.