PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 ·...
Transcript of PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 ·...
![Page 1: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/1.jpg)
© All rights reserved. Zend Technologies, Inc.
PHP on IBM i RPG Examples
Mike Pavlak
Solution Consultant
![Page 2: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/2.jpg)
© All rights reserved. Zend Technologies, Inc.
Agenda
• Intro to PHP Open Source Toolkit
•RPG Program Calls
•Stored Procedures
•Q&A
3
![Page 3: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/3.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server for IBM i
Key Features
Z-Ray (Like Firebug for PHP)
Server Dashboards
Code libraries
Application Deployment
Much more!
4
![Page 4: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/4.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server for IBM i Editions
Basic
Included with IBM i SWMA
Professional
Business hour support and tools
Enterprise
24/7 support and more tools
5
![Page 5: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/5.jpg)
© All rights reserved. Zend Technologies, Inc.
PHP101 Introduction to PHP
![Page 6: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/6.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server under the covers
Zend Server
HTTP:10088 Apache Server (FastCGI)
IBM i
i/OS
DB2 UDB
PHP CGI
PHP file PASE
*PGM
CMD
ILE Apache:10088 • Default
configuration FastCGI
URL Request
HTML/response
![Page 7: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/7.jpg)
© All rights reserved. Zend Technologies, Inc.
PHP Script Structure
•<?php begins block of PHP code
Either in HTML file or alone
Optionally terminate using ?>
Semicolon terminates simple statements
May embed multiple blocks of PHP code in single file
Can string multiple commands in single line
<?php echo “hello world”; ?>
8 Insert->Header & Footer
<?php echo “hello world”; ?>
![Page 8: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/8.jpg)
© All rights reserved. Zend Technologies, Inc.
Rules for variables
•Case sensitive
•Must begin with dollar sign “$”
$thisIsMyVariable
$_AnotherVariable
$ this is not a variable
• Implicit casting
•Can be re-typed (Dynamic typing)
•Constant – Value established in script that does not change
Define(‘SPEAKER’, “Mike Pavlak”);
9 Insert->Header & Footer
<?php $field1 = 5; $field2 = 10.3; $field3 = $field1 + $field2; ?>
![Page 9: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/9.jpg)
© All rights reserved. Zend Technologies, Inc.
The 8 Data Types •Scalar
Integer
• -2,147,483,648 thru 2,147,483,647
• Supports decimal, octal and hex representation
Floating-Point
• 1.7E-308 thru 1.7E+308
• 15 digits of decimal precision
Strings
• Big. Really big. Too big to discuss!
Boolean
• False is 0, 0.0, false keyword, empty string, object w/no values, null. All others are true
• Object, array, null and resource 10 Insert->Header & Footer
![Page 10: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/10.jpg)
© All rights reserved. Zend Technologies, Inc.
Arrays: Value Assingment • Simple
$Animals[0] = ‘Dog’
$Animals[1] = ‘Cat’
$Animals[2] = ‘Hamster’
• Associative
$Barnyard[‘Cow’] = ‘Calf’
$Barnyard[‘Chicken’] = ‘Chick’
$Barnyard[‘Horse’] = ‘Foal’
• Multi-dimensional
$farm[0] = $Animals
$farm[1] = $Barnyard 12 Insert->Header & Footer
![Page 11: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/11.jpg)
© All rights reserved. Zend Technologies, Inc.
Strings
• Most of PHP is character strings
• Single quotes
Variables not expanded
Heavy use of concatenation “.”
$string_1 = ‘This is the value of variable x: ’ . $x
• Double quotes
Variables interpolation
$string_1 = “This is the value of variable x: $x”
13 Insert->Header & Footer
![Page 12: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/12.jpg)
© All rights reserved. Zend Technologies, Inc.
Comments
• A brief comment about comments
• // (C++ style)
indicates single line comment
May use at end of line of live code
Easily comments a line of code
• /* … */ (C Style)
Looks like CL? Pretty close
Comment block,
Can span multiple lines
• Shell style #
15 Insert->Header & Footer
![Page 13: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/13.jpg)
© All rights reserved. Zend Technologies, Inc.
How many equal signs? • = Single equal sign is assignment
$X=3
$Y=$X
Now $Y = 3
• == Double equal sign is for conditions
If ($x==$y) { do something} else {do something else}
If you see single equal in condition, assignment will occur
• === Triple equal sign is exact equal conditions
$X= 3 (Integer) $Y=3.0 (Float)
If ($x==$y) will resolve to true
If ($x===$y) will resolve to false
16 Insert->Header & Footer
![Page 14: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/14.jpg)
© All rights reserved. Zend Technologies, Inc.
Flow Control
• If (condition is always in parenthesis)
Work
•Else
Work
17 Insert->Header & Footer
![Page 15: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/15.jpg)
© All rights reserved. Zend Technologies, Inc.
Flow control…While’s…
•While (condition) {
Do something
•}
•Do {
Something
•} while ($x<$y)
20 Insert->Header & Footer
![Page 16: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/16.jpg)
© All rights reserved. Zend Technologies, Inc.
Foreach
•Jon’s favorite function!
21 Insert->Header & Footer
![Page 17: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/17.jpg)
© All rights reserved. Zend Technologies, Inc.
Most of PHP is functional •Like sub procedures…it you know them you got it!
•Loosely like subroutines, but not quite
Pass parameters
Organize work
Get results
22 Insert->Header & Footer
![Page 18: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/18.jpg)
© All rights reserved. Zend Technologies, Inc.
Functions come from three places
•Built in
Part of core PHP
Available everywhere
phpinfo(); strtoupper(); array();
•Extensions
Usually included with PHP
Requires local Compiler, tec.
DB2_connect; odbc_fetch_row();
•User created
Like sub procedures
23 Insert->Header & Footer
![Page 19: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/19.jpg)
© All rights reserved. Zend Technologies, Inc.
Function is like sub-procedure
•Code it first, then use (not a hard rule)
24 Insert->Header & Footer
![Page 20: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/20.jpg)
© All rights reserved. Zend Technologies, Inc.
PHP101 Database Listing
![Page 21: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/21.jpg)
© All rights reserved. Zend Technologies, Inc.
Employee list with payroll
•Describe the file
•Explore database functions
•Perform some calculations
•Put the output to the web server
26 Insert->Header & Footer
![Page 22: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/22.jpg)
© All rights reserved. Zend Technologies, Inc.
Data looks like….
•Raw data in STRSQL display…
•Using long field names as both long and short are available to PHP via SQL.
27 Insert->Header & Footer
![Page 23: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/23.jpg)
© All rights reserved. Zend Technologies, Inc.
Payroll Master output…
28 Insert->Header & Footer
![Page 24: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/24.jpg)
© All rights reserved. Zend Technologies, Inc.
First page of code
29 Insert->Header & Footer
![Page 25: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/25.jpg)
© All rights reserved. Zend Technologies, Inc.
Second page of code…
30 Insert->Header & Footer
![Page 26: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/26.jpg)
© All rights reserved. Zend Technologies, Inc.
Last page of code…
31 Insert->Header & Footer
![Page 27: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/27.jpg)
© All rights reserved. Zend Technologies, Inc.
Payroll Master output…
32 Insert->Header & Footer
![Page 28: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/28.jpg)
© All rights reserved. Zend Technologies, Inc.
RPG Examples
www.zend.com
Open Source Toolkit
![Page 29: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/29.jpg)
© All rights reserved. Zend Technologies, Inc.
What is the toolkit?
•Set of classes that access IBM i native artifacts
•All Program Objects
RPG, COBOL, CL, etc.
•Others
Command processor
Data Queue’s
Spooled File
More…
•Access naturally from PHP code. No SP’s required
•Easy to use
42 Insert->Header & Footer
![Page 30: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/30.jpg)
© All rights reserved. Zend Technologies, Inc.
XML Service
•Cross platform
•Language agnostic
•Basic plumbing for all open source languages
47 Insert->Header & Footer
![Page 31: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/31.jpg)
© All rights reserved. Zend Technologies, Inc.
PHP Classes
•Class where all wrapper functions start
Yes, this is OO but not too bad…
Look at it and poke around, It’s OK!
This is why we need the path set correctly
51 Insert->Header & Footer
![Page 32: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/32.jpg)
© All rights reserved. Zend Technologies, Inc.
Housekeeping…
•Need to set the extension and instantiate the object
Singleton pattern
Try & Catch
Can put this in your own include
52 Insert->Header & Footer
![Page 33: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/33.jpg)
© All rights reserved. Zend Technologies, Inc.
Now the program call
•Set parameters based on function
Call program
Output results
53 Insert->Header & Footer
I/O
Length
Comment
Var name
Init val
![Page 34: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/34.jpg)
© All rights reserved. Zend Technologies, Inc.
Additional Parameter Types
• AddParameterInt32($io, $comment, $varName, $value, $dimension)
• AddParameterInt64($io, $comment, $varName, $value, $dimension)
• AddParameterUInt32($io, $comment, $varName, $value, $dimension)
• AddParameterUInt64($io, $comment, $varName, $value, $dimension)
• AddParameterFloat ($io, $comment, $varName, $value, $dimension)
• AddParameterReal($io, $comment, $varName, $value, $dimension)
• AddParameterPackdec($io, $length, $scale, $comment, $varName, $value, $dimension)
• AddParameterZoned($io, $length, $scale, $comment, $varName, $value, $dimension)
• AddParameterBin($io, $size, $comment, $varName, $value, $dimension)
• AddDataStruct($array, $parameters, $name=‘struct_name’, $dim, $by, $isArray, $labelLen)
57 Insert->Header & Footer
![Page 35: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/35.jpg)
© All rights reserved. Zend Technologies, Inc.
RPG Examples
www.zend.com
Stored Procedure – Record Set
![Page 36: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/36.jpg)
© All rights reserved. Zend Technologies, Inc.
Have RPG build the result set and use SQL…
66 Insert->Header & Footer
![Page 37: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/37.jpg)
© All rights reserved. Zend Technologies, Inc.
SQL to create the SP & test in iNav CREATE PROCEDURE mpavlak/rpgsp3() LANGUAGE RPGLE
EXTERNAL NAME mpavlak/rpgsp3 GENERAL
67 Insert->Header & Footer
![Page 38: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/38.jpg)
© All rights reserved. Zend Technologies, Inc.
Now open results in PHP…
68 Insert->Header & Footer
![Page 39: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/39.jpg)
© All rights reserved. Zend Technologies, Inc.
Results in browser…
69 Insert->Header & Footer
![Page 40: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/40.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server Update
www.zend.com
Pricing Example
![Page 41: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/41.jpg)
© All rights reserved. Zend Technologies, Inc.
Standard line discount
•RPG is black box, callable from nearly anywhere
•PHP has function to contain RPG call
•Routine to spin through line call for each quantity
77 Insert->Header & Footer
![Page 42: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/42.jpg)
© All rights reserved. Zend Technologies, Inc.
Mainline of code
78 Insert->Header & Footer
![Page 43: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/43.jpg)
© All rights reserved. Zend Technologies, Inc.
CalcDiscount() Part 1
•Setup session for user-RPG program dedication
79 Insert->Header & Footer
![Page 44: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/44.jpg)
© All rights reserved. Zend Technologies, Inc.
CalcDiscount() Part 2 •Create object, etc.
80 Insert->Header & Footer
![Page 45: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/45.jpg)
© All rights reserved. Zend Technologies, Inc.
CalcDiscount() Part 3 •Call program
81 Insert->Header & Footer
![Page 46: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/46.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server Update
www.zend.com
Miscellaneous Toolkit Points
![Page 47: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/47.jpg)
© All rights reserved. Zend Technologies, Inc.
What was passed?
•Toolkit.ini setting
Debug = TRUE
•Turns on DebugOutput file
debugLogFile = "/usr/local/zendsvr/share/ToolkitApi/debug.log“
•Many other directive settings here
83 Insert->Header & Footer
![Page 48: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/48.jpg)
© All rights reserved. Zend Technologies, Inc.
Contents of output
84 Insert->Header & Footer
![Page 49: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/49.jpg)
© All rights reserved. Zend Technologies, Inc.
Stateful processing
•IPC
•Use session ID, for example • $PHPToolkitObj->setToolkitServiceParams ( array ('InternalKey' => "/tmp/$user" ) );
85 Insert->Header & Footer
![Page 50: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/50.jpg)
© All rights reserved. Zend Technologies, Inc.
Zend Server Update
www.zend.com
Wrap it up
![Page 51: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/51.jpg)
© All rights reserved. Zend Technologies, Inc.
Join us at ZendCon The premier PHP conference! October 19-22, 2015 – Las Vegas, NV
www.zendcon.com
Conference Themes PHP in 2015 - The latest PHP technologies and tools Learn how to leverage the latest mobile, HTML 5, testing and PHP best practices, PHP 7 and more
Zend Framework 2 - Hit the ground running Learn how to build faster, more modular and more expandable applications
Development & The Cloud – A love story Learn how the latest developments in cloud-based services, infrastructure and best practices can benefit you
Conference Highlights • Sessions focused on how to best develop and deploy PHP
• Sessions designed for all knowledge levels
• Intensive tutorials for accelerated learning
• PHP Certification crash courses and testing
• Exhibit hall showcasing the latest products
• Special networking opportunities during meals and events
![Page 52: PHP on IBM i RPG Examplesuiipa.org/wp-content/uploads/2015/08/2015-09-16-UIIPA... · 2019-01-01 · PHP on IBM i RPG Examples Mike Pavlak Solution Consultant . ... Zend Technologies,](https://reader034.fdocuments.in/reader034/viewer/2022042222/5ec86d324194e1340172a10e/html5/thumbnails/52.jpg)
© All rights reserved. Zend Technologies, Inc. 88 Insert->Header & Footer
Q&A
www.zend.com
Please fill out your Session Evaluation!