Darryl E. Clarke

Linux, PHP, MySQL, Apache, Development and More . . .

Archive for the ‘coding’


Feeling Up Django: First Impressions From a PHP Guy

As I whipped through the tutorial on getting started with Django I made some mental notes on things I thought were interesting and things I thought weren’t so interesting. I have a feeling I’ll be saying similar things about Ruby on Rails…

(more…)

PHP Java Bridge vs. Zend Platform Java Bridge

A long time ago I posted some instructions on installing PHP/Java Bridge on Ubuntu and that post is getting quite a few reads, so I figured I’d post a follow up on how it was used.

Over the last year I had been using a Java Bridge from a Zend Framework application to access a Java only API.  And really, between the two bridges there are no differences.  They both work identical, they both work great.  Would I pay Zend for Zend Platform’s Enterprise license? No.  Why? Because both bridges perform the same.  The only differences are:

  1. Zend’s Java bridge already has a function called java_require and the open source PHP/Java Bridge needs you to include a file.
  2. PHP/Java Bridge has a java_cast function, and you need it.  Zend’s Java Bridge does not have, or need this.

With these two differences all you need is a little code in your bootstrap (or somewhere else useful) to cover them and all is golden. Your app should work with both Java Bridges without any issue.

/* no java_require() include the java.inc for PHP/Java Bridge */
if ( ! function_exists('java_require') ) {
    include "java/Java.inc";
}

/* declare this, it doesn't exist with Zend Java, but is needed for PHP/Java Bridge */
if ( ! function_exists('java_cast')) {
    function java_cast($whatever) {
        return $whatever;
    }
}

There’s probably a more graceful way of checking and doing this but that’s it, and it’s worked on a multi tiered build environment for over a year now.

Summer Project: Initial Setup and more Details

I’m still chugging along with the common elements on the project.

So, for the basics of what I have decided to do: Yep, it’s an image gallery.  It’s not too exciting and definitely nothing original.  There’ll be a basic authentication system (login/logout) with web based uploading and tagging.  That’s pretty much it.  The images that get uploaded will be stored in the database itself as a nice central location for all my different variants to get the data from.

As far as the initial setup goes, I’ve managed to get PostgreSQL installed, running, and I’ve even created the necessary tables for all that I need.  Yeah, that part was pretty simple.  But I can’t say it happened without learning something.  I’ve noticed that something I took for granted with MySQL wasn’t available right away for my installation of PostgreSQL. (more…)

Summer Project: Setup PostgreSQL

Using my shiny new upgraded Ubuntu 9.04, I’ve gotten around to installing PostgreSQL.

Note: this is not a tutorial.

The installation was simple, as are most installations with Ubuntu. The initial “get going” was a bit odd for PostgreSQL though. The one thing you have to remember when initially trying to get things going is this… (more…)

Summer Project Details

As part of my previous post, “things to do this summer,” I’ve decided on a not so clever appraoch to proving to myself that “it’s just a language.”

What do I mean by, “it’s just a language?”  Well, let me tell you. On a regular basis I get asked “do you now [language]?” And my answer is usually something along the lines of “Well, I know of it, I’ve touched it a bit, but never done anything real with it.”  But, since I’m a programmer I usually follow it with “It’s just a language.”  So now I’m going to prove to myself that it is in fact “just a language.”

(more…)