Go Back   System iNetwork Forums > Development > e-Development

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2008, 10:46 AM
hcedmondson's Avatar
hcedmondson hcedmondson is offline
Member
 
Join Date: Sep 2007
Posts: 629
Question Zend PHP Getting Started

I've searched around for Quick Start/Getting Started with Zend PHP for i/5 OS but didn't come across anything. Can anyone recommend a source for guidance on such things as; where do I get it, what are the prerequisites, how to install etc?
Reply With Quote
  #2  
Old 08-07-2008, 10:53 AM
Tomholden's Avatar
Tomholden Tomholden is offline
System iNetwork Forum Pro
 
Join Date: Sep 2005
Location: Lebanon, TN
Posts: 2,112
there's a user guide in the Zend install package that covers some of the basics. also you can check out zend's forums for help. http://www.zend.com/forums/
__________________
Tommy Holden
Just because I'm paranoid doesn't mean they're not out to get me....
Reply With Quote
  #3  
Old 08-07-2008, 11:01 AM
Terry Winchester Terry Winchester is offline
System iNetwork Forum Pro
 
Join Date: Jul 2005
Location: Greene, NY
Posts: 338
Here's a Redbook link that might be helpfull:

http://www.redbooks.ibm.com/abstract...7327.html?Open

Go here and enter PHP to find older related redbooks:

http://www.redbooks.ibm.com/cgi-bin/....cgi?query=PHP

Terry
Reply With Quote
  #4  
Old 08-07-2008, 11:53 AM
Scott Klement's Avatar
Scott Klement Scott Klement is offline
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 9,354
I'd suggest going to Zend's page at:
http://www.zend.com/en/products/i5-solutions/

The basic PHP environment for i5/OS is called "Zend Core for i5/OS". Download it. Inside the download there's a PDF that tells you how to install it. there's also a user guide PDF to tell you how to use it.

The redbook is useful as well -- though, for my purposes -- it never seemed to go in-depth enough to really help me out. Plus, it's probably out of date now... for example, it tells you how to download and install MySQL, which is pointless now since it's part of the Zend Core install -- and some of the directory locations have changed, so you should use the Zend Core instructions, not the ones in the Redbook.
Reply With Quote
  #5  
Old 08-07-2008, 03:16 PM
Ringer's Avatar
Ringer Ringer is offline
Super Member
 
Join Date: Sep 2005
Location: Indiana
Posts: 1,033
The Zend Core i5/OS user guide is a good reference.

I found these PHP books helpful (to me anyway):
Spring into PHP
PHP Cookbook
Essential PHP Security

I bought a book on PHP OOP, but not done reading it yet.

I wasn't that impressed with the following PHP book. Author bashed CGI programs as always reloading on each web request, which is just what PHP scripts do, but RPG CGI does not have to (it's an i5 specific book so... ?). And the example PHP code calling RPG is the same code that many authors have used. Getting Started with PHP for i5/OS

What I'd really like to find is a good example of a PHP web directory structure. Books just don't talk about that, leaving me guessing.

Chris

Last edited by Ringer; 08-07-2008 at 03:19 PM.
Reply With Quote
  #6  
Old 08-08-2008, 08:54 AM
Chris Hird's Avatar
Chris Hird Chris Hird is offline
Super Member
 
Join Date: Feb 2006
Location: Toronto
Posts: 1,085
I have been playing around with PHP for sometime, there are lost of tutorials for non i5 based programming which are a good start. The i5 provides many new challenges to any PHP programmer due to the way IBM has implemented it! The fact that you are probably going to use the DB on the 400 also adds a number of challenges but non that after a little thought should stump you.

I have blog'd about installing and some of the issues surrounding the use of the language and currently going through a new install of the latest release on V6R1 as I want to look at the new 5250 bridge for application interfacing. If you have used C you will find PHP very easy, RPG skills wont help too much (but you are a programmer I hope!). The blog is http://www.shield.on.ca/Blog

Its not going to be an easy slide from RPG to PHP and some of its limitations will only become apparent as you try to do something which is simple in RPG yet complex in PHP. The fact that its interpreted makes you have to think a bit more about when the code will be run and how to manage the program cycle, but overall once you get used to this everything starts to fall into place. Lots of code help out there even if its not for the i5, the principles are the same and unless you are looking to access i5 specific objects most of it will run unchanged.

Hope you get some insights from all the information out there!

Chris...
__________________
Chris Hird
Shield Advanced Solutions Ltd
Home of JobQGenie and Receiver Apply Program.
http://www.shield.on.ca/Blog

Last edited by Scott Klement; 08-08-2008 at 09:33 AM. Reason: Fix URL
Reply With Quote
  #7  
Old 08-08-2008, 09:43 AM
Tomholden's Avatar
Tomholden Tomholden is offline
System iNetwork Forum Pro
 
