Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Detailed requirements check #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ composer require ondrejnov/eet
### Dependencies
- PHP >=5.6
- robrichards/wse-php
- php extensions: php_openssl.dll, php_soap.dll
- php extensions: php_openssl.dll, php_curl.dll, php_mbstring.dll, php_soap.dll

Attached WSDL, key and certificate are intended for non-production usage (Playground).

Expand Down
10 changes: 8 additions & 2 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@ public function send(Receipt $receipt, $check = FALSE) {
* @return void
*/
private function checkRequirements() {
if (!class_exists('\SoapClient')) {
throw new RequirementsException('Class SoapClient is not defined! Please, allow php extension php_soap.dll in php.ini');
if (!extension_loaded('soap')) {
throw new RequirementsException("Extension 'soap' is not loaded! Please, enable it in php.ini");
}
if (!extension_loaded('curl')) {
throw new RequirementsException("Extension 'curl' is not loaded! Please, enable it in php.ini");
}
if (!extension_loaded('mbstring')) {
throw new RequirementsException("Extension 'mbstring' is not loaded! Please, enable it in php.ini");
}
}

Expand Down