2
0
forked from Wavyzz/dolibarr

Compatibility of nusoap with PHP8

This commit is contained in:
Laurent Destailleur
2020-12-12 15:37:15 +01:00
parent 4013eaa239
commit 5f476e7e7e
18 changed files with 625 additions and 435 deletions

495
composer.lock generated
View File

@@ -6,53 +6,6 @@
], ],
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2", "content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
"packages": [ "packages": [
{
"name": "Psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{ {
"name": "ckeditor/ckeditor", "name": "ckeditor/ckeditor",
"version": "4.12.1", "version": "4.12.1",
@@ -92,6 +45,12 @@
"text", "text",
"wysiwyg" "wysiwyg"
], ],
"support": {
"forum": "http://ckeditor.com/forums",
"issues": "http://dev.ckeditor.com",
"source": "http://github.com/ckeditor/ckeditor-dev",
"wiki": "http://docs.ckeditor.com"
},
"time": "2019-06-28T10:41:23+00:00" "time": "2019-06-28T10:41:23+00:00"
}, },
{ {
@@ -153,6 +112,10 @@
"debug", "debug",
"debugbar" "debugbar"
], ],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.15.1"
},
"time": "2019-09-24T14:55:42+00:00" "time": "2019-09-24T14:55:42+00:00"
}, },
{ {
@@ -208,6 +171,10 @@
"print", "print",
"receipt" "receipt"
], ],
"support": {
"issues": "https://github.com/mike42/escpos-php/issues",
"source": "https://github.com/mike42/escpos-php/tree/v2.2"
},
"time": "2019-10-05T05:59:00+00:00" "time": "2019-10-05T05:59:00+00:00"
}, },
{ {
@@ -260,6 +227,10 @@
"mobile detector", "mobile detector",
"php mobile detect" "php mobile detect"
], ],
"support": {
"issues": "https://github.com/serbanghita/Mobile-Detect/issues",
"source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.34"
},
"time": "2019-09-18T18:44:20+00:00" "time": "2019-09-18T18:44:20+00:00"
}, },
{ {
@@ -362,9 +333,63 @@
"xls", "xls",
"xlsx" "xlsx"
], ],
"support": {
"issues": "https://github.com/PHPOffice/PHPExcel/issues",
"source": "https://github.com/PHPOffice/PHPExcel/tree/master"
},
"abandoned": "phpoffice/phpspreadsheet", "abandoned": "phpoffice/phpspreadsheet",
"time": "2015-05-01T07:00:55+00:00" "time": "2015-05-01T07:00:55+00:00"
}, },
{
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.3"
},
"time": "2020-03-23T09:12:05+00:00"
},
{ {
"name": "restler/framework", "name": "restler/framework",
"version": "3.0.0-RC6", "version": "3.0.0-RC6",
@@ -424,6 +449,9 @@
"rest", "rest",
"server" "server"
], ],
"support": {
"source": "https://github.com/Luracast/Restler-Framework/tree/3.0.0-RC6"
},
"time": "2020-02-13T16:05:12+00:00" "time": "2020-02-13T16:05:12+00:00"
}, },
{ {
@@ -480,24 +508,28 @@
"payment processing", "payment processing",
"stripe" "stripe"
], ],
"support": {
"issues": "https://github.com/stripe/stripe-php/issues",
"source": "https://github.com/stripe/stripe-php/tree/master"
},
"time": "2019-08-29T16:56:12+00:00" "time": "2019-08-29T16:56:12+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.18.1", "version": "v1.20.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" "reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=7.1"
}, },
"suggest": { "suggest": {
"ext-mbstring": "For best performance" "ext-mbstring": "For best performance"
@@ -505,7 +537,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.18-dev" "dev-main": "1.20-dev"
}, },
"thanks": { "thanks": {
"name": "symfony/polyfill", "name": "symfony/polyfill",
@@ -543,6 +575,9 @@
"portable", "portable",
"shim" "shim"
], ],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"funding": [ "funding": [
{ {
"url": "https://symfony.com/sponsor", "url": "https://symfony.com/sponsor",
@@ -557,7 +592,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-07-14T12:35:20+00:00" "time": "2020-10-23T14:02:19+00:00"
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
@@ -620,6 +655,9 @@
"debug", "debug",
"dump" "dump"
], ],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/master"
},
"time": "2015-11-18T13:48:51+00:00" "time": "2015-11-18T13:48:51+00:00"
}, },
{ {
@@ -682,40 +720,40 @@
"pdf417", "pdf417",
"qrcode" "qrcode"
], ],
"support": {
"source": "https://github.com/tecnickcom/TCPDF/tree/6.3.2"
},
"time": "2019-09-20T09:35:01+00:00" "time": "2019-09-20T09:35:01+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
"version": "1.0.5", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/instantiator.git", "url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3,<8.0-DEV" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"athletic/athletic": "~0.1.8", "doctrine/coding-standard": "^8.0",
"ext-pdo": "*", "ext-pdo": "*",
"ext-phar": "*", "ext-phar": "*",
"phpunit/phpunit": "~4.0", "phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
"squizlabs/php_codesniffer": "~2.0" "phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
@@ -729,38 +767,59 @@
{ {
"name": "Marco Pivetta", "name": "Marco Pivetta",
"email": "ocramius@gmail.com", "email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/" "homepage": "https://ocramius.github.io/"
} }
], ],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator", "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [ "keywords": [
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"time": "2015-06-14T21:17:01+00:00" "support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/1.4.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-11-10T18:47:58+00:00"
}, },
{ {
"name": "php-parallel-lint/php-console-color", "name": "php-parallel-lint/php-console-color",
"version": "v0.2", "version": "v0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-parallel-lint/PHP-Console-Color.git", "url": "https://github.com/php-parallel-lint/PHP-Console-Color.git",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191" "reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", "url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/b6af326b2088f1ad3b264696c9fd590ec395b49e",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191", "reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0"
}, },
"replace": {
"jakub-onderka/php-console-color": "*"
},
"require-dev": { "require-dev": {
"jakub-onderka/php-code-style": "1.0", "php-parallel-lint/php-code-style": "1.0",
"jakub-onderka/php-parallel-lint": "1.0", "php-parallel-lint/php-parallel-lint": "1.0",
"jakub-onderka/php-var-dump-check": "0.*", "php-parallel-lint/php-var-dump-check": "0.*",
"phpunit/phpunit": "~4.3", "phpunit/phpunit": "~4.3",
"squizlabs/php_codesniffer": "1.*" "squizlabs/php_codesniffer": "1.*"
}, },
@@ -780,7 +839,11 @@
"email": "jakub.onderka@gmail.com" "email": "jakub.onderka@gmail.com"
} }
], ],
"time": "2018-09-29T17:23:10+00:00" "support": {
"issues": "https://github.com/php-parallel-lint/PHP-Console-Color/issues",
"source": "https://github.com/php-parallel-lint/PHP-Console-Color/tree/master"
},
"time": "2020-05-14T05:47:14+00:00"
}, },
{ {
"name": "php-parallel-lint/php-console-highlighter", "name": "php-parallel-lint/php-console-highlighter",
@@ -829,6 +892,10 @@
} }
], ],
"description": "Highlight PHP code in terminal", "description": "Highlight PHP code in terminal",
"support": {
"issues": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/issues",
"source": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/tree/master"
},
"time": "2020-05-13T07:37:49+00:00" "time": "2020-05-13T07:37:49+00:00"
}, },
{ {
@@ -876,39 +943,37 @@
], ],
"description": "This tool check syntax of PHP files about 20x faster than serial check.", "description": "This tool check syntax of PHP files about 20x faster than serial check.",
"homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint",
"support": {
"source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v0.9.2"
},
"time": "2015-12-15T10:42:16+00:00" "time": "2015-12-15T10:42:16+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "1.0.1", "version": "2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.5" "php": "^7.2 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-2.x": "2.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor\\Reflection\\": "src/"
"src"
]
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@@ -930,44 +995,45 @@
"reflection", "reflection",
"static analysis" "static analysis"
], ],
"time": "2017-09-11T18:02:19+00:00" "support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
},
"time": "2020-06-27T09:03:43+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "4.3.2", "version": "5.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.0", "ext-filter": "*",
"phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", "php": "^7.2 || ^8.0",
"phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "phpdocumentor/reflection-common": "^2.2",
"webmozart/assert": "^1.0" "phpdocumentor/type-resolver": "^1.3",
"webmozart/assert": "^1.9.1"
}, },
"require-dev": { "require-dev": {
"doctrine/instantiator": "^1.0.5", "mockery/mockery": "~1.3.2"
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.x-dev" "dev-master": "5.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor\\Reflection\\": "src"
"src/"
]
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@@ -978,37 +1044,44 @@
{ {
"name": "Mike van Riel", "name": "Mike van Riel",
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
},
{
"name": "Jaap van Otterdijk",
"email": "account@ijaap.nl"
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2019-09-12T14:27:41+00:00" "support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
},
"time": "2020-09-03T19:13:55+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "0.5.1", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae" "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae", "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.0", "php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^1.0" "phpdocumentor/reflection-common": "^2.0"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^1.0", "ext-tokenizer": "*"
"phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-1.x": "1.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -1026,37 +1099,42 @@
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
} }
], ],
"time": "2017-12-30T13:23:38+00:00" "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
},
"time": "2020-09-17T18:55:26+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
"version": "1.9.0", "version": "v1.10.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" "reference": "451c3cd1418cf640de218914901e51b064abb093"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "reference": "451c3cd1418cf640de218914901e51b064abb093",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0" "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
}, },
"require-dev": { "require-dev": {
"phpspec/phpspec": "^2.5|^3.2", "phpspec/phpspec": "^2.5 || ^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.8.x-dev" "dev-master": "1.10.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -1089,7 +1167,11 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2019-10-03T11:07:50+00:00" "support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
},
"time": "2020-03-05T15:02:03+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@@ -1151,6 +1233,11 @@
"testing", "testing",
"xunit" "xunit"
], ],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2"
},
"time": "2015-10-06T15:47:00+00:00" "time": "2015-10-06T15:47:00+00:00"
}, },
{ {
@@ -1198,6 +1285,11 @@
"filesystem", "filesystem",
"iterator" "iterator"
], ],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5"
},
"time": "2017-11-27T13:52:08+00:00" "time": "2017-11-27T13:52:08+00:00"
}, },
{ {
@@ -1239,6 +1331,10 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
"source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
},
"time": "2015-06-21T13:50:34+00:00" "time": "2015-06-21T13:50:34+00:00"
}, },
{ {
@@ -1288,6 +1384,10 @@
"keywords": [ "keywords": [
"timer" "timer"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
"source": "https://github.com/sebastianbergmann/php-timer/tree/master"
},
"time": "2017-02-26T11:10:40+00:00" "time": "2017-02-26T11:10:40+00:00"
}, },
{ {
@@ -1337,6 +1437,10 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4"
},
"abandoned": true, "abandoned": true,
"time": "2017-12-04T08:55:13+00:00" "time": "2017-12-04T08:55:13+00:00"
}, },
@@ -1410,6 +1514,10 @@
"testing", "testing",
"xunit" "xunit"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36"
},
"time": "2017-06-21T08:07:12+00:00" "time": "2017-06-21T08:07:12+00:00"
}, },
{ {
@@ -1466,6 +1574,11 @@
"mock", "mock",
"xunit" "xunit"
], ],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
"source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3"
},
"abandoned": true, "abandoned": true,
"time": "2015-10-02T06:51:40+00:00" "time": "2015-10-02T06:51:40+00:00"
}, },
@@ -1531,6 +1644,11 @@
"testing", "testing",
"xunit" "xunit"
], ],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/phpunit-selenium/issues",
"source": "https://github.com/giorgiosironi/phpunit-selenium/tree/2.x"
},
"time": "2017-01-23T22:15:32+00:00" "time": "2017-01-23T22:15:32+00:00"
}, },
{ {
@@ -1595,6 +1713,10 @@
"compare", "compare",
"equality" "equality"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"source": "https://github.com/sebastianbergmann/comparator/tree/1.2"
},
"time": "2017-01-29T09:50:25+00:00" "time": "2017-01-29T09:50:25+00:00"
}, },
{ {
@@ -1647,6 +1769,10 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/1.4"
},
"time": "2017-05-22T07:24:03+00:00" "time": "2017-05-22T07:24:03+00:00"
}, },
{ {
@@ -1697,6 +1823,10 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"source": "https://github.com/sebastianbergmann/environment/tree/1.3"
},
"time": "2016-08-18T05:49:44+00:00" "time": "2016-08-18T05:49:44+00:00"
}, },
{ {
@@ -1764,6 +1894,10 @@
"export", "export",
"exporter" "exporter"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/master"
},
"time": "2016-06-17T09:04:28+00:00" "time": "2016-06-17T09:04:28+00:00"
}, },
{ {
@@ -1815,6 +1949,10 @@
"keywords": [ "keywords": [
"global state" "global state"
], ],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1"
},
"time": "2015-10-12T03:26:01+00:00" "time": "2015-10-12T03:26:01+00:00"
}, },
{ {
@@ -1868,6 +2006,10 @@
], ],
"description": "Provides functionality to recursively process PHP variables", "description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context", "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"source": "https://github.com/sebastianbergmann/recursion-context/tree/master"
},
"time": "2016-10-03T07:41:43+00:00" "time": "2016-10-03T07:41:43+00:00"
}, },
{ {
@@ -1903,6 +2045,10 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
"source": "https://github.com/sebastianbergmann/version/tree/1.0.6"
},
"time": "2015-06-21T13:59:46+00:00" "time": "2015-06-21T13:59:46+00:00"
}, },
{ {
@@ -1981,24 +2127,29 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2018-11-07T22:31:41+00:00" "time": "2018-11-07T22:31:41+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.12.0", "version": "v1.20.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4" "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4", "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=7.1"
}, },
"suggest": { "suggest": {
"ext-ctype": "For best performance" "ext-ctype": "For best performance"
@@ -2006,7 +2157,11 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.12-dev" "dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -2039,20 +2194,37 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2019-08-06T08:03:45+00:00" "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v3.4.32", "version": "v3.4.47",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "768f817446da74a776a31eea335540f9dcb53942" "reference": "88289caa3c166321883f67fe5130188ebbb47094"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/768f817446da74a776a31eea335540f9dcb53942", "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094",
"reference": "768f817446da74a776a31eea335540f9dcb53942", "reference": "88289caa3c166321883f67fe5130188ebbb47094",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2069,11 +2241,6 @@
"symfony/console": "For validating YAML files using the lint command" "symfony/console": "For validating YAML files using the lint command"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Symfony\\Component\\Yaml\\": "" "Symfony\\Component\\Yaml\\": ""
@@ -2098,35 +2265,51 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-09-10T10:38:46+00:00" "support": {
"source": "https://github.com/symfony/yaml/tree/v3.4.47"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T10:57:07+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.5.0", "version": "1.9.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozart/assert.git",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0", "php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8" "symfony/polyfill-ctype": "^1.8"
}, },
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13" "phpunit/phpunit": "^4.8.36 || ^7.5.13"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Webmozart\\Assert\\": "src/" "Webmozart\\Assert\\": "src/"
@@ -2148,7 +2331,11 @@
"check", "check",
"validate" "validate"
], ],
"time": "2019-08-24T08:43:50+00:00" "support": {
"issues": "https://github.com/webmozart/assert/issues",
"source": "https://github.com/webmozart/assert/tree/master"
},
"time": "2020-07-08T17:02:28+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -48,6 +48,7 @@ By
* In file nusoap.php, to avoid a warning, * In file nusoap.php, to avoid a warning,
Replace call to serialize_val with no bugged value Replace call to serialize_val with no bugged value
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct

