Delphi for PHP

OpenLogin VCL for PHP component screencast

Just to complete the previous article, I have recorded this screencast which shows how easy is to create a nice login screen with the OpenLogin component.

Is as simple as to drop it on a form, and then write the login logic on the OnLogin event, in this case, we are hardcoding the valid username and password, but we can check against a database or whatever we need.

In fact, the logical thing to do would be to combine it with the ZAuth component, so no coding will be required to perform the authentication.

Check out the screencast here:

http://www.qadram.com/vcl4php/docwiki/screencasts/OpenLogin/OpenLogin.html

Posted by José León on March 2nd, 2009 under Delphi for PHP, VCL4PHP | Comment now »


Open Login component for VCL for PHP

As a result of the application we are working in, we are starting to pack, wrap, document and now upload, some components to the VCL for PHP Open Components site.

This one is called Open Login and is based on a sample login, using jQuery and Ajax, found in this site:

http://www.chazzuka.com

Now the site is offline, will update the link to a more specific one when this happens.

You can find the code here:

http://vcl4phpoc.svn.sourceforge.net/viewvc/vcl4phpoc/trunk/openlogin/

And here is a sample:

http://www.qadram.com/vcl4php/samples/OpenLogin/index.php

To see the source code for this sample, here are some links:

http://www.qadram.com/vcl4php/samples/OpenLogin/index.phps

http://www.qadram.com/vcl4php/samples/OpenLogin/login.phps

http://www.qadram.com/vcl4php/samples/OpenLogin/dmAuth.phps

And is as simple as to place it on a page, and use the OnLogin event to determine if the user/password combination is valid.

It features javascript validation, css theming, and uses ajax to communicate with the server. This simple component shows the power of Delphi for PHP reusing code and how easy is to add fancy features to an application with almost no code.

Hope you like it!

Posted by José León on February 27th, 2009 under VCL4PHP | Comment now »


VCL for PHP Open Components

We have just opened a new project on SourceForge to host the development of third-party components for VCL for PHP, this is the URL:

http://sourceforge.net/projects/vcl4phpoc

At this moment, you can find on the source code repository, OpenGrid and OpenChart, the goal is not to clutter a lot the default VCL for PHP and have a central repository you can find these components.

To know more about OpenChart, you can check these previous posts, OpenGrid is in very beta stage, but it can do things like this master-detail form, using ajax:

If you have developed VCL for PHP components, under an Open Source license, and you want to use this repository for its development, please, contact me at jose.leon@embarcadero.com

Posted by José León on February 27th, 2009 under VCL4PHP | Comment now »


Using Delphi for Windows code from Delphi for PHP

PHP has the ability to be extended using code from other languages, this can be done using extensions, which are nothing but a dynamic library. So, on Windows, you can write your own extensions using Delphi for Windows, and in fact, is very easy, because of a great library, called php4Delphi. This library is also used by Delphi for PHP IDE to interact with PHP engine, so you can be sure works very well ;-)

On this article, I’m going to show you how to create such extension and how to configure Delphi for PHP to use it. I’m going to use Delphi 2009 and an special version of php4Delphi, that works with Delphi 2009.

You can download it from here:

http://seo4you.pl/php4delphi-delphi-2009/

Check the documentation on how to install it, but basically are two packages, one is the runtime package, and the other is the design time one.

Once it’s installed, you have a new item on the repository, called PHP Extension:

If you select it, a new .dll project will be generated, with a .dproj and a .pas file, save everything on a folder of your choice, we are going to use the ‘myextension’ name for everything.

IMPORTANT: Be sure to check the unit just created is part of the project, because it seems there is some kind of bug and the unit is not added to the project.

Adding functions

Now is time to add the functions we want to use on PHP, this can be done by editing the Functions property of the extension module, check this shot:

This is a collection editor where we can add new functions, so clicking on the new button, will create a new one, and we can set all its information

Each function has the Parameters property, another collection we can edit and set the name for the parameter and also the expected parameter type.

Once the function is created, to write the working code for it, just generate the function’s OnExecute event handler, on this case, we are going to return the length of the first parameter:

Setting up the extension in Delphi for PHP

