Archive for the 'PHP' Category

Using It (Sort of)

Yeah, I know, I’ve been quiet for a long time. I’ve been working, earning money, OK?

But I have finally found time to start having a play with Delphi for PHP. It isn’t much of a start, but it is a start.

I’ve been doing a bit of Wordpress work – essentially adding a whole lot of extra database tables to a Wordpress blog. Now Wordpress is not a Delphi for PHP app, so you can’t just dive in there and use the VCL. However, I have been using the IDE, because if I’m writing PHP the source code highlighting stops me making a whole lot of stupid mistakes that I always used to make in Dreamweaver. For this I am very grateful.

And there might be more. Wordpress plug-ins should not, I think, be written using the VCL. But if you have a bunch of extra tables that are largely independent of the Wordpress data… Now the choice is between writing moderately complex data entry screens that are plugins for the Wordpress admin system, or writing a separate program using the VCL. Wordpress is, after all, just a mySQL database, so as long as you don’t touch the core Wordpress tables it should be OK, right?

Well, doubtless it won’t be that easy. It never is. But at least I have a potential trial project.

Posted on 9th June 2007
Under: PHP | No Comments »

Progress (of a sort)

While I have been busy doing other things, the blogosphere has been discussing the input filter issue with Delphi for PHP. As was mentioned in the comments to my previous post, Brian Layman has mentioned it. There is a longer discussion on Tim Anderson’s blog, which eventually leads to a (partial) solution.

It seems that Apache was telling me the truth. The input filter extension was incorporated in PHP as of v5.2.1. However, Delphi for PHP ships with PHP 5.1.1, and the VCL didn’t know about 5.2.1. A fix has now been released that does not produce the error if PHP 5.2.1 or greater is detected. You can download the new versions of system.inc.php and vcl.inc.php here.

So, now I can use the VCL on the test server in my office without it throwing errors. But I still can’t use it on this site because Pair is currently only running PHP 5.1.1 and I don’t yet know how (or even if I can) install the input filter on this site. One thing is for sure though – there’s no way I’m going to comment out an error trap that would cause a major security breach.

Posted on 7th April 2007
Under: PHP | No Comments »

Continuing Adventures

Mike Swindell has a short post today announcing that a Delphi for PHP 14-day trial is now available. This is good news. And if you stick to doing things in the IDE you’ll probably be favorably impressed. Deployment, on the other hand, requires more work. As I mentioned yesterday, there are issues with PHP installation. Experienced PHP developers, especially those who use *n*x operating systems, will probably breeze through all of this. Anyone who is new to PHP and only used to Windows, on the other hand, may run into the same problems that I am having.
Read the rest of this entry »

Posted on 4th April 2007
Under: PHP | 3 Comments »

Interesting Times

I’ve managed to find a few hours to peek around Delphi for PHP. What it can do is very impressive. Getting to do it for myself is going to take a little longer, if only because I’m unused to the OOP aspects of PHP5. In the meantime, however, here are some observations.

Deployment is easy. There’s a wizard that looks through your application, decides what files you need, and copies them to where you want them – either a local web server or the upload directory of your site management software. I did encounter one small problem. I uploaded one of the sample applications and, when I ran it remotely, was told that a file was missing (specifically, for folks at CodeGear, the windows.php sample application appears to require the adodb subdirectory of the VCL, but the upload wizard missed it). Fixing that was trivial. You can see the sample application here. Yeah, I know it doesn’t do much, but look, there are windows in a web browser, and it took only 53 lines of code, several of which were whitespace, to do that.

Doing something more complicated runs you into problems. There’s a nice list box demo that allows you to enter items and add them to a list. When I run it in the IDE it works fine. When I deploy it I get an error saying “The Input Filter PHP extension is not setup on this PHP installation”. I haven’t worked out what that means yet, but I suspect it may be fairly critical to the performance of the VCL.

And finally, if you want something rather more competent, there’s a nice article about developing components on Steve Trefethen’s blog.

