f13391f27f3422db8aecbf2f229925c7.ppt
- Количество слайдов: 45
Why PHP and IBM i Alison Butterill AD Product Offering Manager butteril@ca. ibm. com © 2009 IBM Corporation
Agenda IBM Power Systems • What is PHP? • Zend • PHP and i • What are customers doing with PHP • my. SQL • Examples 2 © 2009 IBM Corporation
IBM Power Systems Adoption of Open Source 82% Have Open Source in Production or Planned within 12 months 3 © 2009 IBM Corporation
IBM Power Systems Evolution of web applications § Every 7 seconds a new wiki or blog is created… § Next wave of programmers: folks who create content are now empowered to create applications § New platforms being established – providing simple, feature rich environments for editing and contributing content. § Content is handled with a simple WYSIWYG editor that makes editing accessible to anyone § Main content accompanied with discussion tabs, history tabs, version tabs, mailing list tabs 4 © 2009 IBM Corporation
IBM Power Systems Description of Open Community Applications • Wiki – Collaborative website which can be directly edited by anyone with access to it • Content Management System – System used to administer the content of a website • Customer Relationship Management (CRM) – Method used by companies to manage their business relationships. The process includes capture, storage and analysis of clients, vendors, partners and internal process information 5 © 2009 IBM Corporation
IBM Power Systems Description of Open Community Applications • Portal – Site that functions as a point of access to information on the World Wide Web • e. Commerce – Web site that is used for buying and selling services and/or products electronically • Bulletin Board – Web enabled program that allows users to advertise, share information, and meet other people. 6 © 2009 IBM Corporation
Why PHP? IBM Power Systems Low Learning Curve Easy Integration into Heterogeneous Environments Robust, Multi-Platform, High-Performance, Scalable, Secure Vibrant Community 8 Rapid Innovation Run an Agile Business Proven Deployment © 2009 IBM Corporation
What is PHP? IBM Power Systems • PHP is an easy to use, open source, platform independent server-side 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 – Web applications tied to databases – Content management – Wikis and Blogs 9 www. hotscripts. com, www. phpjunkyard. com/ www. phpfreaks. com/ www. phpfreebies. com/ * Source: 2005 Netcraft Survey http: //www. php. net/usage. php © 2009 IBM Corporation
Basic Syntax IBM Power Systems • Flat-text files with a PHP extension • Can be used for command scripting (using the IBM i PASE utilities) • Typically used to add dynamic function to HTML • PHP code embedded in PHP tags: <? php // PHP code ? > • Lines are delimited with a semicolon (; ) • PHP code is processed and the results are sent to the user as HTML – It is important to understand HTML 10 © 2009 IBM Corporation
IBM Power Systems PHP basic examples • helloworld. php <? php echo (“Hello world!”); ? > • helloworld. html <html> <body> Simple scripting language <? php echo (“Hello world!”); ? > </body> </html> 11 © 2009 IBM Corporation
Mapping to Web Artifacts IBM Power Systems <html> <title>Registration</title> <body> <p>You entered: </p> <? php $username = “IBM”; $password = “passw 0 rd”; echo “<p>Username = “. $username. “</p>”; echo “<p>Password = “. $password. “</p>”; ? > </body> </html> 12 © 2009 IBM Corporation
PHP – The Language IBM Power Systems • Variables –Use $ –Case Sensitive • Other Constructs <? php $Greeting = "Hello"; $Who = "World"; echo ("$Greeting $Who!"); ? > –Strings –Arrays –Logical Operators –AND, OR, XOR, ! –Loops –WHILE –Control Statements –ELSE, IF 13 © 2009 IBM Corporation
Where does PHP run? IBM Power Systems 15 © 2009 IBM Corporation
Top 10 Internet Sites by WW traffic IBM Power Systems 1. Yahoo. com 2. You. Tube. com 7. MSN. com 3. Windowslive. com 8. Hi 5. com 4. Google. com 9. Wikipedia. org 5. Myspace. com 16 6. Facebook. com 10. Orkut. org © 2009 IBM Corporation
Agenda IBM Power Systems • • • 17 What is PHP? Zend PHP and i What are customers doing with PHP my. SQL Examples © 2009 IBM Corporation
IBM Power Systems Zend Technologies (www. zend. com) • 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 – Leading supplier of PHP products and solutions – Used by more than 15, 000 companies worldwide – Zend Engine (the PHP kernel) is being used 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 18 © 2009 IBM Corporation
Zend Products IBM Power Systems • Zend Core –A fully tested and enhanced version of the open source PHP runtime environment For IBM i $ • Zend Studio –Provides an integrated IDE for building and debugging PHP applications $ • Zend Guard –Provides code protection and license enforcement tools for solution providers (copyright protection) • Zend Platform –A robust PHP production environment providing performance, scalability and monitoring for PHP applications 19 © 2009 IBM Corporation
System Requirements for Zend Core for i IBM Power Systems • IBM i 6. 1 • i 5/OS V 5 R 4 • i 5/OS V 5 R 3 – Zend Core for i 5/OS Version 1. 6 or later required – i 5/OS V 5 R 3 database PTF SI 25802 is required – Zend Core for i 5/OS does not support remote debugging from a Zend Studio client Portable App Solutions Environment (PASE) 5722 -SS 1 IBM Portable Utilities for i *base 5733 -SC 1 Open. SSH, Open. SST. Zlib 1 5733 -SC 1 Cryto Access Provider 128 bit *base 5722 -AC 3 Qshell 30 5722 -SS 1 System Openness Includes 13 5722 -SS 1 Digital Certificate Manager 20 33 34 5722 -SS 1 © 2009 IBM Corporation
Agenda IBM Power Systems • • • 21 What is PHP? Zend PHP and i What are customers doing with PHP my. SQL Examples © 2009 IBM Corporation
Where Does PHP Run on i? IBM Power Systems 22 © 2009 IBM Corporation
PHP Integration with i IBM Power Systems • Zend products available for IBM i –Zend Core for i –Zend Platform for i • Specifically for accessing IBM i data and resources from PHP (similar to IBM Tool. Box for Java) –DB 2 UDB – SQL and Native –Program call –Procedure call –Data Area –Data Queue –Message Queue –Commands –System values –Spool files 23 © 2009 IBM Corporation
Agenda IBM Power Systems • • • 24 What is PHP? Zend PHP and i What are customers doing with PHP my. SQL Examples © 2009 IBM Corporation
What are i Customers Doing with PHP? IBM Power Systems Top Four: 1. Consolidation: Move PHP applications that are running on Windows or Linux that access data in DB 2 to run in IBM i to speed up or reduce complexity of the applications 2. Modernization: Use PHP to web-enable green screen applications 3. New application development: Create new applications with PHP on IBM i including applications for the intranet, reporting, websites, and extranets 4. Leveraging PHP portfolio: Run commercial or open source PHP applications on IBM i 25 © 2009 IBM Corporation
1. Consolidation IBM Power Systems PHP App on clients Server PROC 1 THIS PWS Web Front End SELECT * INTO UPDATE EMP-MSTR UPDATE DEPT-MSTR PHP App on Server PROC 1 TO THIS PASE PWS 26 SELECT * INTO UPDATE EMP-MSTR UPDATE DEPT-MSTR © 2009 IBM Corporation
2. Modernization IBM Power Systems Zend - 5250 Bridge • Facilitates integrating 5250 applications into Web pages through PHP • Includes PHP functions for accessing 5250 data stream • Included with Zend Platform 27 © 2009 IBM Corporation
IBM Power Systems Modernization DB 2 DB i for DB *PGMs *SRVPGMs User Interface 28 Business Logic Tier © 2009 IBM Corporation
Modernization IBM Power Systems DB 2 DB for DB i View HTML PHP scripts Controller dataqs *PGMs Model *SRVPGMs PASE 29 Business Logic Tier © 2009 IBM Corporation
IBM Power Systems PHP Applications • 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/ 30 © 2009 IBM Corporation
3. New Development: Zend Studio for IBM i IBM Power Systems 31 © 2009 IBM Corporation
Zend Studio Example IBM Power Systems • Executes an SQL query, returning records whose LASTNAME field begins with 'S'. 32 © 2009 IBM Corporation
New. Systems Application Development IBM Power Zend Studio for eclipse for i • Plug-in for eclipse-based tools like IBM Rational tools –Ability to create PHP from within same workbench as RPG, etc. –Currently testing for compatibility • Huge interest from i community 33 © 2009 IBM Corporation
IBM Power Systems Zend Forum for IBM i… www. zend. com/forums 34 © 2009 IBM Corporation
Redbooks that Will Help IBM Power Systems 35 © 2009 IBM Corporation
4. Leveraging Application Portfolio: PHP and My. SQL IBM Power Systems Help Desk Customer Relationship Management Portal Wiki Course Management System e-Commerce Personal Publishing Bulletin Board e-Commerce Content Management System 36 © 2009 IBM Corporation
IBM Power Systems More Applications: php. My. Admin Squirrel. Mail is a standards-based Webmail package. PHP-Nuke is a Web portal and online community system e. Z Publish is an Enterprise Content Management platform with an easy to use out of the box Web Content Management System os. Commerce is an open source e-commerce solution under on going development by the open source community Gallery 37 php. My. Admin is a tool written in PHP intended to handle the administration of My. SQL over the Web Gallery is a slick Web-based photo album written using PHP. © 2009 IBM Corporation
Agenda IBM Power Systems • • • 38 What is PHP? Zend PHP and i What are customers doing with PHP my. SQL Examples © 2009 IBM Corporation
My. SQL IBM Power Systems • My. SQL is the database for the PHP application portfolio – My. SQL is the most popular open source database – 1000 s of PHP scripts and applications use My. SQL • Database Products – My. SQL Community Server §No charge §Supported by community – My. SQL Enterprise §Chargeable §Supported by My. SQL • My. SQL runs in PASE on IBM i today – “How to” posted on Zend Forum Community Edition Download: http: //dev. mysql. com/downloads/mysql/5. 0. html 39 © 2009 IBM Corporation
My. SQL – How It Works IBM Power Systems DB Connect Statement My. SQL Product My. SQL Connection Storage Engines Oracle Translator 40 SQL Server Translator Other Translator Another Translator © 2009 IBM Corporation
DB 2 Storage Engine for My. SQL IBM Power Systems • Supporting open source applications while simplifying data management – Applications written to My. SQL, but data stored in DB 2 – One database to manage, backup and protect – Provides access to My. SQL data from RPG, DB 2 Web Query and more • Plan to be supported with My. SQL Community and Enterprise Editions version 5. 1 – Supported on i 5. 4 and i 6. 1 • Combination of Apache, PHP and My. SQL enables 1000 s of applications on i – Customer Relationship Management, E-Commerce, Portals and Wikis 41 PHP Application RPG Application Writes to Accesses Data My. SQL Data stored in DB 2 for i © 2009 IBM Corporation
Database access – DB 2 IBM Power Systems function querydb($sqlstring) { require("config. php"); $conn = db 2_connect($database, $user, $password, $options); if ($conn) { if (!($stmt = db 2_exec($conn, $sqlstring, array('CURSOR' => DB 2_SCROLLABLE)))) { echo "<b>Error $sqlstring". db 2_stmt_error(). ": ". db 2_stmt_errormsg(). "</b>"; die; } return $stmt; } else { echo "Connection failed. "; die; } } 42 © 2009 IBM Corporation
Agenda IBM Power Systems • • • 44 What is PHP? Zend PHP and i What are customers doing with PHP my. SQL Examples © 2009 IBM Corporation
PHP Applications on i IBM Power Systems • Check out the thousands of PHP scripts available that can be used as-is or as the starting point for Web projects. – – 45 http: //www. hotscripts. com http: //www. phpjunkyard. com/ http: //www. phpfreaks. com/ http: //phpfreebies. com/ © 2009 IBM Corporation
PHP Applications IBM Power Systems 46 © 2009 IBM Corporation
Content Management Applications IBM Power Systems • You can check out over 100 applications including Wiki's, BLOGs, Portals, Forums and much more http: //www. opensourcecms. com/ 47 © 2009 IBM Corporation
Joomla! (Open Source Content Management System) IBM Power Systems My. SQL + PHP on i • Application Website: http: //joomla. org/ • Description: http: //en. wikipedia. org/wiki/Joomla • How To: www. zend. com/forums/index. php? t=msg&th=3068 • Running on i: http: //sei 5 a 2. rchland. ibm. com: 89/joomla 48 © 2009 IBM Corporation
f13391f27f3422db8aecbf2f229925c7.ppt