It is convinient to set the project to generate the .dll in the extension folder PHP uses, this can be set using the project options dialog:

So now is time to tell the PHP engine the IDE uses to load this extension. The first thing to do is to ensure the IDE is closed, if not, the changes we perform are not going to work. To tell PHP to load an specific extension, we need to edit the php.ini file, but the IDE uses a template file to generate this one, so this is the file we need to edit. It’s located by default on C:\Program Files\CodeGear\Delphi for PHP\2.0\php, you can use a text editor to open this file, and then, search for ";extension=php_bz2.dll", this will point you to the zone of the file where all extensions are loaded. Now you need to add a new line:

extension=myextension.dll

Now, when you load the IDE, your new function will be ready to be used and you can write code like this:

If you run this script, produces the right result, 14 ;-)

Passing objects

It is also possible to pass objects from Delphi for Windows to Delphi for PHP, in this case, you need to cast them to integer, so they will be used as handlers in PHP code. Then, when you want to send it to Delphi for Windows to perform operations, simply send the integer value and cast it to the right type of object.

Conclusion

This is a nice way to provide web interfaces to your existing applications, and also, a nice way to extend your php applications using third party functionality.

Posted by José León on February 26th, 2009 under Uncategorized | 3 Comments »


Developer Camp 2009 and Open Source Conference at Japans Electronics College

This post is the last of the series of posts about Delphi for PHP sessions and interviews performed in Japan.

We had a meeting to check about the integration of Delphi for PHP with Japanese, and I got this nice present by natane, she contributed a big improvement to the Oracle Native Components on VCL for PHP, and she also has created this two references for Japanese customers.

Delphi for PHP was also present in Developer Camp with 3 technical sessions and 1 Open Talk session:

  • Visual PHP programming with Delphi for PHP
  • Delphi for PHP Tutorial for Delphi Developers
  • Delphi for PHP Database Application Development
  • Talk about "Delphi like" concept with Delphi developers

There were around 60 people on each session, the event was really well organized, and the work of the three interpreters that helped attendants with english-japanese translation, was great. All the material is recorded, so probably will be online in few weeks.

I had also the opportunity to go around and visit some electronic shops, and on this photo you can check the Delphi for PHP book available for selling on the PHP section at a bookstore:

On friday, we attended the Open Source Conference at Japan Electronics College, and was exciting see so much people on the booths. The session presented was:

  • Delphi for PHP - Enabling PHP Visual Web Development

Here is a photo of the Embarcadero booth, showing Delphi for PHP and 3rdRail:

And there, I had the opportunity to meet Ruby creator, Yukihiro "Matz" Matsumoto, and we talked about the possibility of a Delphi for Ruby ;-)

Also, I performed some interviews for several media, here are the links:

[ITPro] (Nikkei SOFTWARE)
http://itpro.nikkeibp.co.jp/article/Interview/20090216/324863/?ST=NSW
February 16, 2009
‘Should Choose Best Development Tool for Current Matter,’ Says Developer of
Delphi for PHP

[ITmedia Enterprise]
http://www.itmedia.co.jp/enterprise/articles/0902/18/news084.html
February 18, 2009
Delphi for PHP’ Developer Appeals Merit of Developing Web Applications with
GUI

[CodeZine]
http://codezine.jp/article/detail/3598
February 23, 2009
Mr. Leon, Developer of Delphi for PHP Talks About ‘IDE for PHP Which Can Run
Everything It Should’

[@IT]
http://www.atmarkit.co.jp/news/200902/16/delphiphp.html
February 16, 2009
‘PHP is Most Appropriate Language for Web Application’

And finally, I would like to thank all the people at Embarcadero Japan, and also to all the people I have met, because they have treated me really well, and I have enjoyed very much with this experience.

Posted by José León on February 24th, 2009 under Uncategorized, Web services | Comment now »


VCL for PHP article at php|architect

On the February issue of php|architect, you can find an article I wrote for the magazine, which introduces VCL for PHP, please, check it out:

http://www.phparch.com/c/magazine/issue/91

Posted by José León on February 22nd, 2009 under VCL4PHP | 1 Comment »


