elielelie/laravel-sap
Composer 安装命令:
composer require elielelie/laravel-sap
包简介
SAP features integrated with Laravel.
README 文档
README
SAP features integrated with Laravel.
Installation
Make sure you have the php7-sapnwrfc extension installed.
composer require elielelie/laravel-sap
To establish the connection with SAP, you need to add the following variables to your .env file:
SAP_HOST Host
SAP_SYSTEM System number
SAP_LANGUAGE Language default
SAP_CLIENT Client instance
SAP_USERNAME Username
SAP_PASSWORD Password
You can publish the configuration file and add new connections by running:
$ php artisan vendor:publish --provider="Elielelie\Sap\SapServiceProvider"
Usage
Connecting to SAP
<?php use Elielelie\Sap\Sap; $sap = app(Sap::class); $connection = $sap->open(); or // Connection name defined in the configuration file config/sap.php $connection = $sap->open('name');
Perform Function Module call
<?php // ... connection $function = $connection->fm('BAPI_USER_GET_DETAIL'); // Get function description. print_r($function->description()); // Add import parameter. $function->param('USERNAME', 'USER'); // Perform function call and retrieve result. $results = $function->execute(); $connection->close();
Getting details about a user using RFC_READ_TABLE
<?php // ... connection $function = $connection->fm('RFC_READ_TABLE'); $function->param('QUERY_TABLE', 'USR01') ->param('OPTIONS', [ ['TEXT' => 'BNAME = 'USER' OR BNAME = 'USER2' OR BNAME LIKE 'USER5*'] ]) ->param('ROWCOUNT', 5) ->param('DELIMITER', '~') ; $result = $function->execute(); $connection->close();
Query Builder usage
<?php // ... connection $fm = $connection->fmc(Table::class); $results = $fm->table('USR01') ->fields(['BNAME', 'STCOD', 'MANDT' ...]) ->where('bname', ['USER', 'USER5']) ->orWhere('bname', 'LIKE', 'USER5*') ->limit(5) ->get() ;
Testing
This package includes a comprehensive test suite using Pest PHP.
Running Tests
# Run all tests php vendor/bin/pest # Run with detailed output php vendor/bin/pest --testdox # Run with coverage php vendor/bin/pest --coverage
Test Coverage
- ✅ Unit Tests: Guid, Arr, QueryBuilder, Server (100% coverage)
- ⏭️ Feature Tests: Connection, Sap, FunctionModule, Table (require SAP connection or mocking)
For more information about testing, see TESTING.md.
License
This software is licensed under the MIT license. See LICENSE for details.
Legal Notice
SAP and other SAP products and services mentioned herein are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries.
elielelie/laravel-sap 适用场景与选型建议
elielelie/laravel-sap 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.06k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 04 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「driver」 「laravel」 「sap」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elielelie/laravel-sap 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elielelie/laravel-sap 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elielelie/laravel-sap 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Galera cluster driver for Doctrine
A PHP client driver for the RethinkDB query language (ReQL)
Arikam CMS Driver package
Use a REST API as if it was your local database
Alfabank REST API integration
A PHP client driver for the RethinkDB query language (ReQL)
统计信息
- 总下载量: 1.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-16