Skip to content

Commit 75d0c4e

Browse files
authored
Merge pull request #6 from iMi-digital/patch-1
Various Fixes and Improvements
2 parents b0ebffd + 9efcc8e commit 75d0c4e

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

src/AqBanking/Command/AddUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function execute(User $user)
2727
. ' --tokentype=pintan'
2828
. ' --server=' . escapeshellcmd($user->getBank()->getHbciUrl());
2929

30+
if ($user->getBank()->getHbciVersion()) {
31+
$shellCommand .= ' --hbciversion=' . escapeshellarg($user->getBank()->getHbciVersion()->getVersionNumber());
32+
}
33+
3034
$result = $this->getShellCommandExecutor()->execute($shellCommand);
3135

3236
if (self::RETURN_VAR_USER_ALREADY_EXISTS === $result->getReturnVar()) {

src/AqBanking/Command/ShellCommandExecutor.php

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class ShellCommandExecutor
88
{
99
public function execute($shellCommand)
1010
{
11+
$shellCommand = "LANG=C " . $shellCommand;
1112
$output = array();
1213
$returnVar = null;
1314
$tempFile = tempnam(sys_get_temp_dir(), 'aqb-');

src/AqBanking/Command/ShellCommandExecutor/DefectiveResultException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DefectiveResultException extends \Exception
1616

1717
public function __construct($message = '', $code = 0, \Exception $previous = null, Result $result = null, $shellCommand = '')
1818
{
19-
parent::__construct($message, $code, $previous);
19+
parent::__construct($message . " - Result: " . var_export($result, true) , $code, $previous);
2020

2121
$this->result = $result;
2222
$this->shellCommand = $shellCommand;

src/AqBanking/Command/ShellCommandExecutor/ResultAnalyzer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
class ResultAnalyzer
66
{
77
private $expectedOutputRegexes = array(
8-
'/Aufträge werden ausgeführt: Started\./',
98
'/Automatically accepting valid new certificate/',
109
'/Automatically accepting certificate/',
10+
'/The TLS connection was non-properly terminated./', // it usually automatically restarts, so no error
1111
'/Unexpected tag/',
1212
'/To debug set environment variable/',
1313
'/Your bank does not send an opening saldo/',

src/AqBanking/HbciVersion.php

+8
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,12 @@ public function getMethodCode()
4444
{
4545
return $this->methodCode;
4646
}
47+
48+
/**
49+
* @return string
50+
*/
51+
public function getVersionNumber()
52+
{
53+
return $this->versionNumber;
54+
}
4755
}

tests/unit/AqBanking/Command/ShellCommandExecutor/ResultAnalyzerTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public function testRecognizesErrorByResultVar()
2525
public function testCanTellCorrectPollResult()
2626
{
2727
$errors = array(
28-
'Aufträge werden ausgeführt: Started.',
2928
'5:2013/07/22 11-32-32:aqbanking(39873):abgui.c: 182: Automatically accepting valid new certificate [40:BD:81:8B:76:27:1A:58:5C:B7:68:46:1E:CB:F2:FD]',
3029
'5:2013/07/22 11-32-33:aqbanking(39873):abgui.c: 182: Automatically accepting valid new certificate [40:BD:81:8B:76:27:1A:58:5C:B7:68:46:1E:CB:F2:FD]',
3130
'5:2013/07/22 11-32-33:aqbanking(39873):abgui.c: 182: Automatically accepting valid new certificate [40:BD:81:8B:76:27:1A:58:5C:B7:68:46:1E:CB:F2:FD]',
@@ -43,7 +42,6 @@ public function testCanTellCorrectPollResult()
4342
public function testCanTellDefectivePollResult()
4443
{
4544
$errors = array(
46-
'Aufträge werden ausgeführt: Started.',
4745
'5:2013/07/22 11-31-44:aqbanking(39859):abgui.c: 182: Automatically accepting valid new certificate [40:BD:81:8B:76:27:1A:58:5C:B7:68:46:1E:CB:F2:FD]',
4846
'3:2013/07/22 11-31-44:aqhbci(39859):outbox.c: 1390: Error performing queue (-2)',
4947
'5:2013/07/22 11-31-44:aqbanking(39859):./banking_online.c: 119: Error executing backend\'s queue',

0 commit comments

Comments
 (0)