PHP Camp

Last saturday, we had the opportunity to share a nice time with many young developers, so they got a complete overview of what Delphi for PHP is and how can the use it to improve the speed of development.

The session was nice and it was streamed live using Ustream.Tv, so you can watch it here:

http://www.ustream.tv/recorded/1151699

There were also three more interesting sessions, about PHP status in Japan, about OpenPear, and also about PHPUnit, and we discussed several ideas we can use to improve Delphi for PHP.

On sunday, we performed a three hour hands-on, so attendees could try the product and check how to work with it.

Posted by José León on February 15th, 2009 under Delphi for PHP | Comment now »


Developer Summit 2009 - Japan (II)

The schedule for today is complete, we had a really nice session this morning, everything went perfectly and I think we concentrated in short time the essence of what Delphi for PHP is and what is useful for.

Here is a photo of the event:

And here is the URL of the session:

Click here

After that, we had an interview with a very friendly CodeZine journalist, and I answered questions about the origins of the product, the target market and the strengths that make Delphi for PHP unique.

Tomorrow we will start with PHP Camp, and will keep blogging about it

Posted by José León on February 12th, 2009 under Delphi for PHP | Comment now »


Developer Summit 2009 - Japan

Today is the first day (yesterday we had the reception party, which was great) of the Shoeisha Developer Summit 2009, and there is planned a panel discussion talking about Delphi for PHP, after that, there is a media interview from CodeZine, will keep writting as the sessions are progressing.

The ambient and the audience seems to be really great and lots of people are going to attend, so it’s going to be a nice opportunity to show the capabilities and features of Dephi for PHP and VCL for PHP.

Stay tunned!

Posted by José León on February 12th, 2009 under Delphi for PHP, VCL4PHP | Comment now »


VCL for PHP to be used on a GPL web application

Just write this post to inform you that qadram software S.L. has signed an agreement to develop a big web application, this web application will use VCL for PHP and, the core, will be released as GPL, with the goal to be freely reused by anyone. This can be of interest to Delphi for PHP users, because will see a professional web application using VCL for PHP, but will get part of it so they are able to base their future developments on this code.

Below are the details of the agreement:

NEW RELEASE OF THE E-SOURCING SOLUTION ITBID USING DELPHI FOR PHP

The company Iáñez & Tapia, owner of the technology for purchasing negotiations ITbid, has commissioned to qadram software S.L. for the development of the new release of his e-Sourcing solution.

Barcelona / Elche - February 1, 2009 - qadram software S.L. and Iañez & Tapia S.L. join forces to write next version of the powerful e-Sourcing solution ITbid - the leader software for purchasing negotiations at the spanish-speaking markets but also used by many buyers of important companies all around the world.

The development is going to take approximately 1 year and the resulting application will use VCL for PHP as base technology. Renew electronic request for quotes and proposals (RFx), reverse auction and other purchasing related e-tools will be delivered by Iáñez & Tapia to be used by their customers, usually under a SaaS Agreement.

Iañez & Tapia S.L. provides the expertise gathered with its customers in the field of electronic purchasing negotiations and qadram software S.L. provides its expertise in the software development technology by using Delphi for PHP.

The application is planned to be developed in a modular way, in order to be reused for developing other software solution, like e-commerce stores, CMS systems, etc. Iañez & Tapia S.L. agrees to release the core under GPL license, so will be freely available for other users.

About Iáñez & Tapia S.L.
Founded in 2002 by renowned experts with decades of experience, Iáñez & Tapia is an innovative - but traditionally managed company focused in development and marketing of rational web-based technologies for purchasing departments.

For more information on Iáñez & Tapia S.L., please visit
http://www.itbid.org

About qadram software S.L.
Founded in 2003, qadram software S.L. is focused on developing custom software solutions and tools for software developers. We are experts in web technologies, specifically PHP and Delphi for PHP it is our main product, developed in partnership with Embarcadero Technologies.

For more information on qadram software S.L., please visit
http://www.qadram.com

Posted by José León on February 1st, 2009 under Delphi for PHP, VCL4PHP | Comment now »




Server Response from: blog2.codegear.com