Delphi for PHP 2.0 - joy and frustration.

    I have been very close friends with Delphi since the second version (I think the 96th year), but I stopped following the latest updates after the eighth version, which was oriented to .NET and compiled applications only for it, and therefore did not represent absolutely no interest.

    And last year, CodeGear, the new owner of Delphi, released Delphi 2007 - a rather noticeable event, given the fact that the main people buried her after the sale of the dolphin. Studying the new features of the IDE, I accidentally stumbled upon a strange product - Delphi for PHP (d4php), and since I know Delphi as an IDE and as a programming language a little worse than Russian, I decided to take a moment and look at PHP from another perspective.

    I played with the first version of d4php for a week: a fairly convenient implementation of the IDE for PHP, a clear development mechanism, interesting ideas and features (such as using AJAX to “redraw” pages without a single line of code - the “Use AJAX” checkbox). But one thing killed - a huge pile of bugs, a giant one. So big that to make even a tiny full-fledged service was not possible. In addition, d4php was more like a tool for developing intranet applications, because missing a very important part - templates. Perhaps somewhere inside, where I did not get it, there was some solution, but d4php was not suitable for developing normal Internet applications.

    And again, the news of the upcoming release of Delphi 2009 made me look at the CodeGear website. And although D2009 is presented only in the form of presentations so far, my trip turned out to be more than successful - I met Delphi for PHP 2.0.

    Of course, compared to the first version of the product, the second one is a powerful leap forward:
    • IDEs are put in order - now it’s as convenient to work in it as in D2007 - highlighting the changed code, folding blocks, refactoring - it is surprising that this was not in the first version
    • Added page templates. The simplest use - they developed a framework in any application, copied to a form - that's it, now all the controls that you use will be integrated into your design. A very useful feature that brings d4php2 closer to the realities of modern site building.
    • Added support for a large list of databases (MySQL, Interbase, MSSQL, Oracle, etc.). Apparently this feature is focused on the corporate software sector, but still nice.
    • Added a bunch of useful vcl-components + fixed glitches in the previously existing ones (how high-quality - I have not had time to get acquainted with this yet - everything is ahead)
    • Improved debugger.

    But they could not do without tar:

    Firstly, d4php2 is not officially sold in Russia. A very strange decision - is it really more difficult to send an electronic key by mail to Russia than to the states? And $ 250 now for serious developers is not the biggest money. Eh ... Astalavista :)

    And secondly, in order for d4php2 to work, the majority of the non-English-speaking population of the planet needs to pre-process it with a file. About what is there, why and how to fix it at the very end of the post.

    In general, the idea is developing - and this is wonderful. If CodeGear takes a closer look at product development, there is a possibility that Delphi for PHP can do for the web what it once did for Win32 Delphi - let you develop applications in an accessible and intuitive way. And as an option, applications written by redneck-Delphi-coders in redneck-PHP will appear on the network soon.

    If you're interested in rummaging around: www.codegear.com/products/delphi/php

    Further specifics are the solution to the problem of launching applications in Delphi for PHP 2.0. Those who are not looking for an answer to this question will most likely not be interested in reading.


    If, after installation, you create a project, throw some control on the form and start, some may get errors:

    Warning: require_once (vcl / vcl.inc.php) [function.require-once]: failed to open stream: No such file or directory in ... on line 2
    Fatal error: require_once () [function.require]: Failed opening required 'vcl / vcl.inc.php)' (include_path = '.: / usr / local / php5 / lib / php ') in ... on line 2

    Such or practically the same. The reason is simple - include_path in php was not initialized correctly. The root cause - apache and php settings files are now stored for each user separately in C: \ Documents and Settings \% username% \ Application Data \ CodeGear \ Delphi for PHP \ 2.0 \. If the username is specified using non-Latin letters, then the PHPIniDir directive in the apache settings will not work - either apache interprets it incorrectly, or php does not correctly accept it. In general, there are two options: either create another user with a name consisting only of Latin letters, or change the apache config so that it refers to a copy of php.ini located in the "normal" directory. To do this, copy the php.ini file from C: \ Documents and Settings \% username% \ Application Data \ CodeGear \ Delphi for PHP \ 2.0 \ php \ to a folder like c: \ d2php \ php \, and then change not the config itself, but the config template (httpd.template.conf), and not in Application Data, but in “C: \ Program Files \ CodeGear \ Delphi for PHP \ 2.0 \ apache2 \ conf \ "So that PHPIniDir refers to your copy. In this case, when changing php settings through the IDE, you will either have to edit this php.ini manually additionally, or copy an already configured one from Application Data.

    Also popular now: