|
1 |
| -**ATTENTION: THIS IS WORK IN PROGRESS AND NOT TO BE USED UNTIL THIS MESSAGE DISAPPEARS!** |
| 1 | +**ATTENTION: THIS IS WORK IN PROGRESS AND NOT TO BE USED UNTIL THIS MESSAGE |
| 2 | + DISAPPEARS!** |
2 | 3 |
|
3 | 4 | ## What is this?
|
4 | 5 |
|
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. |
| 6 | +PHP/SAP defines a layer of abstraction between actual SAP remote function calls |
| 7 | + and your PHP-Code. As to why this project was created, you can read the |
| 8 | + [motivation](motivation). |
9 | 9 |
|
10 |
| -## The motivation |
| 10 | +[](res/php-sap.svg) |
11 | 11 |
|
12 |
| -In case you have legacy code written for PHP <= 5.x using a PHP module to call SAP remote functions, and you need to update this code to a PHP version >= 7.x, this project is for you. |
| 12 | +The [interfaces][interfaces] define a common denominator on how to configure a |
| 13 | + connection to SAP, prepare a SAP remote function call, and invoke a SAP remote |
| 14 | + function call. |
13 | 15 |
|
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. |
| 16 | +The [common classes and exceptions][common] add logic that is not specific to |
| 17 | + the underlying PHP module. |
15 | 18 |
|
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. |
| 19 | +The module specific implementations contain code that is specific to [the |
| 20 | + underlying PHP-module](php-modules). |
17 | 21 |
|
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` |
| 22 | +[interfaces]: https://github.com/php-sap/interfaces "Interfaces for implementing the PHP/SAP API." |
| 23 | +[common]: https://github.com/php-sap/common "Exceptions and abstract classes containing logic for PHP/SAP that is not specific to the underlying PHP module." |
0 commit comments