|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace kalanis\RemoteRequest; |
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
use kalanis\RemoteRequest\Interfaces; |
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Class Translations |
|
11
|
|
|
* @package kalanis\RemoteRequest |
|
12
|
|
|
* Return translated quotes from backend |
|
13
|
|
|
* - necessary due many translation systems through web |
|
14
|
|
|
* For work extends this class and pass extension into your project |
|
15
|
|
|
*/ |
|
16
|
|
|
class Translations implements Interfaces\IRRTranslations |
|
17
|
|
|
{ |
|
18
|
|
|
public function rrPointUnknownTarget(): string |
|
19
|
|
|
{ |
|
20
|
|
|
return 'Unknown target data for request'; |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
public function rrPointNoStreamPointer(): string |
|
24
|
|
|
{ |
|
25
|
|
|
return 'No stream pointer defined'; |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function rrPointSentProblem(string $error): string |
|
29
|
|
|
{ |
|
30
|
|
|
return 'Send problem: ' . $error; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public function rrPointReceivedProblem(string $error): string |
|
34
|
|
|
{ |
|
35
|
|
|
return 'Receive problem: ' . $error; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
public function rrSchemaUnknownPacketWrapper(): string |
|
39
|
|
|
{ |
|
40
|
|
|
return 'Unknown packet wrapper type'; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function rrSchemaUnknownResponse(string $schema): string |
|
44
|
|
|
{ |
|
45
|
|
|
return 'Unknown response available for protocol schema ' . $schema; |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function rrSocketCannotConnect(): string |
|
49
|
|
|
{ |
|
50
|
|
|
return 'Cannot establish connection'; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function rrSocketCannotConnect2(string $errorMessage): string |
|
54
|
|
|
{ |
|
55
|
|
|
return 'Cannot establish connection: ' . $errorMessage; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function rrHelpInvalidLink(string $link): string |
|
59
|
|
|
{ |
|
60
|
|
|
return 'Cannot parse link: ' . $link; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function rrHelpInvalidProtocolSchema(string $schema): string |
|
64
|
|
|
{ |
|
65
|
|
|
return 'Unknown protocol schema for known schema ' . $schema; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function rrHelpInvalidRequestSchema(string $schema): string |
|
69
|
|
|
{ |
|
70
|
|
|
return 'Unknown request available for schema ' . $schema; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function rrHelpInvalidResponseSchema(string $schema): string |
|
74
|
|
|
{ |
|
75
|
|
|
return 'Unknown response available for schema ' . $schema; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function rrHttpAnswerHeaderTooLarge(int $wantedSize, int $gotSize): string |
|
79
|
|
|
{ |
|
80
|
|
|
return sprintf('Page header is too large! Want *%d*, got *%d*', $wantedSize, $gotSize); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function rrFspResponseShort(int $size): string |
|
84
|
|
|
{ |
|
85
|
|
|
return 'Response too short'; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function rrFspResponseLarge(int $size): string |
|
89
|
|
|
{ |
|
90
|
|
|
return 'Response too large'; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function rrFspInvalidChecksum(int $expected, int $got): string |
|
94
|
|
|
{ |
|
95
|
|
|
return 'Invalid checksum'; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function rrFspEmptySequence(): string |
|
99
|
|
|
{ |
|
100
|
|
|
return 'Empty sequence!'; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function rrFspEmptyHost(): string |
|
104
|
|
|
{ |
|
105
|
|
|
return 'Empty host!'; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function rrFspNoAction(): string |
|
109
|
|
|
{ |
|
110
|
|
|
return 'No action set.'; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
public function rrFspNoTarget(): string |
|
114
|
|
|
{ |
|
115
|
|
|
return 'No target.'; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
public function rrFspWrongSequence(int $sequence, int $key): string |
|
119
|
|
|
{ |
|
120
|
|
|
return sprintf('Wrong sequence! Want *%d*, got *%d*', $key, $sequence); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function rrFspWrapMalformedPath(string $path): string |
|
124
|
|
|
{ |
|
125
|
|
|
return 'Malformed path: ' . $path; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
public function rrFspBadResponseClose(string $class): string |
|
129
|
|
|
{ |
|
130
|
|
|
return 'Got something bad with close. Class ' . $class; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function rrFspBadResponseRead(string $class): string |
|
134
|
|
|
{ |
|
135
|
|
|
return 'Got something bad with reading. Class ' . $class; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
public function rrFspBadResponseUpload(string $class): string |
|
139
|
|
|
{ |
|
140
|
|
|
return 'Got something bad with uploading. Class ' . $class; |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
public function rrFspBadResponsePublish(string $class): string |
|
144
|
|
|
{ |
|
145
|
|
|
return 'Got something bad with publishing. Class ' . $class; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
public function rrFspBadResponseUnlink(string $class): string |
|
149
|
|
|
{ |
|
150
|
|
|
return 'Got something bad with unlink. Class ' . $class; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
public function rrFspBadMkDir(string $mode): string |
|
154
|
|
|
{ |
|
155
|
|
|
return 'Got something bad with mkdir. Class ' . $mode; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
public function rrFspBadProtection(string $mode): string |
|
159
|
|
|
{ |
|
160
|
|
|
return 'Got something bad with setting protections. Class ' . $mode; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
public function rrFspBadRename(string $mode): string |
|
164
|
|
|
{ |
|
165
|
|
|
return 'Got something bad with rename. Class ' . $mode; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
public function rrFspBadRmDir(string $mode): string |
|
169
|
|
|
{ |
|
170
|
|
|
return 'Got something bad with rmdir. Class ' . $mode; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
public function rrFspBadFileMode(string $mode): string |
|
174
|
|
|
{ |
|
175
|
|
|
return 'Got problematic mode: ' . $mode; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function rrFspBadParsedPath(string $path): string |
|
179
|
|
|
{ |
|
180
|
|
|
return 'Bad parsed path: ' . $path; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
public function rrFspPathNotFound(string $path): string |
|
184
|
|
|
{ |
|
185
|
|
|
return 'FSP path not found: ' . $path; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
public function rrFspFileCannotWrite(): string |
|
189
|
|
|
{ |
|
190
|
|
|
return 'File not open for writing!'; |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
public function rrFspFileCannotCont(): string |
|
194
|
|
|
{ |
|
195
|
|
|
return 'No more'; |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
public function rrFspReadWrongSeek(int $wanted, int $got): string |
|
199
|
|
|
{ |
|
200
|
|
|
return sprintf('Bad read seek. Want *%d* got *%d* ', $wanted, $got); |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
public function rrFspWriteWrongSeek(int $wanted, int $got): string |
|
204
|
|
|
{ |
|
205
|
|
|
return sprintf('Bad write seek. Want *%d* got *%d* ', $wanted, $got); |
|
206
|
|
|
} |
|
207
|
|
|
} |
|
208
|
|
|
|