View File

@@ -219,7 +219,7 @@ class nusoap_base {
* *
* @access public * @access public
*/ */
function nusoap_base() { function __construct() {
$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
} }

View File

@@ -44,8 +44,8 @@ class nusoap_fault extends nusoap_base {
* @param string $faultstring human readable error message * @param string $faultstring human readable error message
* @param mixed $faultdetail detail, typically a string or array of string * @param mixed $faultdetail detail, typically a string or array of string
*/ */
function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
parent::nusoap_base(); parent::__construct();
$this->faultcode = $faultcode; $this->faultcode = $faultcode;
$this->faultactor = $faultactor; $this->faultactor = $faultactor;
$this->faultstring = $faultstring; $this->faultstring = $faultstring;

View File

@@ -56,8 +56,8 @@ class nusoap_parser extends nusoap_base {
* @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1
* @access public * @access public
*/ */
function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){
parent::nusoap_base(); parent::__construct();
$this->xml = $xml; $this->xml = $xml;
$this->xml_encoding = $encoding; $this->xml_encoding = $encoding;
$this->method = $method; $this->method = $method;
@@ -316,7 +316,7 @@ class nusoap_parser extends nusoap_base {
// get unqualified name // get unqualified name
$name = substr(strstr($name,':'),1); $name = substr(strstr($name,':'),1);
} }
// build to native type // build to native type
if(isset($this->body_position) && $pos > $this->body_position){ if(isset($this->body_position) && $pos > $this->body_position){
// deal w/ multirefs // deal w/ multirefs
@@ -378,7 +378,7 @@ class nusoap_parser extends nusoap_base {
*/ */
} }
} }
// for doclit // for doclit
if($this->status == 'header'){ if($this->status == 'header'){
if ($this->root_header != $pos) { if ($this->root_header != $pos) {

View File

@@ -169,8 +169,8 @@ class nusoap_server extends nusoap_base {
* @param mixed $wsdl file path or URL (string), or wsdl instance (object) * @param mixed $wsdl file path or URL (string), or wsdl instance (object)
* @access public * @access public
*/ */
function nusoap_server($wsdl=false){ function __construct($wsdl=false){
parent::nusoap_base(); parent::__construct();
// turn on debugging? // turn on debugging?
global $debug; global $debug;
global $HTTP_SERVER_VARS; global $HTTP_SERVER_VARS;
@@ -776,7 +776,7 @@ class nusoap_server extends nusoap_base {
//begin code to compress payload - by John //begin code to compress payload - by John
// NOTE: there is no way to know whether the Web server will also compress // NOTE: there is no way to know whether the Web server will also compress
// this data. // this data.
if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) {
if (strstr($this->headers['accept-encoding'], 'gzip')) { if (strstr($this->headers['accept-encoding'], 'gzip')) {
if (function_exists('gzencode')) { if (function_exists('gzencode')) {
if (isset($this->debug_flag) && $this->debug_flag) { if (isset($this->debug_flag) && $this->debug_flag) {
@@ -903,7 +903,7 @@ class nusoap_server extends nusoap_base {
function getHTTPBody($soapmsg) { function getHTTPBody($soapmsg) {
return $soapmsg; return $soapmsg;
} }
/** /**
* gets the HTTP content type for the current response. * gets the HTTP content type for the current response.
* *
@@ -915,7 +915,7 @@ class nusoap_server extends nusoap_base {
function getHTTPContentType() { function getHTTPContentType() {
return 'text/xml'; return 'text/xml';
} }
/** /**
* gets the HTTP content type charset for the current response. * gets the HTTP content type charset for the current response.
* returns false for non-text content types. * returns false for non-text content types.
@@ -1074,7 +1074,7 @@ class nusoap_server extends nusoap_base {
if(false == $namespace) { if(false == $namespace) {
$namespace = "http://$SERVER_NAME/soap/$serviceName"; $namespace = "http://$SERVER_NAME/soap/$serviceName";
} }
if(false == $endpoint) { if(false == $endpoint) {
if ($HTTPS == '1' || $HTTPS == 'on') { if ($HTTPS == '1' || $HTTPS == 'on') {
$SCHEME = 'https'; $SCHEME = 'https';
@@ -1083,11 +1083,11 @@ class nusoap_server extends nusoap_base {
} }
$endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME"; $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME";
} }
if(false == $schemaTargetNamespace) { if(false == $schemaTargetNamespace) {
$schemaTargetNamespace = $namespace; $schemaTargetNamespace = $namespace;
} }
$this->wsdl = new wsdl; $this->wsdl = new wsdl;
$this->wsdl->serviceName = $serviceName; $this->wsdl->serviceName = $serviceName;
$this->wsdl->endpoint = $endpoint; $this->wsdl->endpoint = $endpoint;

View File

@@ -56,8 +56,8 @@ class soap_transport_http extends nusoap_base {
* @param boolean $use_curl Whether to try to force cURL use * @param boolean $use_curl Whether to try to force cURL use
* @access public * @access public
*/ */
function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ function __construct($url, $curl_options = NULL, $use_curl = false){
parent::nusoap_base(); parent::__construct();
$this->debug("ctor url=$url use_curl=$use_curl curl_options:"); $this->debug("ctor url=$url use_curl=$use_curl curl_options:");
$this->appendDebug($this->varDump($curl_options)); $this->appendDebug($this->varDump($curl_options));
$this->setURL($url); $this->setURL($url);
@@ -121,12 +121,12 @@ class soap_transport_http extends nusoap_base {
$this->debug("parsed URL $k = $v"); $this->debug("parsed URL $k = $v");
$this->$k = $v; $this->$k = $v;
} }
// add any GET params to path // add any GET params to path
if(isset($u['query']) && $u['query'] != ''){ if(isset($u['query']) && $u['query'] != ''){
$this->path .= '?' . $u['query']; $this->path .= '?' . $u['query'];
} }
// set default port // set default port
if(!isset($u['port'])){ if(!isset($u['port'])){
if($u['scheme'] == 'https'){ if($u['scheme'] == 'https'){
@@ -135,10 +135,10 @@ class soap_transport_http extends nusoap_base {
$this->port = 80; $this->port = 80;
} }
} }
$this->uri = $this->path; $this->uri = $this->path;
$this->digest_uri = $this->uri; $this->digest_uri = $this->uri;
// build headers // build headers
if (!isset($u['port'])) { if (!isset($u['port'])) {
$this->setHeader('Host', $this->host); $this->setHeader('Host', $this->host);
@@ -218,7 +218,7 @@ class soap_transport_http extends nusoap_base {
} else { } else {
$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
} }
// test pointer // test pointer
if(!$this->fp) { if(!$this->fp) {
$msg = 'Couldn\'t open socket connection to server ' . $this->url; $msg = 'Couldn\'t open socket connection to server ' . $this->url;
@@ -231,7 +231,7 @@ class soap_transport_http extends nusoap_base {
$this->setError($msg); $this->setError($msg);
return false; return false;
} }
// set response timeout // set response timeout
$this->debug('set response timeout to ' . $response_timeout); $this->debug('set response timeout to ' . $response_timeout);
socket_set_timeout( $this->fp, $response_timeout); socket_set_timeout( $this->fp, $response_timeout);
@@ -320,10 +320,10 @@ class soap_transport_http extends nusoap_base {
// recent versions of cURL turn on peer/host checking by default, // recent versions of cURL turn on peer/host checking by default,
// while PHP binaries are not compiled with a default location for the // while PHP binaries are not compiled with a default location for the
// CA cert bundle, so disable peer/host checking. // CA cert bundle, so disable peer/host checking.
//$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');
$this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0); $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0);
$this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0); $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0);
// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
if ($this->authtype == 'certificate') { if ($this->authtype == 'certificate') {
$this->debug('set cURL certificate options'); $this->debug('set cURL certificate options');
@@ -410,7 +410,7 @@ class soap_transport_http extends nusoap_base {
* @access public * @access public
*/ */
function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) {
$this->debug('entered send() with data of length: '.strlen($data)); $this->debug('entered send() with data of length: '.strlen($data));
$this->tryagain = true; $this->tryagain = true;
@@ -422,18 +422,18 @@ class soap_transport_http extends nusoap_base {
if (!$this->connect($timeout, $response_timeout)){ if (!$this->connect($timeout, $response_timeout)){
return false; return false;
} }
// send request // send request
if (!$this->sendRequest($data, $cookies)){ if (!$this->sendRequest($data, $cookies)){
return false; return false;
} }
// get response // get response
$respdata = $this->getResponse(); $respdata = $this->getResponse();
} else { } else {
$this->setError("Too many tries to get an OK response ($this->response_status_line)"); $this->setError("Too many tries to get an OK response ($this->response_status_line)");
} }
} }
$this->debug('end of send()'); $this->debug('end of send()');
return $respdata; return $respdata;
} }
@@ -453,7 +453,7 @@ class soap_transport_http extends nusoap_base {
function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
return $this->send($data, $timeout, $response_timeout, $cookies); return $this->send($data, $timeout, $response_timeout, $cookies);
} }
/** /**
* if authenticating, set user credentials here * if authenticating, set user credentials here
* *
@@ -475,21 +475,21 @@ class soap_transport_http extends nusoap_base {
} elseif ($authtype == 'digest') { } elseif ($authtype == 'digest') {
if (isset($digestRequest['nonce'])) { if (isset($digestRequest['nonce'])) {
$digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
// A1 = unq(username-value) ":" unq(realm-value) ":" passwd // A1 = unq(username-value) ":" unq(realm-value) ":" passwd
$A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
// H(A1) = MD5(A1) // H(A1) = MD5(A1)
$HA1 = md5($A1); $HA1 = md5($A1);
// A2 = Method ":" digest-uri-value // A2 = Method ":" digest-uri-value
$A2 = $this->request_method . ':' . $this->digest_uri; $A2 = $this->request_method . ':' . $this->digest_uri;
// H(A2) // H(A2)
$HA2 = md5($A2); $HA2 = md5($A2);
// KD(secret, data) = H(concat(secret, ":", data)) // KD(secret, data) = H(concat(secret, ":", data))
// if qop == auth: // if qop == auth:
// request-digest = <"> < KD ( H(A1), unq(nonce-value) // request-digest = <"> < KD ( H(A1), unq(nonce-value)
@@ -500,7 +500,7 @@ class soap_transport_http extends nusoap_base {
// ) <"> // ) <">
// if qop is missing, // if qop is missing,
// request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
$unhashedDigest = ''; $unhashedDigest = '';
$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
$cnonce = $nonce; $cnonce = $nonce;
@@ -509,10 +509,10 @@ class soap_transport_http extends nusoap_base {
} else { } else {
$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
} }
$hashedDigest = md5($unhashedDigest); $hashedDigest = md5($unhashedDigest);
$opaque = ''; $opaque = '';
if (isset($digestRequest['opaque'])) { if (isset($digestRequest['opaque'])) {
$opaque = ', opaque="' . $digestRequest['opaque'] . '"'; $opaque = ', opaque="' . $digestRequest['opaque'] . '"';
} }
@@ -531,7 +531,7 @@ class soap_transport_http extends nusoap_base {
$this->authtype = $authtype; $this->authtype = $authtype;
$this->digestRequest = $digestRequest; $this->digestRequest = $digestRequest;
} }
/** /**
* set the soapaction value * set the soapaction value
* *
@@ -541,7 +541,7 @@ class soap_transport_http extends nusoap_base {
function setSOAPAction($soapaction) { function setSOAPAction($soapaction) {
$this->setHeader('SOAPAction', '"' . $soapaction . '"'); $this->setHeader('SOAPAction', '"' . $soapaction . '"');
} }
/** /**
* use http encoding * use http encoding
* *
@@ -561,7 +561,7 @@ class soap_transport_http extends nusoap_base {
$this->encoding = $enc; $this->encoding = $enc;
} }
} }
/** /**
* set proxy info here * set proxy info here
* *
@@ -590,7 +590,7 @@ class soap_transport_http extends nusoap_base {
unsetHeader('Proxy-Authorization'); unsetHeader('Proxy-Authorization');
} }
} }
/** /**
* Test if the given string starts with a header that is to be skipped. * Test if the given string starts with a header that is to be skipped.
@@ -631,7 +631,7 @@ class soap_transport_http extends nusoap_base {
// length := 0 // length := 0
$length = 0; $length = 0;
$new = ''; $new = '';
// read chunk-size, chunk-extension (if any) and CRLF // read chunk-size, chunk-extension (if any) and CRLF
// get the position of the linebreak // get the position of the linebreak
$chunkend = strpos($buffer, $lb); $chunkend = strpos($buffer, $lb);
@@ -646,7 +646,7 @@ class soap_transport_http extends nusoap_base {
while ($chunk_size > 0) { while ($chunk_size > 0) {
$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
// Just in case we got a broken connection // Just in case we got a broken connection
if ($chunkend == FALSE) { if ($chunkend == FALSE) {
$chunk = substr($buffer,$chunkstart); $chunk = substr($buffer,$chunkstart);
@@ -655,7 +655,7 @@ class soap_transport_http extends nusoap_base {
$length += strlen($chunk); $length += strlen($chunk);
break; break;
} }
// read chunk-data and CRLF // read chunk-data and CRLF
$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
// append chunk-data to entity-body // append chunk-data to entity-body
@@ -664,7 +664,7 @@ class soap_transport_http extends nusoap_base {
$length += strlen($chunk); $length += strlen($chunk);
// read chunk-size and CRLF // read chunk-size and CRLF
$chunkstart = $chunkend + strlen($lb); $chunkstart = $chunkend + strlen($lb);
$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
if ($chunkend == FALSE) { if ($chunkend == FALSE) {
break; //Just in case we got a broken connection break; //Just in case we got a broken connection
@@ -675,7 +675,7 @@ class soap_transport_http extends nusoap_base {
} }
return $new; return $new;
} }
/** /**
* Writes the payload, including HTTP headers, to $this->outgoing_payload. * Writes the payload, including HTTP headers, to $this->outgoing_payload.
* *
@@ -720,7 +720,7 @@ class soap_transport_http extends nusoap_base {
// header/body separator // header/body separator
$this->outgoing_payload .= "\r\n"; $this->outgoing_payload .= "\r\n";
// add data // add data
$this->outgoing_payload .= $data; $this->outgoing_payload .= $data;
} }
@@ -792,7 +792,7 @@ class soap_transport_http extends nusoap_base {
*/ */
function getResponse(){ function getResponse(){
$this->incoming_payload = ''; $this->incoming_payload = '';
if ($this->io_method() == 'socket') { if ($this->io_method() == 'socket') {
// loop until headers have been retrieved // loop until headers have been retrieved
$data = ''; $data = '';
@@ -863,7 +863,7 @@ class soap_transport_http extends nusoap_base {
$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
} }
} }
// loop until msg has been received // loop until msg has been received
if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
$content_length = 2147483647; // ignore any content-length header $content_length = 2147483647; // ignore any content-length header
@@ -929,22 +929,22 @@ class soap_transport_http extends nusoap_base {
$this->debug('read body of length ' . strlen($data)); $this->debug('read body of length ' . strlen($data));
$this->incoming_payload .= $data; $this->incoming_payload .= $data;
$this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
// close filepointer // close filepointer
if( if(
(isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') ||
(! $this->persistentConnection) || feof($this->fp)){ (! $this->persistentConnection) || feof($this->fp)){
fclose($this->fp); fclose($this->fp);
$this->fp = false; $this->fp = false;
$this->debug('closed socket'); $this->debug('closed socket');
} }
// connection was closed unexpectedly // connection was closed unexpectedly
if($this->incoming_payload == ''){ if($this->incoming_payload == ''){
$this->setError('no response from server'); $this->setError('no response from server');
return false; return false;
} }
// decode transfer-encoding // decode transfer-encoding
// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ // if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
// if(!$data = $this->decodeChunked($data, $lb)){ // if(!$data = $this->decodeChunked($data, $lb)){
@@ -955,7 +955,7 @@ class soap_transport_http extends nusoap_base {
// set decoded payload // set decoded payload
// $this->incoming_payload = $header_data.$lb.$lb.$data; // $this->incoming_payload = $header_data.$lb.$lb.$data;
// } // }
} else if ($this->io_method() == 'curl') { } else if ($this->io_method() == 'curl') {
// send and receive // send and receive
$this->debug('send and receive with cURL'); $this->debug('send and receive with cURL');
@@ -981,7 +981,7 @@ class soap_transport_http extends nusoap_base {
// close curl // close curl
$this->debug('No cURL error, closing cURL'); $this->debug('No cURL error, closing cURL');
curl_close($this->ch); curl_close($this->ch);
// try removing skippable headers // try removing skippable headers
$savedata = $data; $savedata = $data;
while ($this->isSkippableCurlHeader($data)) { while ($this->isSkippableCurlHeader($data)) {
@@ -1004,7 +1004,7 @@ class soap_transport_http extends nusoap_base {
} }
} }
} }
// separate content from HTTP headers // separate content from HTTP headers
if ($pos = strpos($data,"\r\n\r\n")) { if ($pos = strpos($data,"\r\n\r\n")) {
$lb = "\r\n"; $lb = "\r\n";
@@ -1064,7 +1064,7 @@ class soap_transport_http extends nusoap_base {
$this->debug('Server wants digest authentication'); $this->debug('Server wants digest authentication');
// remove "Digest " from our elements // remove "Digest " from our elements
$digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
// parse elements into array // parse elements into array
$digestElements = explode(',', $digestString); $digestElements = explode(',', $digestString);
foreach ($digestElements as $val) { foreach ($digestElements as $val) {
@@ -1083,7 +1083,7 @@ class soap_transport_http extends nusoap_base {
$this->setError('HTTP authentication failed'); $this->setError('HTTP authentication failed');
return false; return false;
} }
if ( if (
($http_status >= 300 && $http_status <= 307) || ($http_status >= 300 && $http_status <= 307) ||
($http_status >= 400 && $http_status <= 417) || ($http_status >= 400 && $http_status <= 417) ||
@@ -1151,13 +1151,13 @@ class soap_transport_http extends nusoap_base {
} else { } else {
$this->debug('No Content-Encoding header'); $this->debug('No Content-Encoding header');
} }
if(strlen($data) == 0){ if(strlen($data) == 0){
$this->debug('no data after headers!'); $this->debug('no data after headers!');
$this->setError('no data present after HTTP headers'); $this->setError('no data present after HTTP headers');
return false; return false;
} }
return $data; return $data;
} }
@@ -1229,7 +1229,7 @@ class soap_transport_http extends nusoap_base {
} else { } else {
$path = '/'; $path = '/';
} }
$cookie_param = ';secure;'; $cookie_param = ';secure;';
if (strpos($cookie_str, $cookie_param) !== FALSE) { if (strpos($cookie_str, $cookie_param) !== FALSE) {
$secure = true; $secure = true;
@@ -1248,12 +1248,12 @@ class soap_transport_http extends nusoap_base {
'path' => $path, 'path' => $path,
'expires' => $expires, 'expires' => $expires,
'secure' => $secure 'secure' => $secure
); );
return $cookie; return $cookie;
} }
return false; return false;
} }
/** /**
* sort out cookies for the current request * sort out cookies for the current request
* *

View File

@@ -68,8 +68,8 @@ class soapval extends nusoap_base {
* @param mixed $attributes associative array of attributes to add to element serialization * @param mixed $attributes associative array of attributes to add to element serialization
* @access public * @access public
*/ */
function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { function __construct($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
parent::nusoap_base(); parent::__construct();
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
$this->value = $value; $this->value = $value;

View File

@@ -94,8 +94,8 @@ class nusoap_client extends nusoap_base {
* @param string $portName optional portName in WSDL document * @param string $portName optional portName in WSDL document
* @access public * @access public
*/ */
function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){
parent::nusoap_base(); parent::__construct();
$this->endpoint = $endpoint; $this->endpoint = $endpoint;
$this->proxyhost = $proxyhost; $this->proxyhost = $proxyhost;
$this->proxyport = $proxyport; $this->proxyport = $proxyport;
@@ -163,7 +163,7 @@ class nusoap_client extends nusoap_base {
$this->faultstring = ''; $this->faultstring = '';
$this->faultcode = ''; $this->faultcode = '';
$this->opData = array(); $this->opData = array();
$this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType"); $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
$this->appendDebug('params=' . $this->varDump($params)); $this->appendDebug('params=' . $this->varDump($params));
$this->appendDebug('headers=' . $this->varDump($headers)); $this->appendDebug('headers=' . $this->varDump($headers));
@@ -234,7 +234,7 @@ class nusoap_client extends nusoap_base {
// no WSDL // no WSDL
//$this->namespaces['ns1'] = $namespace; //$this->namespaces['ns1'] = $namespace;
$nsPrefix = 'ns' . rand(1000, 9999); $nsPrefix = 'ns' . rand(1000, 9999);
// serialize // serialize
$payload = ''; $payload = '';
if (is_string($params)) { if (is_string($params)) {
$this->debug("serializing param string for operation $operation"); $this->debug("serializing param string for operation $operation");
@@ -294,7 +294,7 @@ class nusoap_client extends nusoap_base {
$this->return = $return; $this->return = $return;
$this->debug('sent message successfully and got a(n) '.gettype($return)); $this->debug('sent message successfully and got a(n) '.gettype($return));
$this->appendDebug('return=' . $this->varDump($return)); $this->appendDebug('return=' . $this->varDump($return));
// fault? // fault?
if(is_array($return) && isset($return['faultcode'])){ if(is_array($return) && isset($return['faultcode'])){
$this->debug('got fault'); $this->debug('got fault');
@@ -463,7 +463,7 @@ class nusoap_client extends nusoap_base {
$this->persistentConnection = $http; $this->persistentConnection = $http;
} }
} }
if($err = $http->getError()){ if($err = $http->getError()){
$this->setError('HTTP Error: '.$err); $this->setError('HTTP Error: '.$err);
return false; return false;
@@ -627,7 +627,7 @@ class nusoap_client extends nusoap_base {
$this->authtype = $authtype; $this->authtype = $authtype;
$this->certRequest = $certRequest; $this->certRequest = $certRequest;
} }
/** /**
* use HTTP encoding * use HTTP encoding
* *
@@ -638,7 +638,7 @@ class nusoap_client extends nusoap_base {
$this->debug("setHTTPEncoding(\"$enc\")"); $this->debug("setHTTPEncoding(\"$enc\")");
$this->http_encoding = $enc; $this->http_encoding = $enc;
} }
/** /**
* Set whether to try to use cURL connections if possible * Set whether to try to use cURL connections if possible
* *
@@ -659,7 +659,7 @@ class nusoap_client extends nusoap_base {
$this->debug("useHTTPPersistentConnection"); $this->debug("useHTTPPersistentConnection");
$this->persistentConnection = true; $this->persistentConnection = true;
} }
/** /**
* gets the default RPC parameter setting. * gets the default RPC parameter setting.
* If true, default is that call params are like RPC even for document style. * If true, default is that call params are like RPC even for document style.
@@ -689,7 +689,7 @@ class nusoap_client extends nusoap_base {
function setDefaultRpcParams($rpcParams) { function setDefaultRpcParams($rpcParams) {
$this->defaultRpcParams = $rpcParams; $this->defaultRpcParams = $rpcParams;
} }
/** /**
* dynamically creates an instance of a proxy class, * dynamically creates an instance of a proxy class,
* allowing user to directly call methods from wsdl * allowing user to directly call methods from wsdl
@@ -819,7 +819,7 @@ class nusoap_client extends nusoap_base {
function getHTTPBody($soapmsg) { function getHTTPBody($soapmsg) {
return $soapmsg; return $soapmsg;
} }
/** /**
* gets the HTTP content type for the current request. * gets the HTTP content type for the current request.
* *
@@ -831,7 +831,7 @@ class nusoap_client extends nusoap_base {
function getHTTPContentType() { function getHTTPContentType() {
return 'text/xml'; return 'text/xml';
} }
/** /**
* gets the HTTP content type charset for the current request. * gets the HTTP content type charset for the current request.
* returns false for non-text content types. * returns false for non-text content types.

View File

@@ -6,14 +6,14 @@
/** /**
* parses a WSDL file, allows access to it's data, other utility methods. * parses a WSDL file, allows access to it's data, other utility methods.
* also builds WSDL structures programmatically. * also builds WSDL structures programmatically.
* *
* @author Dietrich Ayala <dietrich@ganx4.com> * @author Dietrich Ayala <dietrich@ganx4.com>
* @author Scott Nichol <snichol@users.sourceforge.net> * @author Scott Nichol <snichol@users.sourceforge.net>
* @access public * @access public
*/ */
class wsdl extends nusoap_base { class wsdl extends nusoap_base {
// URL or filename of the root of this WSDL // URL or filename of the root of this WSDL
var $wsdl; var $wsdl;
// define internal arrays of bindings, ports, operations, messages, etc. // define internal arrays of bindings, ports, operations, messages, etc.
var $schemas = array(); var $schemas = array();
var $currentSchema; var $currentSchema;
@@ -31,9 +31,9 @@ class wsdl extends nusoap_base {
var $opData = array(); var $opData = array();
var $status = ''; var $status = '';
var $documentation = false; var $documentation = false;
var $endpoint = ''; var $endpoint = '';
// array of wsdl docs to import // array of wsdl docs to import
var $import = array(); var $import = array();
// parser vars // parser vars
var $parser; var $parser;
var $position = 0; var $position = 0;
@@ -56,7 +56,7 @@ class wsdl extends nusoap_base {
/** /**
* constructor * constructor
* *
* @param string $wsdl WSDL document URL * @param string $wsdl WSDL document URL
* @param string $proxyhost * @param string $proxyhost
* @param string $proxyport * @param string $proxyport
@@ -66,10 +66,10 @@ class wsdl extends nusoap_base {
* @param integer $response_timeout set the response timeout * @param integer $response_timeout set the response timeout
* @param array $curl_options user-specified cURL options * @param array $curl_options user-specified cURL options
* @param boolean $use_curl try to use cURL * @param boolean $use_curl try to use cURL
* @access public * @access public
*/ */
function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){
parent::nusoap_base(); parent::__construct();
$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
$this->proxyhost = $proxyhost; $this->proxyhost = $proxyhost;
$this->proxyport = $proxyport; $this->proxyport = $proxyport;
@@ -126,7 +126,7 @@ class wsdl extends nusoap_base {
} }
} }
} }
} }
} }
} }
// WSDL imports // WSDL imports
@@ -152,18 +152,18 @@ class wsdl extends nusoap_base {
} }
} }
} }
} }
} }
// add new data to operation data // add new data to operation data
foreach($this->bindings as $binding => $bindingData) { foreach($this->bindings as $binding => $bindingData) {
if (isset($bindingData['operations']) && is_array($bindingData['operations'])) { if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
foreach($bindingData['operations'] as $operation => $data) { foreach($bindingData['operations'] as $operation => $data) {
$this->debug('post-parse data gathering for ' . $operation); $this->debug('post-parse data gathering for ' . $operation);
$this->bindings[$binding]['operations'][$operation]['input'] = $this->bindings[$binding]['operations'][$operation]['input'] =
isset($this->bindings[$binding]['operations'][$operation]['input']) ? isset($this->bindings[$binding]['operations'][$operation]['input']) ?
array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) : array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
$this->portTypes[ $bindingData['portType'] ][$operation]['input']; $this->portTypes[ $bindingData['portType'] ][$operation]['input'];
$this->bindings[$binding]['operations'][$operation]['output'] = $this->bindings[$binding]['operations'][$operation]['output'] =
isset($this->bindings[$binding]['operations'][$operation]['output']) ? isset($this->bindings[$binding]['operations'][$operation]['output']) ?
array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) : array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
$this->portTypes[ $bindingData['portType'] ][$operation]['output']; $this->portTypes[ $bindingData['portType'] ][$operation]['output'];
@@ -180,16 +180,16 @@ class wsdl extends nusoap_base {
$this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : ''; $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
$this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : ''; $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
$this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : ''; $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
} }
} }
} }
} }
/** /**
* parses the wsdl document * parses the wsdl document
* *
* @param string $wsdl path or URL * @param string $wsdl path or URL
* @access private * @access private
*/ */
function parseWSDL($wsdl = '') { function parseWSDL($wsdl = '') {
$this->debug("parse WSDL at path=$wsdl"); $this->debug("parse WSDL at path=$wsdl");
@@ -199,7 +199,7 @@ class wsdl extends nusoap_base {
$this->setError('no wsdl passed to parseWSDL()!!'); $this->setError('no wsdl passed to parseWSDL()!!');
return false; return false;
} }
// parse $wsdl for url format // parse $wsdl for url format
$wsdl_props = parse_url($wsdl); $wsdl_props = parse_url($wsdl);
@@ -242,24 +242,24 @@ class wsdl extends nusoap_base {
$wsdl_string = ''; $wsdl_string = '';
while ($data = fread($fp, 32768)) { while ($data = fread($fp, 32768)) {
$wsdl_string .= $data; $wsdl_string .= $data;
} }
fclose($fp); fclose($fp);
} else { } else {
$errstr = "Bad path to WSDL file $path"; $errstr = "Bad path to WSDL file $path";
$this->debug($errstr); $this->debug($errstr);
$this->setError($errstr); $this->setError($errstr);
return false; return false;
} }
} }
$this->debug('Parse WSDL'); $this->debug('Parse WSDL');
// end new code added // end new code added
// Create an XML parser. // Create an XML parser.
$this->parser = xml_parser_create(); $this->parser = xml_parser_create();
// Set the options for parsing the XML data. // Set the options for parsing the XML data.
// xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
// Set the object for the parser. // Set the object for the parser.
xml_set_object($this->parser, $this); xml_set_object($this->parser, $this);
// Set the element handlers for the parser. // Set the element handlers for the parser.
xml_set_element_handler($this->parser, 'start_element', 'end_element'); xml_set_element_handler($this->parser, 'start_element', 'end_element');
xml_set_character_data_handler($this->parser, 'character_data'); xml_set_character_data_handler($this->parser, 'character_data');
@@ -276,7 +276,7 @@ class wsdl extends nusoap_base {
$this->debug("XML payload:\n" . $wsdl_string); $this->debug("XML payload:\n" . $wsdl_string);
$this->setError($errstr); $this->setError($errstr);
return false; return false;
} }
// free the parser // free the parser
xml_parser_free($this->parser); xml_parser_free($this->parser);
$this->debug('Parsing WSDL done'); $this->debug('Parsing WSDL done');
@@ -285,15 +285,15 @@ class wsdl extends nusoap_base {
return false; return false;
} }
return true; return true;
} }
/** /**
* start-element handler * start-element handler
* *
* @param string $parser XML parser object * @param string $parser XML parser object
* @param string $name element name * @param string $name element name
* @param string $attrs associative array of attributes * @param string $attrs associative array of attributes
* @access private * @access private
*/ */
function start_element($parser, $name, $attrs) function start_element($parser, $name, $attrs)
{ {
@@ -312,10 +312,10 @@ class wsdl extends nusoap_base {
} else { } else {
// position in the total number of elements, starting from 0 // position in the total number of elements, starting from 0
$pos = $this->position++; $pos = $this->position++;
$depth = $this->depth++; $depth = $this->depth++;
// set self as current value for this depth // set self as current value for this depth
$this->depth_array[$depth] = $pos; $this->depth_array[$depth] = $pos;
$this->message[$pos] = array('cdata' => ''); $this->message[$pos] = array('cdata' => '');
// process attributes // process attributes
if (count($attrs) > 0) { if (count($attrs) > 0) {
// register namespace declarations // register namespace declarations
@@ -325,11 +325,11 @@ class wsdl extends nusoap_base {
$this->namespaces[$ns_prefix] = $v; $this->namespaces[$ns_prefix] = $v;
} else { } else {
$this->namespaces['ns' . (count($this->namespaces) + 1)] = $v; $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
} }
if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') { if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
$this->XMLSchemaVersion = $v; $this->XMLSchemaVersion = $v;
$this->namespaces['xsi'] = $v . '-instance'; $this->namespaces['xsi'] = $v . '-instance';
} }
} }
} }
// expand each attribute prefix to its namespace // expand each attribute prefix to its namespace
@@ -337,22 +337,22 @@ class wsdl extends nusoap_base {
$k = strpos($k, ':') ? $this->expandQname($k) : $k; $k = strpos($k, ':') ? $this->expandQname($k) : $k;
if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') { if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
$v = strpos($v, ':') ? $this->expandQname($v) : $v; $v = strpos($v, ':') ? $this->expandQname($v) : $v;
} }
$eAttrs[$k] = $v; $eAttrs[$k] = $v;
} }
$attrs = $eAttrs; $attrs = $eAttrs;
} else { } else {
$attrs = array(); $attrs = array();
} }
// get element prefix, namespace and name // get element prefix, namespace and name
if (preg_match('/:/', $name)) { if (preg_match('/:/', $name)) {
// get ns prefix // get ns prefix
$prefix = substr($name, 0, strpos($name, ':')); $prefix = substr($name, 0, strpos($name, ':'));
// get ns // get ns
$namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : '';
// get unqualified name // get unqualified name
$name = substr(strstr($name, ':'), 1); $name = substr(strstr($name, ':'), 1);
} }
// process attributes, expanding any prefixes to namespaces // process attributes, expanding any prefixes to namespaces
// find status, register data // find status, register data
switch ($this->status) { switch ($this->status) {
@@ -361,12 +361,12 @@ class wsdl extends nusoap_base {
if (isset($attrs['type'])) { if (isset($attrs['type'])) {
$this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs)); $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs));
$this->messages[$this->currentMessage][$attrs['name']] = $attrs['type']; $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
} }
if (isset($attrs['element'])) { if (isset($attrs['element'])) {
$this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs)); $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs));
$this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^'; $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^';
} }
} }
break; break;
case 'portType': case 'portType':
switch ($name) { switch ($name) {
@@ -375,25 +375,25 @@ class wsdl extends nusoap_base {
$this->debug("portType $this->currentPortType operation: $this->currentPortOperation"); $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
if (isset($attrs['parameterOrder'])) { if (isset($attrs['parameterOrder'])) {
$this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder']; $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
} }
break; break;
case 'documentation': case 'documentation':
$this->documentation = true; $this->documentation = true;
break; break;
// merge input/output data // merge input/output data
default: default:
$m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : ''; $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
$this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m; $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
break; break;
} }
break; break;
case 'binding': case 'binding':
switch ($name) { switch ($name) {
case 'binding': case 'binding':
// get ns prefix // get ns prefix
if (isset($attrs['style'])) { if (isset($attrs['style'])) {
$this->bindings[$this->currentBinding]['prefix'] = $prefix; $this->bindings[$this->currentBinding]['prefix'] = $prefix;
} }
$this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs); $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
break; break;
case 'header': case 'header':
@@ -402,17 +402,17 @@ class wsdl extends nusoap_base {
case 'operation': case 'operation':
if (isset($attrs['soapAction'])) { if (isset($attrs['soapAction'])) {
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction']; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
} }
if (isset($attrs['style'])) { if (isset($attrs['style'])) {
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style']; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
} }
if (isset($attrs['name'])) { if (isset($attrs['name'])) {
$this->currentOperation = $attrs['name']; $this->currentOperation = $attrs['name'];
$this->debug("current binding operation: $this->currentOperation"); $this->debug("current binding operation: $this->currentOperation");
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name']; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : ''; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
} }
break; break;
case 'input': case 'input':
$this->opStatus = 'input'; $this->opStatus = 'input';
@@ -425,9 +425,9 @@ class wsdl extends nusoap_base {
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs); $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
} else { } else {
$this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
} }
break; break;
} }
break; break;
case 'service': case 'service':
switch ($name) { switch ($name) {
@@ -435,7 +435,7 @@ class wsdl extends nusoap_base {
$this->currentPort = $attrs['name']; $this->currentPort = $attrs['name'];
$this->debug('current port: ' . $this->currentPort); $this->debug('current port: ' . $this->currentPort);
$this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']); $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
break; break;
case 'address': case 'address':
$this->ports[$this->currentPort]['location'] = $attrs['location']; $this->ports[$this->currentPort]['location'] = $attrs['location'];
@@ -443,9 +443,9 @@ class wsdl extends nusoap_base {
$this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace; $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
$this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location']; $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
break; break;
} }
break; break;
} }
// set status // set status
switch ($name) { switch ($name) {
case 'import': case 'import':
@@ -481,11 +481,11 @@ class wsdl extends nusoap_base {
$this->currentBinding = $this->getLocalPart($attrs['name']); $this->currentBinding = $this->getLocalPart($attrs['name']);
} else { } else {
$this->currentBinding = $attrs['name']; $this->currentBinding = $attrs['name'];
} }
$this->status = 'binding'; $this->status = 'binding';
$this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']); $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
$this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']); $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
} }
break; break;
case 'service': case 'service':
$this->serviceName = $attrs['name']; $this->serviceName = $attrs['name'];
@@ -495,20 +495,20 @@ class wsdl extends nusoap_base {
case 'definitions': case 'definitions':
foreach ($attrs as $name => $value) { foreach ($attrs as $name => $value) {
$this->wsdl_info[$name] = $value; $this->wsdl_info[$name] = $value;
} }
break; break;
} }
} }
} }
/** /**
* end-element handler * end-element handler
* *
* @param string $parser XML parser object * @param string $parser XML parser object
* @param string $name element name * @param string $name element name
* @access private * @access private
*/ */
function end_element($parser, $name){ function end_element($parser, $name){
// unset schema status // unset schema status
if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
$this->status = ""; $this->status = "";
@@ -516,38 +516,38 @@ class wsdl extends nusoap_base {
$this->currentSchema->clearDebug(); $this->currentSchema->clearDebug();
$this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema; $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
$this->debug('Parsing WSDL schema done'); $this->debug('Parsing WSDL schema done');
} }
if ($this->status == 'schema') { if ($this->status == 'schema') {
$this->currentSchema->schemaEndElement($parser, $name); $this->currentSchema->schemaEndElement($parser, $name);
} else { } else {
// bring depth down a notch // bring depth down a notch
$this->depth--; $this->depth--;
} }
// end documentation // end documentation
if ($this->documentation) { if ($this->documentation) {
//TODO: track the node to which documentation should be assigned; it can be a part, message, etc. //TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
//$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation; //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
$this->documentation = false; $this->documentation = false;
} }
} }
/** /**
* element content handler * element content handler
* *
* @param string $parser XML parser object * @param string $parser XML parser object
* @param string $data element content * @param string $data element content
* @access private * @access private
*/ */
function character_data($parser, $data) function character_data($parser, $data)
{ {
$pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
if (isset($this->message[$pos]['cdata'])) { if (isset($this->message[$pos]['cdata'])) {
$this->message[$pos]['cdata'] .= $data; $this->message[$pos]['cdata'] .= $data;
} }
if ($this->documentation) { if ($this->documentation) {
$this->documentation .= $data; $this->documentation .= $data;
} }
} }
/** /**
* if authenticating, set user credentials here * if authenticating, set user credentials here
@@ -566,21 +566,21 @@ class wsdl extends nusoap_base {
$this->authtype = $authtype; $this->authtype = $authtype;
$this->certRequest = $certRequest; $this->certRequest = $certRequest;
} }
function getBindingData($binding) function getBindingData($binding)
{ {
if (is_array($this->bindings[$binding])) { if (is_array($this->bindings[$binding])) {
return $this->bindings[$binding]; return $this->bindings[$binding];
} }
} }
/** /**
* returns an assoc array of operation names => operation data * returns an assoc array of operation names => operation data
* *
* @param string $portName WSDL port name * @param string $portName WSDL port name
* @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported) * @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported)
* @return array * @return array
* @access public * @access public
*/ */
function getOperations($portName = '', $bindingType = 'soap') { function getOperations($portName = '', $bindingType = 'soap') {
$ops = array(); $ops = array();
@@ -612,15 +612,15 @@ class wsdl extends nusoap_base {
$this->debug("getOperations found no operations for port '$portName' bindingType $bindingType"); $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType");
} }
return $ops; return $ops;
} }
/** /**
* returns an associative array of data necessary for calling an operation * returns an associative array of data necessary for calling an operation
* *
* @param string $operation name of operation * @param string $operation name of operation
* @param string $bindingType type of binding eg: soap, soap12 * @param string $bindingType type of binding eg: soap, soap12
* @return array * @return array
* @access public * @access public
*/ */
function getOperationData($operation, $bindingType = 'soap') function getOperationData($operation, $bindingType = 'soap')
{ {
@@ -640,19 +640,19 @@ class wsdl extends nusoap_base {
if ($operation == $bOperation) { if ($operation == $bOperation) {
$opData = $this->bindings[ $portData['binding'] ]['operations'][$operation]; $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
return $opData; return $opData;
} }
} }
} }
} }
} }
/** /**
* returns an associative array of data necessary for calling an operation * returns an associative array of data necessary for calling an operation
* *
* @param string $soapAction soapAction for operation * @param string $soapAction soapAction for operation
* @param string $bindingType type of binding eg: soap, soap12 * @param string $bindingType type of binding eg: soap, soap12
* @return array * @return array
* @access public * @access public
*/ */
function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') { function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') {
if ($bindingType == 'soap') { if ($bindingType == 'soap') {
@@ -668,12 +668,12 @@ class wsdl extends nusoap_base {
foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
if ($opData['soapAction'] == $soapAction) { if ($opData['soapAction'] == $soapAction) {
return $opData; return $opData;
} }
} }
} }
} }
} }
/** /**
* returns an array of information about a given type * returns an array of information about a given type
* returns false if no type exists by the given name * returns false if no type exists by the given name
@@ -884,7 +884,7 @@ class wsdl extends nusoap_base {
* *
* @param mixed $debug whether to put debug=1 in endpoint URL * @param mixed $debug whether to put debug=1 in endpoint URL
* @return string serialization of WSDL * @return string serialization of WSDL
* @access public * @access public
*/ */
function serialize($debug = 0) function serialize($debug = 0)
{ {
@@ -892,15 +892,15 @@ class wsdl extends nusoap_base {
$xml .= "\n<definitions"; $xml .= "\n<definitions";
foreach($this->namespaces as $k => $v) { foreach($this->namespaces as $k => $v) {
$xml .= " xmlns:$k=\"$v\""; $xml .= " xmlns:$k=\"$v\"";
} }
// 10.9.02 - add poulter fix for wsdl and tns declarations // 10.9.02 - add poulter fix for wsdl and tns declarations
if (isset($this->namespaces['wsdl'])) { if (isset($this->namespaces['wsdl'])) {
$xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\""; $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
} }
if (isset($this->namespaces['tns'])) { if (isset($this->namespaces['tns'])) {
$xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\""; $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
} }
$xml .= '>'; $xml .= '>';
// imports // imports
if (sizeof($this->import) > 0) { if (sizeof($this->import) > 0) {
foreach($this->import as $ns => $list) { foreach($this->import as $ns => $list) {
@@ -911,8 +911,8 @@ class wsdl extends nusoap_base {
$xml .= '<import namespace="' . $ns . '" />'; $xml .= '<import namespace="' . $ns . '" />';
} }
} }
} }
} }
// types // types
if (count($this->schemas)>=1) { if (count($this->schemas)>=1) {
$xml .= "\n<types>\n"; $xml .= "\n<types>\n";
@@ -922,7 +922,7 @@ class wsdl extends nusoap_base {
} }
} }
$xml .= '</types>'; $xml .= '</types>';
} }
// messages // messages
if (count($this->messages) >= 1) { if (count($this->messages) >= 1) {
foreach($this->messages as $msgName => $msgParts) { foreach($this->messages as $msgName => $msgParts) {
@@ -939,11 +939,11 @@ class wsdl extends nusoap_base {
foreach($this->typemap as $ns => $types) { foreach($this->typemap as $ns => $types) {
if (isset($types[$partType])) { if (isset($types[$partType])) {
$typePrefix = $this->getPrefixFromNamespace($ns); $typePrefix = $this->getPrefixFromNamespace($ns);
} }
} }
if (!isset($typePrefix)) { if (!isset($typePrefix)) {
die("$partType has no namespace!"); die("$partType has no namespace!");
} }
} }
$ns = $this->getNamespaceFromPrefix($typePrefix); $ns = $this->getNamespaceFromPrefix($typePrefix);
$localPart = $this->getLocalPart($partType); $localPart = $this->getLocalPart($partType);
@@ -960,8 +960,8 @@ class wsdl extends nusoap_base {
} }
} }
$xml .= '</message>'; $xml .= '</message>';
} }
} }
// bindings & porttypes // bindings & porttypes
if (count($this->bindings) >= 1) { if (count($this->bindings) >= 1) {
$binding_xml = ''; $binding_xml = '';
@@ -989,7 +989,7 @@ class wsdl extends nusoap_base {
$portType_xml .= "\n" . ' <operation name="' . $opParts['name'] . '"'; $portType_xml .= "\n" . ' <operation name="' . $opParts['name'] . '"';
if (isset($opParts['parameterOrder'])) { if (isset($opParts['parameterOrder'])) {
$portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"'; $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
} }
$portType_xml .= '>'; $portType_xml .= '>';
if(isset($opParts['documentation']) && $opParts['documentation'] != '') { if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
$portType_xml .= "\n" . ' <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>'; $portType_xml .= "\n" . ' <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
@@ -997,12 +997,12 @@ class wsdl extends nusoap_base {
$portType_xml .= "\n" . ' <input message="tns:' . $opParts['input']['message'] . '"/>'; $portType_xml .= "\n" . ' <input message="tns:' . $opParts['input']['message'] . '"/>';
$portType_xml .= "\n" . ' <output message="tns:' . $opParts['output']['message'] . '"/>'; $portType_xml .= "\n" . ' <output message="tns:' . $opParts['output']['message'] . '"/>';
$portType_xml .= "\n" . ' </operation>'; $portType_xml .= "\n" . ' </operation>';
} }
$portType_xml .= "\n" . '</portType>'; $portType_xml .= "\n" . '</portType>';
$binding_xml .= "\n" . '</binding>'; $binding_xml .= "\n" . '</binding>';
} }
$xml .= $portType_xml . $binding_xml; $xml .= $portType_xml . $binding_xml;
} }
// services // services
$xml .= "\n<service name=\"" . $this->serviceName . '">'; $xml .= "\n<service name=\"" . $this->serviceName . '">';
if (count($this->ports) >= 1) { if (count($this->ports) >= 1) {
@@ -1010,11 +1010,11 @@ class wsdl extends nusoap_base {
$xml .= "\n" . ' <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">'; $xml .= "\n" . ' <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
$xml .= "\n" . ' <soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>'; $xml .= "\n" . ' <soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
$xml .= "\n" . ' </port>'; $xml .= "\n" . ' </port>';
} }
} }
$xml .= "\n" . '</service>'; $xml .= "\n" . '</service>';
return $xml . "\n</definitions>"; return $xml . "\n</definitions>";
} }
/** /**
* determine whether a set of parameters are unwrapped * determine whether a set of parameters are unwrapped
@@ -1059,7 +1059,7 @@ class wsdl extends nusoap_base {
$phpType = $typeDef['phpType']; $phpType = $typeDef['phpType'];
$arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''); $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '');
$this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType"); $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType");
// we expect a complexType or element of complexType // we expect a complexType or element of complexType
if ($phpType != 'struct') { if ($phpType != 'struct') {
$this->debug("in parametersMatchWrapped: not a struct"); $this->debug("in parametersMatchWrapped: not a struct");
@@ -1100,7 +1100,7 @@ class wsdl extends nusoap_base {
* TODO * TODO
* - multi-ref serialization * - multi-ref serialization
* - validate PHP values against type definitions, return errors if invalid * - validate PHP values against type definitions, return errors if invalid
* *
* @param string $operation operation name * @param string $operation operation name
* @param string $direction (input|output) * @param string $direction (input|output)
* @param mixed $parameters parameter value(s) * @param mixed $parameters parameter value(s)
@@ -1111,12 +1111,12 @@ class wsdl extends nusoap_base {
function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') { function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') {
$this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType"); $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType");
$this->appendDebug('parameters=' . $this->varDump($parameters)); $this->appendDebug('parameters=' . $this->varDump($parameters));
if ($direction != 'input' && $direction != 'output') { if ($direction != 'input' && $direction != 'output') {
$this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
$this->setError('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
return false; return false;
} }
if (!$opData = $this->getOperationData($operation, $bindingType)) { if (!$opData = $this->getOperationData($operation, $bindingType)) {
$this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
$this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
@@ -1167,7 +1167,7 @@ class wsdl extends nusoap_base {
$this->debug("serializing part $name of type $type"); $this->debug("serializing part $name of type $type");
// Track encoding style // Track encoding style
if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
$encodingStyle = $opData[$direction]['encodingStyle']; $encodingStyle = $opData[$direction]['encodingStyle'];
$enc_style = $encodingStyle; $enc_style = $encodingStyle;
} else { } else {
$enc_style = false; $enc_style = false;
@@ -1193,15 +1193,15 @@ class wsdl extends nusoap_base {
} }
$this->debug("serializeRPCParameters returning: $xml"); $this->debug("serializeRPCParameters returning: $xml");
return $xml; return $xml;
} }
/** /**
* serialize a PHP value according to a WSDL message definition * serialize a PHP value according to a WSDL message definition
* *
* TODO * TODO
* - multi-ref serialization * - multi-ref serialization
* - validate PHP values against type definitions, return errors if invalid * - validate PHP values against type definitions, return errors if invalid
* *
* @param string $operation operation name * @param string $operation operation name
* @param string $direction (input|output) * @param string $direction (input|output)
* @param mixed $parameters parameter value(s) * @param mixed $parameters parameter value(s)
@@ -1211,14 +1211,14 @@ class wsdl extends nusoap_base {
*/ */
function serializeParameters($operation, $direction, $parameters) function serializeParameters($operation, $direction, $parameters)
{ {
$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
$this->appendDebug('parameters=' . $this->varDump($parameters)); $this->appendDebug('parameters=' . $this->varDump($parameters));
if ($direction != 'input' && $direction != 'output') { if ($direction != 'input' && $direction != 'output') {
$this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->debug('The value of the \$direction argument needs to be either "input" or "output"');
$this->setError('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"');
return false; return false;
} }
if (!$opData = $this->getOperationData($operation)) { if (!$opData = $this->getOperationData($operation)) {
$this->debug('Unable to retrieve WSDL data for operation: ' . $operation); $this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
$this->setError('Unable to retrieve WSDL data for operation: ' . $operation); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
@@ -1226,18 +1226,18 @@ class wsdl extends nusoap_base {
} }
$this->debug('opData:'); $this->debug('opData:');
$this->appendDebug($this->varDump($opData)); $this->appendDebug($this->varDump($opData));
// Get encoding style for output and set to current // Get encoding style for output and set to current
$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
$encodingStyle = $opData['output']['encodingStyle']; $encodingStyle = $opData['output']['encodingStyle'];
$enc_style = $encodingStyle; $enc_style = $encodingStyle;
} }
// set input params // set input params
$xml = ''; $xml = '';
if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
$use = $opData[$direction]['use']; $use = $opData[$direction]['use'];
$this->debug("use=$use"); $this->debug("use=$use");
$this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)'); $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
@@ -1248,7 +1248,7 @@ class wsdl extends nusoap_base {
$this->debug('serializing part "'.$name.'" of type "'.$type.'"'); $this->debug('serializing part "'.$name.'" of type "'.$type.'"');
// Track encoding style // Track encoding style
if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
$encodingStyle = $opData[$direction]['encodingStyle']; $encodingStyle = $opData[$direction]['encodingStyle'];
$enc_style = $encodingStyle; $enc_style = $encodingStyle;
} else { } else {
$enc_style = false; $enc_style = false;
@@ -1274,11 +1274,11 @@ class wsdl extends nusoap_base {
} }
$this->debug("serializeParameters returning: $xml"); $this->debug("serializeParameters returning: $xml");
return $xml; return $xml;
} }
/** /**
* serializes a PHP value according a given type definition * serializes a PHP value according a given type definition
* *
* @param string $name name of value (part or element) * @param string $name name of value (part or element)
* @param string $type XML schema type of value (type or element) * @param string $type XML schema type of value (type or element)
* @param mixed $value a native PHP value (parameter value) * @param mixed $value a native PHP value (parameter value)
@@ -1364,7 +1364,7 @@ class wsdl extends nusoap_base {
} else { } else {
$value = 'true'; $value = 'true';
} }
} }
if ($uqType == 'string' && gettype($value) == 'string') { if ($uqType == 'string' && gettype($value) == 'string') {
$value = $this->expandEntities($value); $value = $this->expandEntities($value);
} }
@@ -1445,7 +1445,7 @@ class wsdl extends nusoap_base {
return false; return false;
} }
$phpType = $typeDef['phpType']; $phpType = $typeDef['phpType'];
$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') );
// if php type == struct, map value to the <all> element names // if php type == struct, map value to the <all> element names
if ($phpType == 'struct') { if ($phpType == 'struct') {
if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') { if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
@@ -1537,11 +1537,11 @@ class wsdl extends nusoap_base {
foreach($value as $v) { foreach($value as $v) {
$cols = ',' . sizeof($v); $cols = ',' . sizeof($v);
$nv = array_merge($nv, $v); $nv = array_merge($nv, $v);
} }
$value = $nv; $value = $nv;
} else { } else {
$cols = ''; $cols = '';
} }
if (is_array($value) && sizeof($value) >= 1) { if (is_array($value) && sizeof($value) >= 1) {
$rows = sizeof($value); $rows = sizeof($value);
$contents = ''; $contents = '';
@@ -1552,7 +1552,7 @@ class wsdl extends nusoap_base {
$contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
} else { } else {
$contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
} }
} }
} else { } else {
$rows = 0; $rows = 0;
@@ -1596,7 +1596,7 @@ class wsdl extends nusoap_base {
$this->debug("in serializeType: returning: $xml"); $this->debug("in serializeType: returning: $xml");
return $xml; return $xml;
} }
/** /**
* serializes the attributes for a complexType * serializes the attributes for a complexType
* *
@@ -1651,7 +1651,7 @@ class wsdl extends nusoap_base {
if ($xname) { if ($xname) {
$xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\""; $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
} }
} }
} else { } else {
$this->debug("no attributes to serialize for XML Schema type $ns:$uqType"); $this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
} }
@@ -1709,7 +1709,7 @@ class wsdl extends nusoap_base {
} }
// if user took advantage of a minOccurs=0, then only serialize named parameters // if user took advantage of a minOccurs=0, then only serialize named parameters
if (isset($optionals) if (isset($optionals)
&& (!isset($xvalue[$eName])) && (!isset($xvalue[$eName]))
&& ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true') && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
){ ){
if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') { if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
@@ -1757,7 +1757,7 @@ class wsdl extends nusoap_base {
} }
} }
} }
} }
} else { } else {
$this->debug("no elements to serialize for XML Schema type $ns:$uqType"); $this->debug("no elements to serialize for XML Schema type $ns:$uqType");
} }
@@ -1793,7 +1793,7 @@ class wsdl extends nusoap_base {
} }
$elements = $eElements; $elements = $eElements;
} }
if (count($attrs) > 0) { if (count($attrs) > 0) {
foreach($attrs as $n => $a){ foreach($attrs as $n => $a){
// expand each attribute // expand each attribute
@@ -1846,7 +1846,7 @@ class wsdl extends nusoap_base {
/** /**
* register an operation with the server * register an operation with the server
* *
* @param string $name operation (method) name * @param string $name operation (method) name
* @param array $in assoc array of input values: key = param name, value = param type * @param array $in assoc array of input values: key = param name, value = param type
* @param array $out assoc array of output values: key = param name, value = param type * @param array $out assoc array of output values: key = param name, value = param type
@@ -1856,7 +1856,7 @@ class wsdl extends nusoap_base {
* @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now) * @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now)
* @param string $documentation optional The description to include in the WSDL * @param string $documentation optional The description to include in the WSDL
* @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
* @access public * @access public
*/ */
function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){ function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){
if ($use == 'encoded' && $encodingStyle == '') { if ($use == 'encoded' && $encodingStyle == '') {
@@ -1903,7 +1903,7 @@ class wsdl extends nusoap_base {
'parts' => $out), 'parts' => $out),
'namespace' => $namespace, 'namespace' => $namespace,
'transport' => 'http://schemas.xmlsoap.org/soap/http', 'transport' => 'http://schemas.xmlsoap.org/soap/http',
'documentation' => $documentation); 'documentation' => $documentation);
// add portTypes // add portTypes
// add messages // add messages
if($in) if($in)
@@ -1931,7 +1931,7 @@ class wsdl extends nusoap_base {
$this->messages[$name.'Response']= '0'; $this->messages[$name.'Response']= '0';
} }
return true; return true;
} }
} }
?> ?>

