Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #2

Merged
merged 27 commits into from
Feb 3, 2020
Merged

V2 #2

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8f738ab
composer switch to dev versions for major update
gregor-j Oct 30, 2019
93d89e9
adapt SapRfcFunction class to new API methods
gregor-j Oct 30, 2019
5e6de72
use dist trusty for php 5.5
gregor-j Oct 31, 2019
33abc23
composer update and require php-sap/datetime
gregor-j Nov 4, 2019
9c8a092
rewrite tests for new integration tests
gregor-j Nov 4, 2019
c34715f
clean-up classpaths
gregor-j Nov 4, 2019
6daa4f5
update php-sap/common to fix failing test
gregor-j Nov 4, 2019
ef7cf5f
exclude all JSON files in config dir except the template
gregor-j Nov 4, 2019
e5b62c3
update readme to coming version
gregor-j Nov 4, 2019
e3ae300
update php-sap/integration-tests
gregor-j Nov 7, 2019
f6bf276
update php-sap/common and integration-tests
gregor-j Nov 7, 2019
cc581ce
tests: change ABAP type 's' number to 4095
gregor-j Nov 7, 2019
2abc8f6
remove AbstractRemoteFunctionCall
gregor-j Nov 7, 2019
4f42859
update to v2 connection interface
gregor-j Nov 28, 2019
43fabb7
fix typo in word resource
gregor-j Dec 9, 2019
d2a95ca
update to interface v2 and commons v3
gregor-j Dec 17, 2019
998419a
update to latest integration test
gregor-j Dec 17, 2019
219d562
add code and previous exception
gregor-j Jan 27, 2020
916b721
add rfc trace file to git ignore list
gregor-j Jan 27, 2020
4db4ffd
update composer
gregor-j Jan 28, 2020
d3b22d6
psr-12 fix
gregor-j Jan 28, 2020
7efff6e
move traits to separate subdirectory
gregor-j Jan 29, 2020
aab7aad
use phpunit tearDown() to remove saprfc trace file
gregor-j Jan 29, 2020
2dd441f
update integration tests in composer
gregor-j Jan 30, 2020
c79168c
update raw API returns as seen by the module
gregor-j Jan 31, 2020
c81fdc5
update integration tests
gregor-j Jan 31, 2020
89a711c
switch to interfaces v2 and commons v3
gregor-j Feb 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor/
dev_rfc.trc
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: php
sudo: false
os: linux
dist: trusty
php:
- 5.5
env:
Expand Down
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,42 @@ This repository implements the [PHP/SAP][phpsap] interface for [Eduard Kouckys l
## Usage

```sh
composer require php-sap/saprfc-koucky:^1.0
composer require php-sap/saprfc-koucky
```

```php
<?php
use phpsap\saprfc\SapRfcConfigA;
use phpsap\saprfc\SapRfcConnection;

$result = (new SapRfcConnection(new SapRfcConfigA([
'ashost' => 'sap.example.com',
'sysnr' => '001',
'client' => '002',
'user' => 'username',
'passwd' => 'password'
])))
->prepareFunction('MY_COOL_SAP_REMOTE_FUNCTION')
->invoke(['INPUT_PARAM' => 'value']);
//Include the composer autoloader ...
require_once 'vendor/autoload.php';
//... and add the namespaces of the classes used.
use phpsap\classes\Config\ConfigTypeA;
use phpsap\DateTime\SapDateTime;
use phpsap\saprfc\SapRfc;
/**
* Create an instance of the SAP remote function using its
* name, input parameters, and connection configuration.
*
* The imaginary SAP remote function requires a
* date as input and will return a date as output.
*
* In this case the configuration array is defined manually.
*/
$result = (new SapRfc(
'MY_COOL_SAP_REMOTE_FUNCTION',
[
'IV_DATE' => (new DateTime('2019-12-31'))
->format(SapDateTime::SAP_DATE)
],
new ConfigTypeA([
ConfigTypeA::JSON_ASHOST => 'sap.example.com',
ConfigTypeA::JSON_SYSNR => '999',
ConfigTypeA::JSON_CLIENT => '001',
ConfigTypeA::JSON_USER => 'username',
ConfigTypeA::JSON_PASSWD => 'password'
])
))->invoke();
//The output array contains a DateTime object.
echo $result['OV_DATE']->format('Y-m-d') . PHP_EOL;
```

For further documentation, please read the documentation on [PHP/SAP][phpsap]!
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
"koucky"
],
"provide": {
"php-sap/interfaces": "~1.0.0"
"php-sap/interfaces": "^2.0"
},
"conflict": {
"php-sap/saprfc-harding": "*",
"php-sap/saprfc-kralik": "*"
},
"minimum-stability": "stable",
"require": {
"php": "~5.5.0",
"php": "^5.5",
"ext-saprfc": "*",
"php-sap/interfaces": "^1.0",
"php-sap/common": "^2.0"
"php-sap/interfaces": "^2.0",
"php-sap/common": "^3.0"
},
"require-dev": {
"ext-json": "*",
"phpunit/phpunit": "^4.8",
"php-sap/integration-tests": "^1.0"
"php-sap/integration-tests": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading