API Reference Guide > PHP XMLSERVICE Toolkit > Compatibility Wrapper

Toolkit Compatibility Wrapper

The Toolkit Compatibility Wrapper allows scripts that use i5 Toolkit functionalities to continue to do so with requests fulfilled by the XMLSERVICE Toolkit functions with none, or limited code changes.

Configuring the PHP and Apache to Work with the XMLSERVICE Toolkit

Because the Toolkit Compatibility Wrapper uses the same function names as the i5 Toolkit , this extension must first be disabled for the Toolkit Compatibility Wrapper to be tested.

Method 1

Use your standard ZENDSVR Apache instance.

Note:

This way is easiest,  but any production applications that rely on i5 Toolkit may not work correctly if the extension is disabled.

 

 

Instructions on how to complete a procedure

To disable i5 Toolkit and test the Toolkit Compatibility Wrapper using Method 1:

  1. Comment out the following directive in the /usr/local/zendsvr/etc/php.ini  file:
    ;extension=i5comm.so

  2. Restart Apache.

 

Method 2

Create a second Apache instance called CW where you can disable the i5comm extension. This “second instance” method is not supported by Zend, but allows you to test the Toolkit Compatibility Wrapper without interfering with existing applications. You will also get “auto prepending” of the Toolkit Compatibility Wrapper in your tests so you will not have to add an “include” or “require.”

 

 

Instructions on how to complete a procedure

To disable i5 Toolkit and test the Toolkit Compatibility Wrapper using Method 2:

  1. Copy the 'php.ini' file from
    /usr/local/ZendSvr/etc/php.ini
     to
     /usr/local/ZendSvr/etccw/php.ini

  2. Edit /usr/local/ZendSvr/etccw/php.ini:

  • ;disable i5 toolkit extension
  • ;extension=i5comm.so
  1. Also in this special 'PHP.INI' file, add ToolkitAPI path to the 'include_path' directive:
    /usr/local/zendsvr/share/ToolkitAPI

Note:

In the special PHP.INI file, you may want to set max_execution_time = 120 or so, so that experimental long-running demo scripts will not end prematurely.

  1. Find “auto_prepend_file” in the INI and set it as below to point to the shared location (within the include_path set earlier) of the Toolkit Compatibility Wrapper library, so all your scripts in this instance will automatically use the Toolkit Compatibility Wrapper:
    auto_prepend_file = "CW/cw.php"
  2. Save this INI file.

  3. Set up a new Apache instance, called CW, with configuration in /www/cw/conf and its own fastcgi.conf in the same folder.

Note:

The CW instance will have a different port number than usual, perhaps something like 10092.

  1. In /www/cw/conf/fastcgi.conf, point to the custom directory where php.ini resides:
    SetEnv="PHPRC=/usr/local/ZendSvr/etccw"

  2. If you need to change anything in conf.d, you can also set:
    SetEnv="PHP_INI_SCAN_DIR=/usr/local/ZendSvr/etccw/conf.d"

  3. Start the CW Apache instance.

If you want to run your existing scripts with this CW server, you can let the Toolkit Compatibility Wrapper see them by adding Alias statements in Apache. For Example:

# Allow CW instance to run old toolkit class library from zendsvr

Alias /i5Toolkit_library /www/zendsvr/htdocs/i5Toolkit_library

# Allow requests for files in Zend Server folders (see aliases above)

<Directory /www/zendsvr/htdocs>

  Options FollowSymLinks

  order allow,deny

  allow from all

  AllowOverride all

</Directory>

 

Configuring the Toolkit Compatibility Wrapper

To configure the Toolkit Compatibility Wrapper, open the /usr/local/zendsvr/share/ToolkitApi/toolkit.ini configuration file.

Configuration options include:

Compatibility Changes

Limitations

Note:

For users of 5250 Bridge: Zend Server  5.1.1 (only available from IBM at this time) includes an updated version of 5250 Bridge that works with the new toolkit, so the Toolkit Compatibility Wrapper is not required for the 5250 Bridge.

For further information on the XMLSERVICE Toolkit and the Toolkit Compatibility Wrapper, including technical documentation and updates, go to http://www.youngiprofessionals.com/wiki/XMLSERVICE.

 

Read Also

 

PHP Toolkit XML Service Functions 

   
 

PHP Toolkit for IBM i