📜 ⬆️ ⬇️

Delphi for PHP 2.0 - joy and disappointment.

With Delphi, I am very close friends since the second version (in my opinion, 96th year), but stopped following the updates after the release of the eighth version, which was focused on .NET and compiled applications only for it, and therefore did not represent for me absolutely no interest.

And last year, Delphi 2007 came out at CodeGear, the new owner of Delphi, a rather noticeable event, considering the fact that the main people had already been buried after the sale of the delphi. Studying the new IDE features, I stumbled upon a strange product - Delphi for PHP (d4php), and since Delphi as an IDE and as a programming language I know a little worse than Russian, I decided to take a moment and look at PHP from the other side.

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

And again, the news about the imminent release of Delphi 2009 made me look at the CodeGear website. And though D2009 is presented so far only in the form of predashek, my trip turned out to be more than successful - I met Delphi for PHP 2.0.
')
Of course, compared with the first version of the product, the second is a powerful leap forward:
• IDE was put in order - now working in it is as convenient as in D2007 - highlighting the changed code, folding blocks, refactoring - surprisingly, this was not the case in the first version
• Added page templates. The simplest use - we developed the framework in any application, copied it onto a form - everything, now all controls that you use will be integrated into your design. A very useful feature that brings d4php2 closer to the realities of modern website 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 handful of useful vcl-components + glitches fixed in the previously existing ones (how well - I didn’t have time to get acquainted with this yet - everything is ahead)
• Improved debugger.

But without the tar could not:

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

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

In general, the idea is evolving - and this is wonderful. If CodeGear will be more attentive to product development, there is a possibility that Delphi for PHP will be able to do for the web what it did for Win32 Delphi in its time - to allow developing applications to be available and “intuitively understandable”. And as an option, applications written by cattle-Delphi-coders on cattle-PHP will soon appear on the network.

If you are interested in digging: www.codegear.com/products/delphi/php

Further specifics - solving 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 a control on the form and start it, some people may have some 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 such. The reason is simple - include_path in php did not initialize correctly. The root cause is that apache and php settings files are now stored separately for each user in C: \ Documents and Settings \% username% \ Application Data \ CodeGear \ Delphi for PHP \ 2.0 \. If the username is specified using letters other than Latin, then the PHPIniDir directive in the apache settings will not work - either apache interprets it incorrectly, or php misunderstands. 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 of type c: \ d2php \ php \, and then change the config itself , and 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, if you change the php settings via the IDE, you will have to either manually edit this php.ini additionally or copy the already configured Application Data.

Source: https://habr.com/ru/post/40270/


All Articles