网事如风 2007-3-28 07:50
[转贴] Delphi For Php Quick Start
[size=5]Delphi for PHP quick start [/size][size=5] [/size]By: [url=http://gp.codegear.com/authors/edit/119.aspx][color=#3848a8]John Kaster[/color][/url]
[indent][b]Abstract:[/b] A brief introduction to installing and using Delphi for PHP
[/indent][url=http://dn.codegear.com/article/34059#tocentry1][color=#3848a8] [/color][/url][color=#3848a8] [/color]What is Delphi for PHP?[b]Delphi for PHP[/b] is a new product from CodeGear for developing with PHP applications, modules, libraries and components "the Delphi way." Delphi for PHP is a [b]R[/b]apid [b]A[/b]pplication [b]D[/b]evelopment (RAD) environment with a designer, editor, debugger, deployment wizard, and component framework called "VCL for PHP."
Our existing Delphi customers will find it extremely familiar. We hope PHP developers will find it very productive, fun, and friendly to use.
[url=http://dn.codegear.com/article/34059#tocentry2][color=#3848a8] [/color][/url][color=#3848a8] [/color]Installing Delphi for PHPWhile [b]Delphi for PHP[/b][b]™[/b] applications can run on any device supporting PHP, the integrated development environment (IDE) is only supported on the Microsoft Windows platform in this release. After you have your installation file for [b]Delphi for PHP[/b], you can run the installation tool.
When you run the install, you will first see this screen.
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000001.png[/img][/color]
Click [b]Next[/b], and you'll see a license agreement dialog.
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000002.png[/img][/color]
The text won't be blurry like it is in this screen shot, however!
If you click [b]I accept the agreement[/b] and [b]Next[/b], you'll see a dialog similar to the following:
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000003.png[/img][/color]
Specify the folder for your install, and click [b]Next[/b].
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000004.png[/img][/color]
You can change the name of the Start Menu folder if you want, and click [b]Next[/b].
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000005.png[/img][/color]
Decide whether you want to create a desktop icon or not, and click [b]Next[/b].
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000006.png[/img][/color]
If your installation choices are correct, click [b]Install[/b].
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000007.png[/img][/color]
The install will start running. At any time, you can click [b]Cancel[/b] to roll back the installation process and cancel the install. [color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000008.png[/img][/color]
After the installation completes, you are ready to use [b]Delphi for PHP[/b]. If you leave the checkbox checked and click [b]Finish[/b], the IDE will load. Everything you need to develop and test a PHP application on your local machine has been installed and configured, including PHP, Apache, InterBase and MySQL Database engines and PHP connectivity for them.
[url=http://dn.codegear.com/article/34059#tocentry3][color=#3848a8] [/color][/url][color=#3848a8] [/color]Delphi for PHP IDE overviewThe Delphi for PHP IDE [b]is[/b] written in Delphi, but it is not currently part of the Galileo IDE, which is the host environment for [url=http://dn.codegear.com/delphi][color=#3848a8]Delphi[/color][/url], [url=http://dn.codegear.com/cpp][color=#3848a8]C++Builder[/color][/url], and [url=http://dn.codegear.com/csharp][color=#3848a8]C#Builder[/color][/url]. It should be very familiar to any Delphi, C++Builder or C#Builder developer however. We have made it as similar to the developer studio IDE as possible for this first release.
The first thing you will see is the attractive splash screen.
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000009.png[/img][/color]
[url=http://dn.codegear.com/article/34059#tocentry4][color=#3848a8] [/color][/url][color=#3848a8] [/color]Default IDE layoutWhen the IDE first loads, the welcome page and the default layout view is displayed.
[color=#0000ff]Hide image
[/color][url=http://dn.codegear.com/article/images/34059/0300000A.png][color=#0000ff][img]http://dn.codegear.com/article/images/34059/thumb0300000A.png[/img][/color][/url]
[url=http://dn.codegear.com/article/34059#tocentry5][color=#3848a8] [/color][/url][color=#3848a8] [/color]Welcome pageThe welcome page provides direct links to recent projects, recent files, and headlines relevant to [b]Delphi for PHP[/b]. The headlines are provided automatically from RSS and/or atom feeds published by CodeGear, and are only updated when you are connected to the internet.
[color=#0000ff]Hide image
[/color][url=http://dn.codegear.com/article/images/34059/0300000B.png][color=#0000ff][img]http://dn.codegear.com/article/images/34059/thumb0300000B.png[/img][/color][/url]
[url=http://dn.codegear.com/article/34059#tocentry6][color=#3848a8] [/color][/url][color=#3848a8] [/color]Creating a projectTo create a new project, click the [b]New[/b] button on the welcome page, select the [b]File | New[/b] menu item and pick the option you want to create.
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/0300000C.png[/img][/color]
If you click [b]New[/b] or select [b]Other[/b][b] …[/b] you will see this dialog:
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/0300000D.png[/img][/color]
Select [b]Application[/b] and click [b]OK[/b]. This will create the application and present the design interface to you.
[url=http://dn.codegear.com/article/34059#tocentry7][color=#3848a8] [/color][/url][color=#3848a8] [/color]New PHP application[color=#0000ff]Hide image
[/color][url=http://dn.codegear.com/article/images/34059/0300000E.png][color=#0000ff][img]http://dn.codegear.com/article/images/34059/thumb0300000E.png[/img][/color][/url]
As you can see, the Welcome page has been replaced by the PHP [b]form designer[/b]. The [b]Code Explorer[/b] tab is populated with an outline of navigation points for your form. The [b]Object Inspector[/b] allows you to edit the properties of the selected item on the design surface. (Right now, the selected item is the form itself.) The [b]Project Manager[/b] shows all files related to this project (or group of projects). The [b]Tool Palette[/b] lists all the components you can drag and drop onto the form designer.
[url=http://dn.codegear.com/article/34059#tocentry8][color=#3848a8] [/color][/url][color=#3848a8] [/color]Designing the formNow that the blank form is displayed in the designer, we can drop the components onto it directly from the [b]tool palette[/b]. So, let's drop an [font=Courier New]Edit[/font], [font=Courier New]ListBox[/font][font=Courier New],[/font] and [font=Courier New]Button[/font]
component onto the form. I'll resize the [font=Courier New]Edit[/font] so it is the same width as the [font=Courier New]ListBox[/font], and put the Button to the right of the [font=Courier New]Edit[/font] control.
[color=#0000ff]Hide image
[/color][url=http://dn.codegear.com/article/images/34059/0300000F.png][color=#0000ff][img]http://dn.codegear.com/article/images/34059/thumb0300000F.png[/img][/color][/url]
[b]Note:[/b] You can also double click on a component to put a copy of it on the center of the design surface and move it from there.
Next, I'll change the caption for the button to "Add" in the object inspector, and double click on the button to create its click event.
[color=#0000ff]Hide image
[/color][url=http://dn.codegear.com/article/images/34059/03000010.png][color=#0000ff][img]http://dn.codegear.com/article/images/34059/thumb03000010.png[/img][/color][/url]
This creates the event stub for the button click event, and puts me in the source code editor right inside the click event. I'm ready to type my code. The final version of the Button click event is:
[b]function[/b] Button1Click($sender, $params){$this->ListBox1->Items[] = $this->Edit1->Text;}When the application is run, the browser looks something like this:
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000011.png[/img][/color]
We can type text in the edit box, and click the Add button to prove how easy and fast it is to design and build applications with [b]Delphi for PHP[/b].
[color=#0000ff]Hide image
[/color][color=#0000ff][img]http://dn.codegear.com/article/images/34059/03000012.png[/img][/color]
[url=http://dn.codegear.com/article/34059#tocentry9][color=#3848a8] [/color][/url][color=#3848a8] [/color]Stay tunedStay tuned for more information on [b]Delphi for PHP[/b]. This article is intended to introduce the basic concepts of Delphi-style development for PHP, but there is much more to cover for the rich world of PHP development!
Trackback: [url]http://tb.blog.csdn.net/TrackBack.aspx?PostId=1543532[/url]
Nothing 2007-3-28 10:50
现在可以下载了吗?
估计这是Delphi的最后机会了。