Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Zend Products and PHP for IBMi




Shlomo Vanunu
Zend Global Services
                               © All rights reserved. Zend Technologies, Inc.
CV

    • Shlomo Vanunu is a senior consultant in the Zend lab
      located in Ramat Gan Israel and is a part of the i5 Global
      Services Team, involved in the development of the Zend for
      i5/OS installation base for IBMi.
    • At the Zend IBMi Global Services, he provides technical
      services support and education for Zend Products for IBMi
      and related technologies on IBMi.
    • Shlomo has worked in the IT industry for 25 years and has
      experience with IBMi OS, programming and several other OS
      variants.




2                         © All rights reserved. Zend Technologies, Inc.
Agenda

• IBM/ZEND Relationship and Offering
• Zend Server/Studio Integration
• Open Source Toolkit/Compatibility Wrapper
• Zend Framework
• QA




3                      © All rights reserved. Zend Technologies, Inc.
Increasing the Maturity of the PHP Application Lifecycle




A PHP Server for            The RightScale Zend                               A professional-grade
business-critical PHP       PHP Solution Pack                                 development environment
applications that require   enables you to easily                             that includes PHP code
performance, reliability    manage a PHP runtime                              editing, debugging, profili
and security.               environment in the                                ng, unit
                            cloud.                                            testing, diagnostics and
                                                                              more.

4                            © All rights reserved. Zend Technologies, Inc.
Zend Server 5.6 for IBMi
    Key Features
      Shipping with IBMi 6.1 & 7.1

      New Open Source Toolkit

      Performance enhancements

      PHP 5.3.8

      Zend Framework 1.11.3

      Application Deployment

      PTF Update as well as full package
         • Hotfix




5                           © All rights reserved. Zend Technologies, Inc.
Zend Server 5.6 for IBMi




6   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Zend Products for IBMi Prerequisites
• Prerequisite IBMi License programs –
   GO LICPGM  Select option 10. Display installed licensed programs



• Check the list of installed license programs:
   5722SS1   30       Qshell
   5722SS1   33        Portable App Solutions Environment
   5722SS1   13        System Openness Includes
   5722DG1 *BASE      IBM HTTP Server for i5/OS
   5733SC1   *BASE    IBM Portable Utilities for i5/OS

   5733SC1   1         OpenSSH, OpenSSL, zlib



                               © All rights reserved. Zend Technologies, Inc.   #
Installation
• Interactive Installation
 RSTLICPGM LICPGM(2ZSVRPI) DEV(*SAVF) SAVF(QGPL/ZSVRSAVF)

• Objects created
   The ZENDSVR library,
   /usr/local/Zendsvr directory,
   /www/zendsvr directory (web document root)
   Zend-supplied user profiles
   The Zendsvr subsystem and the HTTP servers
• Batch/Silent Install
SBMJOB (RSTLICPGM LICPGM(2ZSVRPI) DEV(*SAVF) SAVF(QGPL/ZSVRSAVF))



                              © All rights reserved. Zend Technologies, Inc.   #
Configuration - Setup Menu




                   © All rights reserved. Zend Technologies, Inc.   #
Configuration -   Setup Menu




                    © All rights reserved. Zend Technologies, Inc.   #
Zend Server, Zend Studio
           Integration




 11
Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Zend Server Integration

• Zend Server
   A value-added PHP install for IBMi, Linux, Windows, Mac OS X

   Community Edition (CE) and regular edition

   Installs a copy of Zend Framework
     • PHP.INI specifies “/usr/local/zendsvr/share/ZendFramework/” in its
       include_path variable
     • All your PHP applications will be able to find the /library/zend folder without
       any further work



• http://www.zend.com/en/products/server/



                            © All rights reserved. Zend Technologies, Inc.
Zend Studio Integration

     • Zend Studio
           Integrated Development Environment (IDE)

           IBMi edition is free thanks to IBM/Zend relationship

           Also installs its own copy of Zend Framework! (on your PC)



     • http://www.zend.com/en/products/studio/




13   Insert->Header & Footer    © All rights reserved. Zend Technologies, Inc.
Zend Framework

     • Zend Framework
          Can work with any PHP 5.x installation, but of course it works
              best with the Zend Products for IBMi
          Installed automatically with Zend Server for IBMi
              /usr/local/zendsvr/share/ZendFramework/library/zend
          Updates available at
              http://framework.zend.com/download/latest
          Unzip into /usr/local… (see above) or your ZF library folder



     • www.framework.zend.com


