PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP

Github星跟蹤圖

Package Generator

Package Generator generates a PHP SDK from any WSDL.

License
Latest Stable Version
Build Status
Scrutinizer Code Quality
Code Coverage
Total Downloads
StyleCI
SensioLabsInsight

Package Generator generates a PHP SDK from any WSDL so you can easily consume any SOAP Web Service without wondering how SOAP is used under the hood.

Package Generator provides many options to generate your package even if a few are required. This project has been tested with many WSDL and is currently used on the platform Providr.IO.

Installation

In a project:

composer require wsdltophp/packagegenerator --dev

With command line:

For PHP5
$ wget https://phar.wsdltophp.com/wsdltophp-php5.phar
$ chmod +x wsdltophp-php5.phar
$ mv wsdltophp-php5.phar /usr/local/bin/wsdltophp
For PHP7
$ wget https://phar.wsdltophp.com/wsdltophp-php7.phar
$ chmod +x wsdltophp-php7.phar
$ mv wsdltophp-php7.phar /usr/local/bin/wsdltophp

Usage

There is two ways to generate your package (apart from being in a project and generating it through the command line):

  • standalone (default behaviour): this means the package is generated as an independent project with its own composer.json file. At the end of the generation, the root directory where the package has been generated will contain the composer.json, the composer.lock file and the vendor directory.
  • not standalone: this means the package is generated as part of an existing project using its own composer.json file.

The standalone option is fully detailed in the Standalone section.

All the options are fully detailed in the Options page.

In a project:

use WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions;
use WsdlToPhp\PackageGenerator\Generator\Generator;

// Options definition: the configuration file parameter is optional
$options = GeneratorOptions::instance(/* '/path/file.yml' */);
$options
    ->setOrigin('http://developer.ebay.com/webservices/latest/ebaySvc.wsdl')
    ->setDestination('./MySdk')
    ->setComposerName('myproject/mysdk');
// Generator instantiation
$generator = new Generator($options);
// Package generation
$generator->generatePackage();

With command line:

The command line is:

$ wsdltophp generate:package \
    --urlorpath="http://developer.ebay.com/webservices/latest/ebaySvc.wsdl" \
    --destination="./MySdk" \
    --composer-name="myproject/mysdk" \
    --force

In order to see all the used options, just remove the --force argument.

Versions

3.0

First released on 04 May 2018, maintained until version 5.0 is released. Please read the UPGRADE-3.0 note in order to acknowledge the main changes.

2.0

First released on 29 Apr 2016, maintained until version 4.0 is released.

1.0

Not maintained anymore

Testing

# launch all tests
$ phpunit

# launch a testsuite: command, configuration, utils, wsdlhandler, model, container, parser, file, packagegenerator
$ phpunit --testsuite=model

Testing using Docker

Thanks to the Docker image of phpfarm, tests can be run locally under any PHP version using the cli:

  • php-5.4
  • php-5.5
  • php-5.6
  • php-7.0
  • php-7.1
  • php-7.2
  • php-7.3

First of all, you need to create your container which you can do using docker-compose by running the below command line from the root directory of the project:

$ docker-compose up -d --build

You then have a container named package_generator in which you can run composer commands and php cli commands such as:

# install deps in container (using update ensure it does use the composer.lock file if there is any)
$ docker exec -it package_generator php-7.2 /usr/bin/composer update
# run tests in container
$ docker exec -it package_generator php-7.2 -dmemory_limit=-1 vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details. In addition, code documentation is at doc.wsdltophp.com.

Credits

Developers who helped on this project are listed in the composer.json file as Contributor and are:

FAQ

If you have any question, please read the Options page about the available options to generate the package.

There is also a FAQ that contains miscellaneous questions about the package generation and its usage.

Then if you still have a question, feel free to create an issue.

License

The MIT License (MIT). Please see License File for more information.

主要指標

概覽
名稱與所有者WsdlToPhp/PackageGenerator
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-05-15 07:37:11
推送於2024-06-21 04:10:42
最后一次提交2024-06-21 06:10:25
發布數120
最新版本名稱4.1.13 (發布於 2024-06-21 06:10:26)
第一版名稱0.0.1 (發布於 2015-05-27 15:02:46)
用户参与
星數424
關注者數19
派生數73
提交數2.1k
已啟用問題?
問題數256
打開的問題數19
拉請求數45
打開的拉請求數1
關閉的拉請求數6
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?