Join Date: Sep 2005
Location: Lebanon, TN
Posts: 2,112
Quote:
Originally Posted by Chris Hird View Post
Its not going to be an easy slide from RPG to PHP and some of its limitations will only become apparent as you try to do something which is simple in RPG yet complex in PHP. The fact that its interpreted makes you have to think a bit more about when the code will be run and how to manage the program cycle, but overall once you get used to this everything starts to fall into place. Lots of code help out there even if its not for the i5, the principles are the same and unless you are looking to access i5 specific objects most of it will run unchanged.
it really depends on the person as to how big a leap this would be for RPGers. program cycle..yep that's history (but if you only use it to open/close files then it's pretty easy to figure out how to open/close files (especially if using the i5_xxx functions vs. the db2_xxx functions.)
Code:
i5_connect() = connect to system
i5_open() = open file with options read, update,etc
i5_command() = execute CL command
i5_program_prepare() = load program into memory
i5_program_prepare_PCML() = load program into memory using a PCML file for parameters
i5_program_call() = call the program loaded via program_prepare
i5_program_close() = unload program from memory
i5_fetch_row() = read record with options for chain, etc
i5_edit() = set blocking, etc options for record processing
i5_delete() = delete a record (commit)
i5_update() = update a record (commit)
i5_seek() = SETxx
i5_free_file() = close a file
i5_new_record() = write a record
i5_update_record() = update a record
i5_delete_record() = delete a record
i5_query() = EXEC SQL Declare open cursor
i5_prepare() = SQL PREPARE statement
i5_execute() = SQL EXECUTE statement
i5_free_query() = CLOSE SQL Cursor
i5_commit() = SQL Commit
i5_rollback() = SQL rollback
i5_close() = close connection
and tons more but those are the basics and are easily related to RPG opcodes. JMO
__________________
Tommy Holden
Just because I'm paranoid doesn't mean they're not out to get me....
Reply With Quote
  #8  
Old 08-08-2008, 10:00 AM
Chris Hird's Avatar
Chris Hird Chris Hird is offline
Super Member
 
Join Date: Feb 2006
Location: Toronto
Posts: 1,085
Quote:
Originally Posted by Tomholden View Post
it really depends on the person as to how big a leap this would be for RPGers. program cycle..yep that's history (but if you only use it to open/close files then it's pretty easy to figure out how to open/close files (especially if using the i5_xxx functions vs. the db2_xxx functions.)
Code:
i5_connect() = connect to system
i5_open() = open file with options read, update,etc
i5_command() = execute CL command
i5_program_prepare() = load program into memory
i5_program_prepare_PCML() = load program into memory using a PCML file for parameters
i5_program_call() = call the program loaded via program_prepare
i5_program_close() = unload program from memory
i5_fetch_row() = read record with options for chain, etc
i5_edit() = set blocking, etc options for record processing
i5_delete() = delete a record (commit)
i5_update() = update a record (commit)
i5_seek() = SETxx
i5_free_file() = close a file
i5_new_record() = write a record
i5_update_record() = update a record
i5_delete_record() = delete a record
i5_query() = EXEC SQL Declare open cursor
i5_prepare() = SQL PREPARE statement
i5_execute() = SQL EXECUTE statement
i5_free_query() = CLOSE SQL Cursor
i5_commit() = SQL Commit
i5_rollback() = SQL rollback
i5_close() = close connection
and tons more but those are the basics and are easily related to RPG opcodes. JMO
Like I said it may be a big leap or a small one? Implementation isnt for the faint hearted and many have given up just on that stage! The fact that they provide plenty of functions doesnt mean they are easy to code or implement, some of the documentation does leave a bit to be desired. Start looking at how you would configure the Apache servers to provide some of the functionality you need and its a whole new ball game....

If you think its going to be just like creating programs using the standard IBM Websphere tools for i5 development its not! BUT! The resulting skills will be very worthwhile and the improvement to your application in terms of user perception may make the platform stick around a bit longer? IMHO

Keep your eyes and mind open lots of help is starting to surface for those interested in making the leap.

Chris...
__________________
Chris Hird
Shield Advanced Solutions Ltd
Home of JobQGenie and Receiver Apply Program.
http://www.shield.on.ca/Blog
Reply With Quote
  #9  
Old 08-08-2008, 10:05 AM
Tomholden's Avatar
Tomholden Tomholden is offline
System iNetwork Forum Pro
 
Join Date: Sep 2005
Location: Lebanon, TN
Posts: 2,112
well...the install instructions on the latest version were simple, concise and worked for me "out of the box". i had a very rudimentary understanding of PHP at the time and had a master file maintenance program written in days (of course at least 2 of those days were getting the frigging CSS formatting cross-browser compatible...did i mention i'm not really a web designer?)...but as always YMMV. programming in general once you have the concept grasped firmly only requires you to figure out the syntax, logic behind conditional statements, etc are universal.
__________________
Tommy Holden
Just because I'm paranoid doesn't mean they're not out to get me....
Reply With Quote
  #10  
Old 08-08-2008, 10:10 AM
Chris Hird's Avatar
Chris Hird Chris Hird is offline
Super Member
 
Join Date: Feb 2006
Location: Toronto
Posts: 1,085
Quote:
Originally Posted by Tomholden View Post
well...the install instructions on the latest version were simple, concise and worked for me "out of the box". i had a very rudimentary understanding of PHP at the time and had a master file maintenance program written in days (of course at least 2 of those days were getting the frigging CSS formatting cross-browser compatible...did i mention i'm not really a web designer?)...but as always YMMV. programming in general once you have the concept grasped firmly only requires you to figure out the syntax, logic behind conditional statements, etc are universal.
Probably to do with me having moved to Vista! But my experience was not the same (it did not work straight out of the box and I raised a number if issues). But I love PHP so its not going to stop me from moving forward... Have you looked at the new 5250 bridge yet? If so what are your thoughts..

Chris...
__________________
Chris Hird
Shield Advanced Solutions Ltd
Home of JobQGenie and Receiver Apply Program.
http://www.shield.on.ca/Blog
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 06:27 AM.