14   Insert->Header & Footer      © All rights reserved. Zend Technologies, Inc.
Zend DBi

     • Drop in replacement for MySQL
     • Updates existing MySQL installation
     • DB2 storage engine included




15   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Zend DBi – DB2/MySQL
• Zend DBi: MySQL Replacement for IBMi
     Use PHP's most popular database on the IBMi
     MySQL has become the most commonly used database for PHP applications.

     Zend's commitment to the IBMi platform, Zend DBi is available as a compatible
        drop-in replacement for MySQL on IBMi.
     Zend DBi erases any uncertainty about the future of IBMi as a supported MySQL
        platform:
      built using the same open-source code used to build MySQL, and will be kept
        up to date by Zend and IBM with all features and bug fixes introduced in
        MySQL.
     Zend DBi is part of the enterprise-ready PHP technology stack for IBMi that
        allows users to leverage open and industry standard solutions, while keeping
        their web and mobile workloads on existing IBMi systems where
        databases, business logic, and legacy applications reside.

16   Insert->Header & Footer      © All rights reserved. Zend Technologies, Inc.
PHP Open Source Toolkit
 Access your IBMi




17             © All rights reserved. Zend Technologies, Inc.
Open Source PHP Toolkit

• Open Source!
  Community Involvement can improve it

  Customer can tweak!

  Usher new era for IBMi developer!!!

• Collaboration between IBM and Zend
• Built on ILE RPG, Stored procedures and pure PHP
• Speed improvement over current toolkit
• Cross Platform Solution, run PHP scripts on desktop to IBMi
• Object Oriented, but not too much!


                       © All rights reserved. Zend Technologies, Inc.
New Toolkit Has Two Components
• IBM
  XML Service

• Zend
  Series of classes that “wrap” the IBM project

  ToolkitService() Class

  Zend built the PHP wrapper

  Let your i5 functions use the new toolkit under the covers

• No OO training required to use them!!!
• Need IBM PTF’s! (See Release Notes!)



                            © All rights reserved. Zend Technologies, Inc.
XML Service lives at YiPs!




20   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Get your own copy of the code!
     • RPG, XML & Stored Procedures

                                         http://www.youngiprofessionals.com




21   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Toolkit Architecture


       DB2
                               DB2 Extension
     Functions
                                 or ODBC                         DRDA                     DB2
                                XML
                                                                                         Stored
                                   PHP                                                 Procedures
        OO                                                                                 &
                                  Classes
     Program                                                                              Data
                                  Toolkit
       Calls
                                    API
                                                                                             XML
                                                                                                                 HLL’s
                                         OO Request                                                            RPG, COBOL
        i5                                                                                RPG
                               Compatibility                                           XMLSERVICE
     functions
                                 Wrapper                                                                        System
                                                                                                   Parm Data
                                                                                                               Artifacts

22   Insert->Header & Footer          © All rights reserved. Zend Technologies, Inc.
What are the major components?

     • Program calls
     • Operating System functions
     • SQL access




23   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
Toolkit Overview

• Setting Database Connections
   $ToolkitServiceObj =
      ToolkitService::getInstance($Host, $USER, $PASSWORD”, $ExtensionPrefix)
  

