|
1 |
| -## Hello world! |
| 1 | +**ATTENTION: THIS IS WORK IN PROGRESS AND NOT TO BE USED UNTIL THIS MESSAGE DISAPPEARS!** |
2 | 2 |
|
3 |
| -This is work in progress. Come back later. |
| 3 | +## What is this? |
| 4 | + |
| 5 | +PHP/SAP defines an layer of abstraction between actual SAP remote function calls and your PHP-Code. Therefore PHP/SAP provides three types of interfaces for abstraction: |
| 6 | +1. Configuring a connection to an SAP application server. |
| 7 | +2. Connecting to an SAP application server |
| 8 | +3. Calling a remote function on an SAP application server. |
| 9 | + |
| 10 | +## The motivation |
| 11 | + |
| 12 | +In case you have legacy code written for PHP <= 5.x using one of these PHP modules to call SAP remote functions, and you need to update this code to a PHP version >= 7.x, this project is for you. |
| 13 | + |
| 14 | +There are currently several open source PHP modules available that are compiled using the SAP RFC SDK or SAP Netweaver RFC SDK. Each one of them handles the main tasks, connecting and calling a remote function, quite differently. To complicate things, none of them are available for old and new versions of PHP. |
| 15 | + |
| 16 | +In order to clean this up, you need to remove the dependency of your PHP code on one of these modules. After that you will be able to switch between modules and PHP versions without the need to touch your code calling SAP remote functions. |
| 17 | + |
| 18 | +```php |
| 19 | +<?php |
| 20 | +//stored configuration, JSON encoded |
| 21 | +$config = '{ |
| 22 | + "ashost": "sap.example.com", |
| 23 | + "sysnr": "001", |
| 24 | + "client": "01", |
| 25 | + "user": "username", |
| 26 | + "passwd": "password" |
| 27 | +}'; |
| 28 | +//establish a connection using the stored configuration |
| 29 | +$connection = new SapRfcConnection(new SapRfcConfigA($config)); |
| 30 | +//prepare a function call |
| 31 | +$function = $connection->prepareFunction('remoteFunctionName'); |
| 32 | +//call the remote function |
| 33 | +$result = $function->invoke(['paramName' => 'value']); |
| 34 | +``` |
| 35 | + |
| 36 | +## PHP SAP RFC modules |
| 37 | + |
| 38 | +I am aware of the following three PHP modules. |
| 39 | + |
| 40 | +author | module Name | supported PHP versions | composer package |
| 41 | +------------- | ----------- | ---------------------- | ---------------------- |
| 42 | +Eduard Koucky | `saprfc` | PHP 4.x - 5.5.x | `phpsap/saprfc-koucky` |
| 43 | +Piers Haring | `sapnwrfc` | PHP 5.x | `phpsap/saprfc-harding` |
| 44 | +Gregor Kralik | `sapnwrfc` | PHP 7.x | `phpsap/saprfc-kralik` |
0 commit comments