View File

@@ -9,10 +9,10 @@ nusoap-general@lists.sourceforge.net
/** /**
* caches instances of the wsdl class * caches instances of the wsdl class
* *
* @author Scott Nichol <snichol@users.sourceforge.net> * @author Scott Nichol <snichol@users.sourceforge.net>
* @author Ingo Fischer <ingo@apollon.de> * @author Ingo Fischer <ingo@apollon.de>
* @access public * @access public
*/ */
class nusoap_wsdlcache { class nusoap_wsdlcache {
/** /**
@@ -43,7 +43,7 @@ class nusoap_wsdlcache {
* @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited * @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
* @access public * @access public
*/ */
function nusoap_wsdlcache($cache_dir='.', $cache_lifetime=0) { function __construct($cache_dir='.', $cache_lifetime=0) {
$this->fplock = array(); $this->fplock = array();
$this->cache_dir = $cache_dir != '' ? $cache_dir : '.'; $this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
$this->cache_lifetime = $cache_lifetime; $this->cache_lifetime = $cache_lifetime;

View File

@@ -12,7 +12,7 @@
* @access public * @access public
*/ */
class nusoap_xmlschema extends nusoap_base { class nusoap_xmlschema extends nusoap_base {
// files // files
var $schema = ''; var $schema = '';
var $xml = ''; var $xml = '';
@@ -41,7 +41,7 @@ class nusoap_xmlschema extends nusoap_base {
var $depth_array = array(); var $depth_array = array();
var $message = array(); var $message = array();
var $defaultNamespace = array(); var $defaultNamespace = array();
/** /**
* constructor * constructor
* *
@@ -50,8 +50,8 @@ class nusoap_xmlschema extends nusoap_base {
* @param string $namespaces namespaces defined in enclosing XML * @param string $namespaces namespaces defined in enclosing XML
* @access public * @access public
*/ */
function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ function __construct($schema='',$xml='',$namespaces=array()){
parent::nusoap_base(); parent::__construct();
$this->debug('nusoap_xmlschema class instantiated, inside constructor'); $this->debug('nusoap_xmlschema class instantiated, inside constructor');
// files // files
$this->schema = $schema; $this->schema = $schema;
@@ -141,7 +141,7 @@ class nusoap_xmlschema extends nusoap_base {
$this->debug("XML payload:\n" . $xml); $this->debug("XML payload:\n" . $xml);
$this->setError($errstr); $this->setError($errstr);
} }
xml_parser_free($this->parser); xml_parser_free($this->parser);
} else{ } else{
$this->debug('no xml passed to parseString()!!'); $this->debug('no xml passed to parseString()!!');
@@ -163,7 +163,7 @@ class nusoap_xmlschema extends nusoap_base {
} }
return $scope . $ename . '_ContainedType'; return $scope . $ename . '_ContainedType';
} }
/** /**
* start-element handler * start-element handler
* *
@@ -173,13 +173,13 @@ class nusoap_xmlschema extends nusoap_base {
* @access private * @access private
*/ */
function schemaStartElement($parser, $name, $attrs) { function schemaStartElement($parser, $name, $attrs) {
// position in the total number of elements, starting from 0 // position in the total number of elements, starting from 0
$pos = $this->position++; $pos = $this->position++;
$depth = $this->depth++; $depth = $this->depth++;
// set self as current value for this depth // set self as current value for this depth
$this->depth_array[$depth] = $pos; $this->depth_array[$depth] = $pos;
$this->message[$pos] = array('cdata' => ''); $this->message[$pos] = array('cdata' => '');
if ($depth > 0) { if ($depth > 0) {
$this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]];
} else { } else {
@@ -193,7 +193,7 @@ class nusoap_xmlschema extends nusoap_base {
} else { } else {
$prefix = ''; $prefix = '';
} }
// loop thru attributes, expanding, and registering namespace declarations // loop thru attributes, expanding, and registering namespace declarations
if(count($attrs) > 0){ if(count($attrs) > 0){
foreach($attrs as $k => $v){ foreach($attrs as $k => $v){
@@ -269,7 +269,7 @@ class nusoap_xmlschema extends nusoap_base {
$aname = $attrs['ref']; $aname = $attrs['ref'];
$this->attributes[$attrs['ref']] = $attrs; $this->attributes[$attrs['ref']] = $attrs;
} }
if($this->currentComplexType){ // This should *always* be if($this->currentComplexType){ // This should *always* be
$this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs;
} }
@@ -562,8 +562,8 @@ class nusoap_xmlschema extends nusoap_base {
$xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n";
} }
} }
} }
} }
// complex types // complex types
foreach($this->complexTypes as $typeName => $attrs){ foreach($this->complexTypes as $typeName => $attrs){
$contentStr = ''; $contentStr = '';
@@ -860,12 +860,12 @@ class nusoap_xmlschema extends nusoap_base {
} }
return $buffer; return $buffer;
} }
/** /**
* adds a complex type to the schema * adds a complex type to the schema
* *
* example: array * example: array
* *
* addType( * addType(
* 'ArrayOfstring', * 'ArrayOfstring',
* 'complexType', * 'complexType',
@@ -875,9 +875,9 @@ class nusoap_xmlschema extends nusoap_base {
* array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'),
* 'xsd:string' * 'xsd:string'
* ); * );
* *
* example: PHP associative array ( SOAP Struct ) * example: PHP associative array ( SOAP Struct )
* *
* addType( * addType(
* 'SOAPStruct', * 'SOAPStruct',
* 'complexType', * 'complexType',
@@ -885,7 +885,7 @@ class nusoap_xmlschema extends nusoap_base {
* 'all', * 'all',
* array('myVar'=> array('name'=>'myVar','type'=>'string') * array('myVar'=> array('name'=>'myVar','type'=>'string')
* ); * );
* *
* @param name * @param name
* @param typeClass (complexType|simpleType|attribute) * @param typeClass (complexType|simpleType|attribute)
* @param phpType: currently supported are array and struct (php assoc array) * @param phpType: currently supported are array and struct (php assoc array)
@@ -913,11 +913,11 @@ class nusoap_xmlschema extends nusoap_base {
'attrs' => $attrs, 'attrs' => $attrs,
'arrayType' => $arrayType 'arrayType' => $arrayType
); );
$this->xdebug("addComplexType $name:"); $this->xdebug("addComplexType $name:");
$this->appendDebug($this->varDump($this->complexTypes[$name])); $this->appendDebug($this->varDump($this->complexTypes[$name]));
} }
/** /**
* adds a simple type to the schema * adds a simple type to the schema
* *
@@ -938,7 +938,7 @@ class nusoap_xmlschema extends nusoap_base {
'type' => $restrictionBase, 'type' => $restrictionBase,
'enumeration' => $enumeration 'enumeration' => $enumeration
); );
$this->xdebug("addSimpleType $name:"); $this->xdebug("addSimpleType $name:");
$this->appendDebug($this->varDump($this->simpleTypes[$name])); $this->appendDebug($this->varDump($this->simpleTypes[$name]));
} }
@@ -956,7 +956,7 @@ class nusoap_xmlschema extends nusoap_base {
} }
$this->elements[ $attrs['name'] ] = $attrs; $this->elements[ $attrs['name'] ] = $attrs;
$this->elements[ $attrs['name'] ]['typeClass'] = 'element'; $this->elements[ $attrs['name'] ]['typeClass'] = 'element';
$this->xdebug("addElement " . $attrs['name']); $this->xdebug("addElement " . $attrs['name']);
$this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ]));
} }

View File

@@ -219,7 +219,7 @@ class nusoap_base {
* *
* @access public * @access public
*/ */
function nusoap_base() { function __construct() {
$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
} }
@@ -1037,8 +1037,8 @@ class nusoap_fault extends nusoap_base {
* @param string $faultstring human readable error message * @param string $faultstring human readable error message
* @param mixed $faultdetail detail, typically a string or array of string * @param mixed $faultdetail detail, typically a string or array of string
*/ */
function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
parent::nusoap_base(); parent::__construct();
$this->faultcode = $faultcode; $this->faultcode = $faultcode;
$this->faultactor = $faultactor; $this->faultactor = $faultactor;
$this->faultstring = $faultstring; $this->faultstring = $faultstring;
@@ -1129,8 +1129,8 @@ class nusoap_xmlschema extends nusoap_base {
* @param string $namespaces namespaces defined in enclosing XML * @param string $namespaces namespaces defined in enclosing XML
* @access public * @access public
*/ */
function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ function __construct($schema='',$xml='',$namespaces=array()){
parent::nusoap_base(); parent::__construct();
$this->debug('nusoap_xmlschema class instantiated, inside constructor'); $this->debug('nusoap_xmlschema class instantiated, inside constructor');
// files // files
$this->schema = $schema; $this->schema = $schema;
@@ -2116,8 +2116,8 @@ class soapval extends nusoap_base {
* @param mixed $attributes associative array of attributes to add to element serialization * @param mixed $attributes associative array of attributes to add to element serialization
* @access public * @access public
*/ */
function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { function __construct($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
parent::nusoap_base(); parent::__construct();
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
$this->value = $value; $this->value = $value;
@@ -2207,8 +2207,8 @@ class soap_transport_http extends nusoap_base {
* @param boolean $use_curl Whether to try to force cURL use * @param boolean $use_curl Whether to try to force cURL use
* @access public * @access public
*/ */
function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ function __construct($url, $curl_options = NULL, $use_curl = false){
parent::nusoap_base(); parent::__construct();
$this->debug("ctor url=$url use_curl=$use_curl curl_options:"); $this->debug("ctor url=$url use_curl=$use_curl curl_options:");
$this->appendDebug($this->varDump($curl_options)); $this->appendDebug($this->varDump($curl_options));
$this->setURL($url); $this->setURL($url);
@@ -3623,8 +3623,8 @@ class nusoap_server extends nusoap_base {
* @param mixed $wsdl file path or URL (string), or wsdl instance (object) * @param mixed $wsdl file path or URL (string), or wsdl instance (object)
* @access public * @access public
*/ */
function nusoap_server($wsdl=false){ function __construct($wsdl=false) {
parent::nusoap_base(); parent::__construct();
// turn on debugging? // turn on debugging?
global $debug; global $debug;
global $HTTP_SERVER_VARS; global $HTTP_SERVER_VARS;
@@ -4645,8 +4645,8 @@ class wsdl extends nusoap_base {
* @param boolean $use_curl try to use cURL * @param boolean $use_curl try to use cURL
* @access public * @access public
*/ */
function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){
parent::nusoap_base(); parent::__construct();
$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
$this->proxyhost = $proxyhost; $this->proxyhost = $proxyhost;
$this->proxyport = $proxyport; $this->proxyport = $proxyport;
@@ -6572,8 +6572,8 @@ class nusoap_parser extends nusoap_base {
* @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1
* @access public * @access public
*/ */
function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){
parent::nusoap_base(); parent::__construct();
$this->xml = $xml; $this->xml = $xml;
$this->xml_encoding = $encoding; $this->xml_encoding = $encoding;
$this->method = $method; $this->method = $method;
@@ -7249,8 +7249,8 @@ class nusoap_client extends nusoap_base {
* @param string $portName optional portName in WSDL document * @param string $portName optional portName in WSDL document
* @access public * @access public
*/ */
function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){
parent::nusoap_base(); parent::__construct();
$this->endpoint = $endpoint; $this->endpoint = $endpoint;
$this->proxyhost = $proxyhost; $this->proxyhost = $proxyhost;
$this->proxyport = $proxyport; $this->proxyport = $proxyport;

View File

@@ -1034,7 +1034,7 @@ if (!defined('NOLOGIN'))
$user->getrights(); $user->getrights();
} }
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL') ?constant('NOTOKENRENEWAL') : '')); dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL') ?constant('NOTOKENRENEWAL') : ''));
//Another call for easy debugg //Another call for easy debugg
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));

View File

@@ -183,7 +183,7 @@ class WebservicesOrdersTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code']); $this->assertEquals('OK', $result['result']['result_code']);
return $result; return $result;

View File

@@ -188,7 +188,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code']); $this->assertEquals('OK', $result['result']['result_code']);
// Test method that does not exists // Test method that does not exists
@@ -212,7 +212,7 @@ class WebservicesOtherTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals("SOAP-ENV:Client: Operation 'methodthatdoesnotexists' is not defined in the WSDL for this service", $soapclient->error_str); $this->assertEquals("SOAP-ENV:Client: Operation 'methodthatdoesnotexists' is not defined in the WSDL for this service", $soapclient->error_str);
return $result; return $result;

View File

@@ -202,7 +202,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code']); $this->assertEquals('OK', $result['result']['result_code']);
return $result['id']; return $result['id'];
@@ -265,7 +265,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code']); $this->assertEquals('OK', $result['result']['result_code']);
return $id; return $id;
@@ -328,7 +328,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code']); $this->assertEquals('OK', $result['result']['result_code']);
return 0; return 0;

View File

@@ -148,13 +148,15 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
$ns='http://www.dolibarr.org/ns/'; $ns='http://www.dolibarr.org/ns/';
// Set the WebService URL // Set the WebService URL
print __METHOD__."Create nusoap_client for URL=".$WS_DOL_URL."\n"; print __METHOD__." Create nusoap_client for URL=".$WS_DOL_URL."\n";
$soapclient = new nusoap_client($WS_DOL_URL); $soapclient = new nusoap_client($WS_DOL_URL);
if ($soapclient) { if ($soapclient) {
$soapclient->soap_defencoding='UTF-8'; $soapclient->soap_defencoding='UTF-8';
$soapclient->decodeUTF8(false); $soapclient->decodeUTF8(false);
} }
//$soapclient->setDebugLevel(5);
// Call the WebService method and store its result in $result. // Call the WebService method and store its result in $result.
$authentication=array( $authentication=array(
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
@@ -167,7 +169,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
// Test URL // Test URL
$result=''; $result='';
$parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'admin'); $parameters = array('authentication'=>$authentication,'id'=>0,'ref'=>'admin');
print __METHOD__."Call method ".$WS_METHOD."\n"; print __METHOD__." Call method ".$WS_METHOD."\n";
try { try {
$result = $soapclient->call($WS_METHOD, $parameters, $ns, ''); $result = $soapclient->call($WS_METHOD, $parameters, $ns, '');
} catch (SoapFault $exception) { } catch (SoapFault $exception) {
@@ -188,8 +190,8 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('OK', $result['result']['result_code'], 'Test on ref admin'); $this->assertEquals('OK', empty($result['result']['result_code'])?'':$result['result']['result_code'], 'Test on ref admin');
// Test URL // Test URL
$result=''; $result='';
@@ -211,7 +213,7 @@ class WebservicesUserTest extends PHPUnit\Framework\TestCase
print "\n"; print "\n";
} }
print __METHOD__." result=".$result."\n"; print __METHOD__." count(result)=".count($result)."\n";
$this->assertEquals('NOT_FOUND', $result['result']['result_code'], 'Test on ref that does not exists'); $this->assertEquals('NOT_FOUND', $result['result']['result_code'], 'Test on ref that does not exists');
return $result; return $result;