Presentation about Web Services in PHP for IBM System-i users. Sam Pinkhasov (Zend) did most of the presentation, I did the general part on PHP (first 9 slides). Presentation was done at the IBM Future Proof event in Eindhoven (june 5th, 2007)
2. Agenda
• PHP overview
• PHP products for i5/OS
• How to create a Web Service wrapper for an RPG
program
• Q&A
#2
3. What is PHP?
• PHP is an easy to use, open source,
platform independent scripting language
Designed for web application development
4.5+ Million PHP Developers
• PHP is the leading scripting language
deployed on the Internet
22+ Million Internet domains
Out Pacing Microsoft’s ASP*
• Thousands of PHP applications are
available
www.sourceforge.org
Web applications tied to databases
www.hotscripts.com,
Content management
Wikis and Blogs
www.phpjunkyard.com/
www.phpfreaks.com/
www.phpfreebies.com/
* Source: 2005 Netcraft Survey http://www.php.net/usage.php
#3
4. Drivers for PHP growth
• The Migration to Web Applications
When did you last install a desktop application?
Emerging generation of software services (Web2.0)
Web becoming the new UI to existing backend applications
• PHP is the perfect Web Integration Platform
Perfect front-end glue language
Best support for browser based rich client applications (Ajax)
Strong support for Web Services, XML & legacy systems
Powerful SOA capabilities enable new IT approaches (“mashable assets”)
for reducing application backlogs
• PHP is backed by a very strong community
Very easy to learn and adopt
~ 1000 committers, ~ 4.5M developers (corporate/community)
Thousands of opensource projects and applications
Hundreds of thousands of commercial deployments
#4
5. How does PHP work?
1. Browser requests a Web page (HTML) from the Web server.
2. The user enters data or performs an action.
3. The browser sends a request for a PHP file to the Web server.
4. The Web server forwards the PHP file to the PHP engine
5. The PHP engine processes the PHP code, optionally accessing
server resources (such as a database) or performing calculations.
6. The PHP engine replaces the PHP code with the results of its
processing
7. The result (all HTML code) is sent to the Web server.
8. The Web server sends the result as a response to the browser
9. The browser loads the response code.
#5
6. PHP Example
Original HTML HTML Processed by PHP Engine
<html>
<html>
<head><title>Test page></title></head>
<head><title>Test
Page</title></head>
<p>
<p>
PHP Code
<?php
This is my php test page
echo “This is my PHP test page”
?> </p>
</p>
</html>
</html>
#6
7. Why use PHP?
• Easy to learn with a large support community
• Most popular server side language on the Web
• Thousands of free PHP applications are available
• Fairly lightweight runtime environment
Easy to administer (Zend provides tools)
• Provides many extensions for particular programming tasks
Database APIs (DB2, MySQL, Oracle, SQLServer, etc.)
i5 PHP Toolkit (only available with Zend Core or Zend Platform)
XML
PDF
Cryptography
Web services
#7
8. Why Do Developers Use PHP?
Zend's June 2003 market snapshot of the PHP community. The survey had over 10,000 respondents.
http://www.zend.com/zend/php_survey_results.php
#8
9. What Types of Applications in PHP?
Zend's June 2003 market snapshot of the PHP community. The survey had over 10,000 respondents.
http://www.zend.com/zend/php_survey_results.php
#9
10. Zend Technologies
• The founders of Zend have been key contributors to the PHP
language since 1997
• Zend delivers commercial products that enable developers and IT
personnel to deliver and operate business-critical PHP
applications
Zend has been the leading supplier of PHP products and solutions for
the last six years. Its products and solutions are being used by more than
15,000 companies worldwide. The Zend Engine (the PHP kernel) is
being utilized on more than 22 million websites today
Zend takes the open source PHP code through rigorous testing for
additional quality assurance and adds over 35 popular PHP extensions
to deliver their PHP runtime environment
• Zend provides enterprise level support for the PHP environment
# 10
11. What are System i Customer’s Doing
with PHP?
– Consolidation: Move PHP applications that are running
on Windows or Linux that access data in DB2 to run in
i5/OS to speed up or reduce complexity of the applications.
– Modernization: Use PHP to web-enable green screen
applications.
– New application development: Create new applications
with PHP on i5/OS including applications for the intranet,
reporting, websites, and extranets.
– Leveraging PHP portfolio: Run commercial or
opensource PHP applications on i5/OS.
# 11
12. Market – Products
• Zend Core for i5/OS (Free)
A fully tested and enhanced version of the open source PHP runtime
environement.
• Zend Studio for i5/OS (Free)
Provides an integrated IDE for building and debugging PHP applications
• Zend Support (Free & Chargeable)
Free web-based support and chargeable premium support
• Zend Platform for i5/OS (Chargeable)
A robust PHP production environment providing performance, scalability, and
monitoring for PHP applications
• Zend Guard (Chargeable)
Provides code protection and license mgmt tools for solution providers
• Services (Chargeable): Training and Pro Service
# 12
14. Zend Core for i5/OS
• Zend Core is a distribution of PHP maintained through
a partnership between IBM and Zend
Native DB2/400 UDB/Cloudscape support
Toolkit - Native access System i objects :
• Programs, Service programs(*SRVPGM) and CL commands
• Spooled file, Data Queue, User Space, Job logs
WebEnabler Technology
Zend Studio Server for remote debugging
Everything you need to get started
• You can download Zend Core for free
Contains everything you need to start building applications
(Apache web server, PHP 5.x.x and most common extensions)
# 14
15. PHP Environment After Installation
System i5
i5/OS
URL:
PASE
http://myproxy:89/core/registration.php
I5/OS
Request
HTTP:89
HTTP:8000 resources
Server
Server
(Reverse Proxy)
Response
PHP
Module
HTML + PHP Zend Core
DB2 UDB
Zend
Platform
# 15
17. i5 Toolkit APIs
• Are shipped with Zend products
Zend core for i5/OS
• Geared towards accessing i5 data and resources
from PHP
Similar in purpose to the IBM Tookbox for Java
# 17
24. Zend Studio Professional for i5/OS
• Special, freely-available version
for i5/OS servers
• The most productive
development environment for
PHP
Highly advanced PHP editor
Client/Server debugging & profiling
Database integration
Fully supports PHP 5 and the latest
technologies
Runs on Windows, Linux, MAC
Tightly integrated with the Zend
product line
# 24
26. Zend Studio for i5/OS System
Requirements
Supported Operating Systems,
Platforms and OS versions:
Windows x86 2000, XP, 2003
Linux x86
Linux x86-64
Mac OS X Power 10.4
• Zend Studio Client - PHP
Compatibility:
Supports all PHP versions
# 26
30. Reliability - PHP Intelligence
Fix Errors Immediately - Ensures full business
availability
Integration with Zend Studio provides direct access to the affected source
code - Immediate Debugging & Profiling enables code problems to be
identified and fixed within seconds
# 30
31. Integration - Java Bridge
Java Bridge – Easy Integration
Integrating with Java is as simple as
instantiating the object, and using it
Java objects are mapped to PHP objects
<?
$system = new Java(quot;java.lang.Systemquot;);
print $system.quot;nquot;; // will use toString in PHP5
print quot;Java version=quot;.$system->getProperty(quot;java.versionquot;).quot; <br>nquot;;
print quot;Java vendor=quot;.$system->getProperty(quot;java.vendorquot;).quot; <p>nnquot;;
print quot;OS=quot;.$system->getProperty(quot;os.namequot;).quot; quot;.
$system->getProperty(quot;os.versionquot;).quot; on quot;.
$system->getProperty(quot;os.archquot;).quot; <br>nquot;;
?>
# 31
32. Integration - BIRT Reporting
Reporting Framework Integration
• Create graphical reports using Actuate API through PHP
• Based on the
Eclipse Open Source Business Intelligence Reporting and Tools (BIRT)
project
# 32
34. Zend Guard for i5/OS
• Encoding & Obfuscation
Enables the PHP source code protection, against copyright infringement
and reverse-engineering, of commercial PHP applications
Provides IT Managers with a solution that prohibits modification of their
internal PHP application source code so they can effectively support them
• Licensing
Allows ISVs to impose a variety of licensing policies on commercial PHP
applications
Vendors can increase their revenue by choosing from a variety of licensing
models such as concurrent users, time limited, segment of network, server
specific or i5/OS processing group
• Product Components
Front End GUI
Encoder CLI
Zend Optimizer
# 34
38. Web Services
• Definition
The W3C defines a Web service as a software system
designed to support interoperable machine-to-machine
interaction over a network. Web services are frequently
just application programming interfaces (API) that can
be accessed over a network, such as the Internet, and
executed on a remote system hosting the requested
servicesg group
• A Web Service enables an application to expose what
it does or what it knows so that other applications can
make use of it. .
# 38
39. Web Services
• Web Services web site www.programmableweb.com
• Lists more than 350 APIs
• Web Services opens the door for software
applications written in different languages to be able
to exchange data and services.
# 39
40. Web Services
• Web Service is not a trivial task
• Knowledge of OOP, XML and SOAP.
• Zend’s products shield developers from development
complexity
• Demo:
Create Web Service using Zend’s tools that will wrap existing
RPG program
# 40
41. Web Services
0022.00 ***************
0023.00 C *ENTRY PLIST
0024.00 C PARM CODE 10
0025.00 C PARM NAME 10
0026.00 **********************
0027.00 C CODE IFEQ '1'
0028.00 C movel 'IBM' name
0029.00 C ELSE
0030.00 C CODE IFEQ '2'
0031.00 C movel 'Zend' name
0032.00 C ELSE
0033.00 C movel 'wrong code' code
0034.00 C ENDIF
0035.00 C ENDIF
0036.00 C*
0037.00 C SETON LR
0038.00 C RETURN
•
•
# 41
49. Web Services Benefits
• Shortens the development cycle
• Re-usability
• Building blocks for SOA
# 49
50. Zend for i5/OS Resources
• Monthly Newsletter - Email JDILLARD@ZEND.COM to receive
Zend i5/OS Newsletter
• WWW.IBUILDINGS.NL
Dutch PHP Zend partner
• PHP Tutorial http://php.net/manual/en/tutorial.php
• Zend forum for i5/OS http://www.zend.com/forums/index.php?t=index&cat=7
• IBM Redbooks:
Building SOA-based Solutions for IBM System i5 Platform
http://www.redbooks.ibm.com/redpieces/abstracts/sg247284.html?Open
• IBM RedWiki
PHP Zend for i5/OS
http://www-941.haw.ibm.com/collaboration/ibmwiki/display/sg247327/Home
# 50
51. Zend for i5/OS Resources
• Check out the thousands of PHP scripts available that can be
used as-is or as the starting point for Web projects.
http://www.hotscripts.com
http://www.phpjunkyard.com/
http://www.phpfreaks.com/
http://phpfreebies.com/
# 51