Caveman profiling with a side of “where were you at 9pm on the night in question?” As always, season to taste.

<?
$_profile_log = "/tmp/php-profile.log";

function _profile() {
    static $fh;
    if( !isset($fh) ) {
        global $_profile_log;
        if( !file_exists($_profile_log) ) {
            @touch( $_profile_log );
            @chmod( $_profile_log, 0664 );
        }
        $fh = @fopen( $_profile_log, "a" );
    }
    if( !$fh )
        return false;

    $stack = debug_backtrace();
    if( $stack[1] )
        $base = $stack[1];
    else
        $base = $stack[0];
    $buf = $base['file'].":".$base['line'].", ";
    if( $base['class'] )
        $buf .= $base['class'].$base['type'];
    $buf .= $base['function'];

    $buf = sprintf("[%s] %s\n",date("H:i:s"),$buf);
    return @fwrite( $fh, $buf );
}
?>

Read the rest of this entry »

I’ve gone through all of my old posts (~260 of them in my 5+ year history) and tagged them.

I’ve got a theme that doesn’t make me want to tear my eyes out, but it’s not what I want yet.

I’ve acknowledged all missing images that I noticed by tagging the post as ‘broken images’, and I’ll be going through them again later to see if I have any remaining local copies of the files in question.

I’ve installed a modern syntax hiliting plugin, so code should be readable again.

Sooo close.