Update: The Input Filter thing appears to be a means of filtering user input to ensure that nothing malicious gets inserted into your site – very important. The Delphi for PHP distribution comes with a “recommended” version of the PHP.INI file, and I’m guessing that if I compare that to what I’ve got I’ll be able to find out which configuration parameters I need to change on my local testing server. Then I need to work out how to make the same changes on my host. This will probably all be obvious to experienced PHP developers, but somewhat mysterious to everyone else. More on this later, but I need to be out of the office today so progress will be slow.

Posted on 2nd April 2007
Under: PHP | 6 Comments »

So Far So Good

OK, here I am back in California. With a bit of help from Nick Hodges (thanks Nick!) I’m making progress on getting the PHP product registered, but you don’t need to register to start playing. I’ve discovered that there are some interesting demo applications shipped with the IDE, and once I have worked out how to deploy applications (obviously I’m going to have to upload the VCL code) I’ll start posting some examples.

In the meantime, however, I have more important things to do. I have tickets for tonight’s baseball game.

Posted on 29th March 2007
Under: PHP | No Comments »

It’s Here!

I have downloaded and installed Delphi for PHP. Unfortunately I’m going to be on the road for the next two days (taxi arriving in half an hour) so you’ll have to wait a while for first impressions.

If anyone from CodeGear is reading this, I tried to register it and I got an error message back: code 13, which it says means that my serial number is already registered to someone else. I probably won’t be able to deal with this until Thursday, but by then I’ll be back home in California and I can give you call.

Posted on 27th March 2007
Under: PHP | 3 Comments »

Nearly There?

Ben Smith says:

Looking forward to PHP next week

And he said that on Sunday, so with any luck “next week” has now become “this week.”

Posted on 26th March 2007
Under: PHP | 1 Comment »

Software Update

In anticipation of the arrival of Delphi for PHP, I have upgraded this blog to run on PHP5 (5.1.1 actually, which is what Pair currently have on offer). Everything seems to be working fine. Fingers crossed.

Posted on 20th March 2007
Under: PHP | 2 Comments »

CodeRage – Tuesday Morning

The tech side seems to be running much better today. There are occasional hiccups, and I had quite a bit of audio break-up in the PHP session, but nothing like as bad as yesterday. This all augurs well for the rest of the week.

I missed the first part of Marco’s talk, but I got there in time to hear him announce that he’s writing a new book based on the additions to Delphi from D2005 onwards. I’m in the queue to buy a copy.

And then the aforementioned PHP session. The more I hear about this product the more I like it. There are people out there doing good work with PHP, but if you’ve been used to developing desktop applications in Delphi the whole web development thing seems unbelievably hard. That’s all about to change. VCL for PHP is going to bring the whole OOP paradigm to building web pages and should make it much easier to write impressive PHP web applications.

Also I’ve heard back from Pair and it turns out that enabling PHP 5 on their servers is a matter of one line in your .htaccess file, so I’m good to go there. Here’s hoping that the product is able to ship soon.

Posted on 13th March 2007
Under: CodeRage, PHP | 1 Comment »

PHP Follow-Up

I’ve been doing a quick bit of research regarding the PHP 5 issue. It appears that Wordpress will work on a PHP 5 site, and I’ve spotted at least one plugin that requires PHP 5, which is promising. However, I also spotted a warning in the Codex about some PHP 5 tricks that don’t work in Wordpress so there may be issues. I suspect if I do add some Delphi PHP demos here they won’t be part of the main blog.

But to add anything I need PHP support from my ISP. I take Andreano’s point that ISPs ought to get with the times, but Pair are not exactly a small outfit and if they don’t have PHP 5 as a standard offering I’m wondering how many people will. The FAQ on their support site says that PHP 5.1.1. is available “as a CGI for customer experimentation.” I’ve dropped off an email to ask what that means and whether 5 will go on general release soon.

I’d really rather not change ISP. I’ve been very happy with Pair. But then again, they don’t have Ruby on Rails support either.

Posted on 12th March 2007
Under: CodeRage, PHP | No Comments »

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