Skip to content

Commit 37bbb09

Browse files
committed
here it comes
0 parents  commit 37bbb09

File tree

113 files changed

+25683
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+25683
-0
lines changed

.buildpath

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<buildpath>
3+
<buildpathentry kind="src" path="vendor/sebastian/version/src">
4+
<attributes>
5+
<attribute name="composer" value="vendor"/>
6+
</attributes>
7+
</buildpathentry>
8+
<buildpathentry kind="src" path="vendor/phpunit/php-token-stream/src">
9+
<attributes>
10+
<attribute name="composer" value="vendor"/>
11+
</attributes>
12+
</buildpathentry>
13+
<buildpathentry kind="src" path="vendor/sebastian/environment/src">
14+
<attributes>
15+
<attribute name="composer" value="vendor"/>
16+
</attributes>
17+
</buildpathentry>
18+
<buildpathentry kind="src" path="vendor/phpunit/phpunit/src">
19+
<attributes>
20+
<attribute name="composer" value="vendor"/>
21+
</attributes>
22+
</buildpathentry>
23+
<buildpathentry external="true" kind="lib" path="C:/xampp/xampp/htdocs/reqdc_vendor"/>
24+
<buildpathentry kind="src" path="vendor/symfony/polyfill-mbstring">
25+
<attributes>
26+
<attribute name="composer" value="vendor"/>
27+
</attributes>
28+
</buildpathentry>
29+
<buildpathentry kind="src" path="vendor/phpdocumentor/reflection-common/src">
30+
<attributes>
31+
<attribute name="composer" value="vendor"/>
32+
</attributes>
33+
</buildpathentry>
34+
<buildpathentry kind="src" path="vendor/phpspec/prophecy/src/Prophecy">
35+
<attributes>
36+
<attribute name="composer" value="vendor"/>
37+
</attributes>
38+
</buildpathentry>
39+
<buildpathentry kind="src" path="vendor/phpunit/php-file-iterator/src">
40+
<attributes>
41+
<attribute name="composer" value="vendor"/>
42+
</attributes>
43+
</buildpathentry>
44+
<buildpathentry kind="src" path="tests"/>
45+
<buildpathentry kind="src" path="Implementations"/>
46+
<buildpathentry kind="src" path="config"/>
47+
<buildpathentry kind="src" path="reqdc_vendor"/>
48+
<buildpathentry kind="src" path="src"/>
49+
<buildpathentry kind="src" path="vendor/dragonmantank/cron-expression/src/Cron">
50+
<attributes>
51+
<attribute name="composer" value="vendor"/>
52+
</attributes>
53+
</buildpathentry>
54+
<buildpathentry kind="src" path="vendor/sebastian/object-reflector/src">
55+
<attributes>
56+
<attribute name="composer" value="vendor"/>
57+
</attributes>
58+
</buildpathentry>
59+
<buildpathentry kind="src" path="vendor/composer">
60+
<attributes>
61+
<attribute name="composer" value="vendor"/>
62+
</attributes>
63+
</buildpathentry>
64+
<buildpathentry kind="src" path="vendor/phpdocumentor/reflection-docblock/src">
65+
<attributes>
66+
<attribute name="composer" value="vendor"/>
67+
</attributes>
68+
</buildpathentry>
69+
<buildpathentry kind="src" path="vendor/sebastian/global-state/src">
70+
<attributes>
71+
<attribute name="composer" value="vendor"/>
72+
</attributes>
73+
</buildpathentry>
74+
<buildpathentry kind="src" path="vendor/theseer/tokenizer/src">
75+
<attributes>
76+
<attribute name="composer" value="vendor"/>
77+
</attributes>
78+
</buildpathentry>
79+
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
80+
<buildpathentry kind="src" path="vendor/sebastian/code-unit-reverse-lookup/src">
81+
<attributes>
82+
<attribute name="composer" value="vendor"/>
83+
</attributes>
84+
</buildpathentry>
85+
<buildpathentry kind="src" path="vendor/webmozart/assert/src">
86+
<attributes>
87+
<attribute name="composer" value="vendor"/>
88+
</attributes>
89+
</buildpathentry>
90+
<buildpathentry kind="src" path="vendor/sebastian/recursion-context/src">
91+
<attributes>
92+
<attribute name="composer" value="vendor"/>
93+
</attributes>
94+
</buildpathentry>
95+
<buildpathentry kind="src" path="vendor/phpmailer/phpmailer/src">
96+
<attributes>
97+
<attribute name="composer" value="vendor"/>
98+
</attributes>
99+
</buildpathentry>
100+
<buildpathentry kind="src" path="www"/>
101+
<buildpathentry kind="src" path="vendor/phpunit/php-code-coverage/src">
102+
<attributes>
103+
<attribute name="composer" value="vendor"/>
104+
</attributes>
105+
</buildpathentry>
106+
<buildpathentry kind="src" path="vendor/symfony/polyfill-ctype">
107+
<attributes>
108+
<attribute name="composer" value="vendor"/>
109+
</attributes>
110+
</buildpathentry>
111+
<buildpathentry kind="src" path="vendor/phar-io/manifest/src">
112+
<attributes>
113+
<attribute name="composer" value="vendor"/>
114+
</attributes>
115+
</buildpathentry>
116+
<buildpathentry kind="src" path="vendor/php-curl-class/php-curl-class/src/Curl">
117+
<attributes>
118+
<attribute name="composer" value="vendor"/>
119+
</attributes>
120+
</buildpathentry>
121+
<buildpathentry kind="src" path="vendor/myclabs/deep-copy/src/DeepCopy">
122+
<attributes>
123+
<attribute name="composer" value="vendor"/>
124+
</attributes>
125+
</buildpathentry>
126+
<buildpathentry kind="src" path="vendor/sebastian/diff/src">
127+
<attributes>
128+
<attribute name="composer" value="vendor"/>
129+
</attributes>
130+
</buildpathentry>
131+
<buildpathentry kind="src" path="vendor/phpdocumentor/type-resolver/src">
132+
<attributes>
133+
<attribute name="composer" value="vendor"/>
134+
</attributes>
135+
</buildpathentry>
136+
<buildpathentry kind="src" path="vendor/twig/twig/src">
137+
<attributes>
138+
<attribute name="composer" value="vendor"/>
139+
</attributes>
140+
</buildpathentry>
141+
<buildpathentry kind="src" path="vendor/phar-io/version/src">
142+
<attributes>
143+
<attribute name="composer" value="vendor"/>
144+
</attributes>
145+
</buildpathentry>
146+
<buildpathentry kind="src" path="vendor/mongodb/mongodb/src">
147+
<attributes>
148+
<attribute name="composer" value="vendor"/>
149+
</attributes>
150+
</buildpathentry>
151+
<buildpathentry kind="src" path="vendor/sebastian/comparator/src">
152+
<attributes>
153+
<attribute name="composer" value="vendor"/>
154+
</attributes>
155+
</buildpathentry>
156+
<buildpathentry kind="src" path="vendor/doctrine/instantiator/src/Doctrine/Instantiator">
157+
<attributes>
158+
<attribute name="composer" value="vendor"/>
159+
</attributes>
160+
</buildpathentry>
161+
<buildpathentry kind="src" path="vendor/sebastian/resource-operations/src">
162+
<attributes>
163+
<attribute name="composer" value="vendor"/>
164+
</attributes>
165+
</buildpathentry>
166+
<buildpathentry kind="src" path="stubs"/>
167+
<buildpathentry kind="src" path="vendor/sebastian/exporter/src">
168+
<attributes>
169+
<attribute name="composer" value="vendor"/>
170+
</attributes>
171+
</buildpathentry>
172+
<buildpathentry kind="src" path="view"/>
173+
<buildpathentry kind="src" path="vendor/phpunit/php-text-template/src">
174+
<attributes>
175+
<attribute name="composer" value="vendor"/>
176+
</attributes>
177+
</buildpathentry>
178+
<buildpathentry kind="src" path="vendor/sebastian/type/src">
179+
<attributes>
180+
<attribute name="composer" value="vendor"/>
181+
</attributes>
182+
</buildpathentry>
183+
<buildpathentry kind="src" path="vendor/sebastian/object-enumerator/src">
184+
<attributes>
185+
<attribute name="composer" value="vendor"/>
186+
</attributes>
187+
</buildpathentry>
188+
<buildpathentry kind="src" path="vendor/twig/twig/lib">
189+
<attributes>
190+
<attribute name="composer" value="vendor"/>
191+
</attributes>
192+
</buildpathentry>
193+
<buildpathentry kind="src" path="vendor/phpunit/php-timer/src">
194+
<attributes>
195+
<attribute name="composer" value="vendor"/>
196+
</attributes>
197+
</buildpathentry>
198+
<buildpathentry kind="src" path="vendor/defuse/php-encryption/src">
199+
<attributes>
200+
<attribute name="composer" value="vendor"/>
201+
</attributes>
202+
</buildpathentry>
203+
</buildpath>

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/*

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.project
2+
.phpunit.result.cache
3+
.settings
4+
/.settings
5+
/testResults/
6+
/testresults/
7+
/vendor/

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM centos:7
2+
# Install Apache
3+
RUN yum -y update
4+
RUN yum -y install httpd httpd-tools yum-utils wget nano links openssl dejavu-sans-fonts epel-release
5+
6+
7+
RUN rm -f /etc/httpd/conf.d/welcome.conf
8+
RUN rm -f /etc/httpd/conf.d/userdir.conf
9+
RUN rm -f /etc/httpd/conf.d/autoindex.conf
10+
11+
12+
# Install EPEL Repo
13+
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
14+
&& rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
15+
16+
# Install PHP
17+
18+
RUN yum-config-manager --enable remi-php73
19+
RUN yum -y install libcurl net-tools git httpd mod_security php php-bcmath php-cli php-common php-devel php-fpm php-gd php-intl php-json php-mbstring php-pdo php-pear.noarch php-pecl-mcrypt php-pecl-zip php-process php-xml
20+
21+
RUN yum -y install gettext composer unzip
22+
RUN rm -rf /var/www/html/*
23+
RUN mkdir /var/log/reqdc
24+
RUN chmod a+rwx /var/log/reqdc
25+
RUN pecl install mongodb
26+
RUN echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
27+
COPY composer.json /var/www/reqdc/composer.json
28+
WORKDIR /var/www/reqdc
29+
RUN composer install
30+
RUN chmod a+rwx /var/www/reqdc
31+
RUN chmod -R a+rwx /var/www/reqdc/*
32+
#For development mount
33+
RUN echo "formount:x:982:" >> /etc/group
34+
RUN usermod -a -G formount apache
35+
ARG DOMAIN
36+
ARG KEY
37+
ARG ENVNAME
38+
RUN echo "$ENVNAME" > /var/www/ENV
39+
RUN echo "$KEY" > /var/www/KEY
40+
41+
#Dont add anything after copy unless it is needed by copy
42+
COPY . /var/www/reqdc
43+
RUN envsubst < /var/www/reqdc/config/httpd.conf.template > /etc/httpd/conf/httpd.conf
44+
45+
46+
EXPOSE 80
47+
48+
# Start Apache
49+
CMD ["/usr/sbin/httpd","-D","FOREGROUND"]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
class MainImplementation1 extends Implementation
4+
{
5+
6+
public function getName()
7+
{
8+
return 'Main implementation 1';
9+
}
10+
11+
public function getDescription()
12+
{
13+
return 'Do your first things here';
14+
}
15+
16+
public function execute()
17+
{
18+
19+
$rawPayload = $this->getCurrentRawPayload();
20+
$xmlPayload = $this->getExecution()->getRequest()->getXMLObject();
21+
$arrayConvertedFromJsonPayload = $this->getExecution()->getRequest()->getPayloadArr();
22+
23+
log::info('You can do things here!');
24+
25+
log::warn('And set response to synchronous execution like this:');
26+
27+
28+
29+
30+
#Save something to data storage:
31+
DataStorage::set('httpbintest', 'URL', 'https://httpbin.org/post');
32+
33+
#Do outbound request, url and credentials are always in datastorage when using it so configuration is easy
34+
$out = OutboundHttpRequest::post('[1,3]','httpbintest');
35+
$out->maxRetryTime = 5;
36+
$out->send();
37+
#Maybe then later get the same value:
38+
$value = DataStorage::get('httpbintest', 'URL');
39+
$this->getExecution()->setResponseByArray([
40+
'requestId' => $this->getExecution()->getRequest()->getId()->__toString(),
41+
'executionId' => $this->getExecution()->getId()->__toString(),
42+
'thisberespondedcustomstring' => date('c'),
43+
'c' => 1,
44+
'httpBinResponse' => $out->curl->response
45+
]);
46+
47+
48+
log::info('And then use the value: '. $value);
49+
50+
51+
}
52+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
class UnitTestImplementation1 extends Implementation
4+
{
5+
6+
7+
public function execute()
8+
{
9+
10+
// $t = RequestHttp::getById('b66b5f6c-ce95-49e3-87eb-c3bf1ddb15a5');
11+
//$s->get();
12+
Log::info('Inside UnitTestImplementation1 execute');
13+
$reqVal = $this->getExecution()->getRequest()->getPayloadArr();
14+
15+
if (su::gis($reqVal['makeBigMistake'])) {
16+
asd();
17+
}
18+
19+
20+
if ($this->getExecution()->getRequest()->getXMLObject()) {
21+
$valx = (string) $this->getExecution()->getRequest()->getXMLObject()->xpath('//item/text()')[0];
22+
} else {
23+
$valx = null;
24+
}
25+
26+
if (su::gis($reqVal['respondsome']) || $this->getExecution()->getRequest()->getXMLObject()) {
27+
28+
29+
$this->getExecution()->setResponseByArray([
30+
'requestId' => $this->getExecution()->getRequest()->getId()->__toString(),
31+
'executionId' => $this->getExecution()->getId()->__toString(),
32+
'thisberespondedcustomstring' => date('c'),
33+
'b' => $this->getExecution()->getRequest()->getPayloadArr(),
34+
'c' => 1,
35+
'xmlitem' => $valx
36+
]);
37+
Log::info('Responded done');
38+
return;
39+
40+
}
41+
42+
if (su::gis($reqVal['sleep1sec'])) {
43+
sleep(1);
44+
Log::info('Sleep done');
45+
}
46+
if (!su::gis($reqVal['abc'])) {
47+
throw new HaltableException('ABC field did not exist in request JSON body');
48+
}
49+
50+
51+
52+
53+
54+
if (su::gis($reqVal['sendMessagesTestRetry'])) {
55+
$br = OutboundHttpRequest::post('[1,3]','sendMessagesTestRetryCategory');
56+
$br->maxRetryTime = 5;
57+
$returnValue = $br->send();
58+
59+
60+
}
61+
62+
63+
64+
65+
66+
}
67+
}

0 commit comments

Comments
 (0)