• Setting the XML Service Options
   $ToolkitServiceObj->setToolkitServiceParams(array('lib=>$XMLServiceLib 'plug' =>
      $Plug, internalKey'=>$InternalKey, controlkey'=>$ControlKey, 'debugflag'=>$debug, 'lang
      uage'=>$Encoding));


   include_once 'authorization.php';
      include_once '../API/ToolkitService.php';

      $ToolkitServiceObj =
      ToolkitService::getInstance(“*LOCAL”, “USER”, “PASSWORD”, “ibm_db2”);


                                   © All rights reserved. Zend Technologies, Inc.
Toolkit Overview
• The CLCommand Method


  CLInteractiveCommand – Will return the command message or
   command return values.
     $message = $obj->CLInteractiveCommand($Command);


  CLcommand – Will run the command in the batch without returning
   command messages or command return values.
     $obj->CLCommand($Command);




                         © All rights reserved. Zend Technologies, Inc.
Toolkit Overview
• The PGMCall Method
  The program call method allows calling a program (*PGM) or service
   program (*SRVPGM).

  PgmCall($Program, $Library, $Parameters, $ReturnValue, $Function)


  Define Program Parameters Methods
        The AddParameterPackDec
        The AddParameterZoned
        The AddParameterInt
        The AddParameterUInt
        The AddParameterFloat
        The AddParameterBin
        The AddDataStructure
        The SetParameterValue

                               © All rights reserved. Zend Technologies, Inc.
Toolkit Overview
• Define Program Parameters Methods
     AddParameterChar Method
        AddParameterChar( $IOType, , $Size, $Comment, $Name, $Value);

     AddParameterPackDec Method
        AddParameterPackDec ($IOType, , $Size, $Comment, $Name, $Value) ;

     AddParameterZoned Method
         AddParameterZoned ($IOType, , $Size, $Comment, $Name, $Value)
        $param[] = $ToolkitServiceObj->AddParameterPackDec('both',12,2,'CheckAmt', 'amount', '2000.25');



     SetParameterValue
         SetParameterValue ($Name, $Value)
                   $ToolkitServiceObj->SetParameterValue('code', '2');

     $ToolkitServiceObj->disconnect()


27   Insert->Header & Footer                 © All rights reserved. Zend Technologies, Inc.
Samples!
• Located off the document root in directory NewToolkit!
• Contains sample program call, etc…




                      © All rights reserved. Zend Technologies, Inc.
Zend Framework




29             © All rights reserved. Zend Technologies, Inc.
Overview

• Zend Framework
   Open source framework

   Develop secure web applications and web services with PHP 5

   Implemented using object oriented code and design



• Unique component structure
  Each component designed with few dependencies on other
   components
  Many loosely coupled components that you can use more or less
   independently or “use-at-will”


                       © All rights reserved. Zend Technologies, Inc.
Overview

• Zend Framework also
  Provides an advanced Model-View-Controller (MVC)
   implementation
  Used to establish a basic structure for your Zend Framework
   applications
  A database abstraction that is simple to use

  Forms/Views components that implements HTML form rendering

  Validation and Filtering

  Allows developers to consolidates all operations




                        © All rights reserved. Zend Technologies, Inc.
Overview

     • Zend Framework Components list




32   Insert->Header & Footer   © All rights reserved. Zend Technologies, Inc.
33   Zend Framework home page   © All rights reserved. Zend Technologies, Inc.
Resources
     • Recorded Webinars
          http://www.zend.com/en/resources/webinars/i5-os



     • Zend Server for IBM i main page, link to downloads
          http://www.zend.com/en/products/server/zend-server-ibm-i



     • Zend Server manual:
          PDF: http://www.zend.com/topics/Zend-Server-5-for-IBMi-Reference-Manual.pdf

          Online: http://files.zend.com/help/Zend-Server-5/zend-
              server.htm#installation_guide.htm




34   Insert->Header & Footer              © All rights reserved. Zend Technologies, Inc.
Books!




     • Gutmans - PHP 5 Power Programming
     • White - PHP 5 in Practice
     • Schroeder/Olen – The IBM i
35                       © All rights reserved. Zend Technologies, Inc.

More Related Content

Zend Products and PHP for IBMi

  • 1. Zend Products and PHP for IBMi Shlomo Vanunu Zend Global Services © All rights reserved. Zend Technologies, Inc.
  • 2. CV • Shlomo Vanunu is a senior consultant in the Zend lab located in Ramat Gan Israel and is a part of the i5 Global Services Team, involved in the development of the Zend for i5/OS installation base for IBMi. • At the Zend IBMi Global Services, he provides technical services support and education for Zend Products for IBMi and related technologies on IBMi. • Shlomo has worked in the IT industry for 25 years and has experience with IBMi OS, programming and several other OS variants. 2 © All rights reserved. Zend Technologies, Inc.
  • 3. Agenda • IBM/ZEND Relationship and Offering • Zend Server/Studio Integration • Open Source Toolkit/Compatibility Wrapper • Zend Framework • QA 3 © All rights reserved. Zend Technologies, Inc.
  • 4. Increasing the Maturity of the PHP Application Lifecycle A PHP Server for The RightScale Zend A professional-grade business-critical PHP PHP Solution Pack development environment applications that require enables you to easily that includes PHP code performance, reliability manage a PHP runtime editing, debugging, profili and security. environment in the ng, unit cloud. testing, diagnostics and more. 4 © All rights reserved. Zend Technologies, Inc.
  • 5. Zend Server 5.6 for IBMi Key Features Shipping with IBMi 6.1 & 7.1 New Open Source Toolkit Performance enhancements PHP 5.3.8 Zend Framework 1.11.3 Application Deployment PTF Update as well as full package • Hotfix 5 © All rights reserved. Zend Technologies, Inc.
  • 6. Zend Server 5.6 for IBMi 6 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 7. Zend Products for IBMi Prerequisites • Prerequisite IBMi License programs – GO LICPGM  Select option 10. Display installed licensed programs • Check the list of installed license programs: 5722SS1 30 Qshell 5722SS1 33 Portable App Solutions Environment 5722SS1 13 System Openness Includes 5722DG1 *BASE IBM HTTP Server for i5/OS 5733SC1 *BASE IBM Portable Utilities for i5/OS 5733SC1 1 OpenSSH, OpenSSL, zlib © All rights reserved. Zend Technologies, Inc. #
  • 8. Installation • Interactive Installation RSTLICPGM LICPGM(2ZSVRPI) DEV(*SAVF) SAVF(QGPL/ZSVRSAVF) • Objects created The ZENDSVR library, /usr/local/Zendsvr directory, /www/zendsvr directory (web document root) Zend-supplied user profiles The Zendsvr subsystem and the HTTP servers • Batch/Silent Install SBMJOB (RSTLICPGM LICPGM(2ZSVRPI) DEV(*SAVF) SAVF(QGPL/ZSVRSAVF)) © All rights reserved. Zend Technologies, Inc. #
  • 9. Configuration - Setup Menu © All rights reserved. Zend Technologies, Inc. #
  • 10. Configuration - Setup Menu © All rights reserved. Zend Technologies, Inc. #
  • 11. Zend Server, Zend Studio Integration 11 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 12. Zend Server Integration • Zend Server  A value-added PHP install for IBMi, Linux, Windows, Mac OS X  Community Edition (CE) and regular edition  Installs a copy of Zend Framework • PHP.INI specifies “/usr/local/zendsvr/share/ZendFramework/” in its include_path variable • All your PHP applications will be able to find the /library/zend folder without any further work • http://www.zend.com/en/products/server/ © All rights reserved. Zend Technologies, Inc.
  • 13. Zend Studio Integration • Zend Studio  Integrated Development Environment (IDE)  IBMi edition is free thanks to IBM/Zend relationship  Also installs its own copy of Zend Framework! (on your PC) • http://www.zend.com/en/products/studio/ 13 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 14. Zend Framework • Zend Framework Can work with any PHP 5.x installation, but of course it works best with the Zend Products for IBMi Installed automatically with Zend Server for IBMi /usr/local/zendsvr/share/ZendFramework/library/zend Updates available at http://framework.zend.com/download/latest Unzip into /usr/local… (see above) or your ZF library folder • www.framework.zend.com 14 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 15. Zend DBi • Drop in replacement for MySQL • Updates existing MySQL installation • DB2 storage engine included 15 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 16. Zend DBi – DB2/MySQL • Zend DBi: MySQL Replacement for IBMi Use PHP's most popular database on the IBMi MySQL has become the most commonly used database for PHP applications. Zend's commitment to the IBMi platform, Zend DBi is available as a compatible drop-in replacement for MySQL on IBMi. Zend DBi erases any uncertainty about the future of IBMi as a supported MySQL platform:  built using the same open-source code used to build MySQL, and will be kept up to date by Zend and IBM with all features and bug fixes introduced in MySQL. Zend DBi is part of the enterprise-ready PHP technology stack for IBMi that allows users to leverage open and industry standard solutions, while keeping their web and mobile workloads on existing IBMi systems where databases, business logic, and legacy applications reside. 16 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 17. PHP Open Source Toolkit Access your IBMi 17 © All rights reserved. Zend Technologies, Inc.
  • 18. Open Source PHP Toolkit • Open Source! Community Involvement can improve it Customer can tweak! Usher new era for IBMi developer!!! • Collaboration between IBM and Zend • Built on ILE RPG, Stored procedures and pure PHP • Speed improvement over current toolkit • Cross Platform Solution, run PHP scripts on desktop to IBMi • Object Oriented, but not too much! © All rights reserved. Zend Technologies, Inc.
  • 19. New Toolkit Has Two Components • IBM XML Service • Zend Series of classes that “wrap” the IBM project ToolkitService() Class Zend built the PHP wrapper Let your i5 functions use the new toolkit under the covers • No OO training required to use them!!! • Need IBM PTF’s! (See Release Notes!) © All rights reserved. Zend Technologies, Inc.
  • 20. XML Service lives at YiPs! 20 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 21. Get your own copy of the code! • RPG, XML & Stored Procedures http://www.youngiprofessionals.com 21 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 22. Toolkit Architecture DB2 DB2 Extension Functions or ODBC DRDA DB2 XML Stored PHP Procedures OO & Classes Program Data Toolkit Calls API XML HLL’s OO Request RPG, COBOL i5 RPG Compatibility XMLSERVICE functions Wrapper System Parm Data Artifacts 22 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 23. What are the major components? • Program calls • Operating System functions • SQL access 23 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 24. Toolkit Overview • Setting Database Connections  $ToolkitServiceObj = ToolkitService::getInstance($Host, $USER, $PASSWORD”, $ExtensionPrefix)  • Setting the XML Service Options  $ToolkitServiceObj->setToolkitServiceParams(array('lib=>$XMLServiceLib 'plug' => $Plug, internalKey'=>$InternalKey, controlkey'=>$ControlKey, 'debugflag'=>$debug, 'lang uage'=>$Encoding));  include_once 'authorization.php'; include_once '../API/ToolkitService.php'; $ToolkitServiceObj = ToolkitService::getInstance(“*LOCAL”, “USER”, “PASSWORD”, “ibm_db2”); © All rights reserved. Zend Technologies, Inc.
  • 25. Toolkit Overview • The CLCommand Method CLInteractiveCommand – Will return the command message or command return values. $message = $obj->CLInteractiveCommand($Command); CLcommand – Will run the command in the batch without returning command messages or command return values. $obj->CLCommand($Command); © All rights reserved. Zend Technologies, Inc.
  • 26. Toolkit Overview • The PGMCall Method The program call method allows calling a program (*PGM) or service program (*SRVPGM). PgmCall($Program, $Library, $Parameters, $ReturnValue, $Function) Define Program Parameters Methods The AddParameterPackDec The AddParameterZoned The AddParameterInt The AddParameterUInt The AddParameterFloat The AddParameterBin The AddDataStructure The SetParameterValue © All rights reserved. Zend Technologies, Inc.
  • 27. Toolkit Overview • Define Program Parameters Methods AddParameterChar Method AddParameterChar( $IOType, , $Size, $Comment, $Name, $Value); AddParameterPackDec Method AddParameterPackDec ($IOType, , $Size, $Comment, $Name, $Value) ; AddParameterZoned Method AddParameterZoned ($IOType, , $Size, $Comment, $Name, $Value) $param[] = $ToolkitServiceObj->AddParameterPackDec('both',12,2,'CheckAmt', 'amount', '2000.25'); SetParameterValue SetParameterValue ($Name, $Value) $ToolkitServiceObj->SetParameterValue('code', '2'); $ToolkitServiceObj->disconnect() 27 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 28. Samples! • Located off the document root in directory NewToolkit! • Contains sample program call, etc… © All rights reserved. Zend Technologies, Inc.
  • 29. Zend Framework 29 © All rights reserved. Zend Technologies, Inc.
  • 30. Overview • Zend Framework  Open source framework  Develop secure web applications and web services with PHP 5  Implemented using object oriented code and design • Unique component structure Each component designed with few dependencies on other components Many loosely coupled components that you can use more or less independently or “use-at-will” © All rights reserved. Zend Technologies, Inc.
  • 31. Overview • Zend Framework also Provides an advanced Model-View-Controller (MVC) implementation Used to establish a basic structure for your Zend Framework applications A database abstraction that is simple to use Forms/Views components that implements HTML form rendering Validation and Filtering Allows developers to consolidates all operations © All rights reserved. Zend Technologies, Inc.
  • 32. Overview • Zend Framework Components list 32 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 33. 33 Zend Framework home page © All rights reserved. Zend Technologies, Inc.
  • 34. Resources • Recorded Webinars http://www.zend.com/en/resources/webinars/i5-os • Zend Server for IBM i main page, link to downloads http://www.zend.com/en/products/server/zend-server-ibm-i • Zend Server manual: PDF: http://www.zend.com/topics/Zend-Server-5-for-IBMi-Reference-Manual.pdf Online: http://files.zend.com/help/Zend-Server-5/zend- server.htm#installation_guide.htm 34 Insert->Header & Footer © All rights reserved. Zend Technologies, Inc.
  • 35. Books! • Gutmans - PHP 5 Power Programming • White - PHP 5 in Practice • Schroeder/Olen – The IBM i 35 © All rights reserved. Zend Technologies, Inc.