Skip to content

Commit 540988a

Browse files
committed
Initial commit based on kiboko/etl
0 parents  commit 540988a

26 files changed

+2386
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
FROM php:7.2-cli-alpine
2+
3+
LABEL maintainer="Grégory Planchat <[email protected]>"
4+
5+
ARG APP_UID=1000
6+
ARG APP_GID=1000
7+
ARG APP_USERNAME=docker
8+
ARG APP_GROUPNAME=docker
9+
10+
RUN set -ex\
11+
&& apk update \
12+
&& apk upgrade \
13+
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
14+
&& apk add \
15+
shadow@testing \
16+
ca-certificates \
17+
wget \
18+
autoconf \
19+
bash \
20+
binutils \
21+
expat \
22+
file \
23+
g++ \
24+
gcc \
25+
m4 \
26+
make \
27+
git \
28+
nodejs \
29+
npm \
30+
&& update-ca-certificates
31+
32+
RUN docker-php-ext-install opcache
33+
34+
RUN apk add --update zlib-dev \
35+
&& docker-php-ext-configure zip \
36+
&& docker-php-ext-install zip \
37+
&& apk del zlib-dev
38+
39+
RUN apk add --update libxml2-dev \
40+
&& docker-php-ext-configure soap \
41+
&& docker-php-ext-install soap \
42+
&& apk del libxml2-dev
43+
44+
RUN apk add --update libpng-dev libjpeg-turbo-dev freetype-dev freetype libpng libjpeg-turbo \
45+
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
46+
&& docker-php-ext-install gd \
47+
&& apk del libpng-dev libjpeg-turbo-dev freetype-dev
48+
49+
RUN apk add --update icu-dev icu \
50+
&& docker-php-ext-configure intl \
51+
&& docker-php-ext-install intl \
52+
&& apk del icu-dev
53+
54+
RUN apk add --update postgresql-dev \
55+
&& docker-php-ext-configure pdo_pgsql \
56+
&& docker-php-ext-install pdo_pgsql \
57+
&& apk del postgresql-libs
58+
59+
RUN docker-php-ext-configure bcmath \
60+
&& docker-php-ext-install bcmath
61+
62+
RUN apk add tidyhtml \
63+
&& apk add --update tidyhtml-dev \
64+
&& docker-php-ext-configure tidy \
65+
&& docker-php-ext-install tidy \
66+
&& apk del tidyhtml-dev
67+
68+
RUN apk add c-client \
69+
&& apk add --update krb5-dev imap-dev \
70+
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
71+
&& docker-php-ext-install imap \
72+
&& apk del krb5-dev imap-dev
73+
74+
RUN apk add openldap \
75+
&& apk add --update openldap-dev \
76+
&& docker-php-ext-configure ldap --with-ldap \
77+
&& docker-php-ext-install ldap \
78+
&& apk del openldap-dev
79+
80+
RUN docker-php-source extract \
81+
&& pecl install xdebug-2.6.1 \
82+
&& docker-php-ext-enable xdebug \
83+
&& docker-php-source delete
84+
85+
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
86+
87+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
88+
89+
RUN apk del \
90+
autoconf \
91+
bash \
92+
binutils \
93+
expat \
94+
file \
95+
g++ \
96+
gcc \
97+
gdbm \
98+
gmp \
99+
isl \
100+
libatomic \
101+
libbz2 \
102+
libc-dev \
103+
libffi \
104+
libgcc \
105+
libgomp \
106+
libldap \
107+
libltdl \
108+
libmagic \
109+
libstdc++ \
110+
libtool \
111+
m4 \
112+
make \
113+
mpc1 \
114+
mpfr3 \
115+
musl-dev \
116+
perl \
117+
pkgconf \
118+
pkgconfig \
119+
python \
120+
re2c \
121+
readline \
122+
sqlite-libs \
123+
&& rm -rf /tmp/* /var/cache/apk/*
124+
125+
RUN addgroup -g ${APP_GID} ${APP_USERNAME} \
126+
&& adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME}
127+
128+
COPY config/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
129+
COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini
130+
131+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
132+
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
133+
&& php composer-setup.php --install-dir /usr/local/bin --filename composer\
134+
&& php -r "unlink('composer-setup.php');"
135+
136+
RUN mkdir -p /opt/docker/.npm \
137+
&& chown docker:docker /opt/docker/.npm
138+
139+
WORKDIR /var/www/html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit=-1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[xdebug]
2+
xdebug.max_nesting_level=2048
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
FROM php:7.2-cli-alpine
2+
3+
LABEL maintainer="Grégory Planchat <[email protected]>"
4+
5+
ARG APP_UID=1000
6+
ARG APP_GID=1000
7+
ARG APP_USERNAME=docker
8+
ARG APP_GROUPNAME=docker
9+
10+
RUN set -ex\
11+
&& apk update \
12+
&& apk upgrade \
13+
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
14+
&& apk add \
15+
shadow@testing \
16+
ca-certificates \
17+
wget \
18+
autoconf \
19+
bash \
20+
binutils \
21+
expat \
22+
file \
23+
g++ \
24+
gcc \
25+
m4 \
26+
make \
27+
git \
28+
nodejs \
29+
npm \
30+
&& update-ca-certificates
31+
32+
RUN docker-php-ext-install opcache
33+
34+
RUN apk add --update zlib-dev \
35+
&& docker-php-ext-configure zip \
36+
&& docker-php-ext-install zip \
37+
&& apk del zlib-dev
38+
39+
RUN apk add --update libxml2-dev \
40+
&& docker-php-ext-configure soap \
41+
&& docker-php-ext-install soap \
42+
&& apk del libxml2-dev
43+
44+
RUN apk add --update libpng-dev libjpeg-turbo-dev freetype-dev freetype libpng libjpeg-turbo \
45+
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
46+
&& docker-php-ext-install gd \
47+
&& apk del libpng-dev libjpeg-turbo-dev freetype-dev
48+
49+
RUN apk add --update icu-dev icu \
50+
&& docker-php-ext-configure intl \
51+
&& docker-php-ext-install intl \
52+
&& apk del icu-dev
53+
54+
RUN apk add --update postgresql-dev \
55+
&& docker-php-ext-configure pdo_pgsql \
56+
&& docker-php-ext-install pdo_pgsql \
57+
&& apk del postgresql-libs
58+
59+
RUN docker-php-ext-configure bcmath \
60+
&& docker-php-ext-install bcmath
61+
62+
RUN apk add tidyhtml \
63+
&& apk add --update tidyhtml-dev \
64+
&& docker-php-ext-configure tidy \
65+
&& docker-php-ext-install tidy \
66+
&& apk del tidyhtml-dev
67+
68+
RUN apk add c-client \
69+
&& apk add --update krb5-dev imap-dev \
70+
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
71+
&& docker-php-ext-install imap \
72+
&& apk del krb5-dev imap-dev
73+
74+
RUN apk add openldap \
75+
&& apk add --update openldap-dev \
76+
&& docker-php-ext-configure ldap --with-ldap \
77+
&& docker-php-ext-install ldap \
78+
&& apk del openldap-dev
79+
80+
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
81+
82+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
83+
84+
RUN apk del \
85+
autoconf \
86+
bash \
87+
binutils \
88+
expat \
89+
file \
90+
g++ \
91+
gcc \
92+
gdbm \
93+
gmp \
94+
isl \
95+
libatomic \
96+
libbz2 \
97+
libc-dev \
98+
libffi \
99+
libgcc \
100+
libgomp \
101+
libldap \
102+
libltdl \
103+
libmagic \
104+
libstdc++ \
105+
libtool \
106+
m4 \
107+
make \
108+
mpc1 \
109+
mpfr3 \
110+
musl-dev \
111+
perl \
112+
pkgconf \
113+
pkgconfig \
114+
python \
115+
re2c \
116+
readline \
117+
sqlite-libs \
118+
&& rm -rf /tmp/* /var/cache/apk/*
119+
120+
RUN addgroup -g ${APP_GID} ${APP_USERNAME} \
121+
&& adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME}
122+
123+
COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini
124+
125+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
126+
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
127+
&& php composer-setup.php --install-dir /usr/local/bin --filename composer\
128+
&& php -r "unlink('composer-setup.php');"
129+
130+
RUN mkdir -p /opt/docker/.npm \
131+
&& chown docker:docker /opt/docker/.npm
132+
133+
WORKDIR /var/www/html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit=-1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
vendor/

.phpspec.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
suites:
2+
acme_suite:
3+
namespace: Kiboko\Component\ETL\Bucket
4+
psr4_prefix: Kiboko\Component\ETL\Bucket
5+
src_path: '%paths.config%'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace Kiboko\Component\ETL\Bucket;
4+
5+
use Kiboko\Component\ETL\Contracts\AcceptanceResultBucketInterface;
6+
7+
final class AcceptanceAppendableResultBucket implements AcceptanceResultBucketInterface
8+
{
9+
/**
10+
* @var \Iterator
11+
*/
12+
private $iterator;
13+
14+
/**
15+
* @param \Iterator ...$iterators
16+
*/
17+
public function __construct(\Iterator ...$iterators)
18+
{
19+
$this->iterator = new \AppendIterator();
20+
foreach ($iterators as $iterator){
21+
$this->iterator->append($iterator);
22+
}
23+
}
24+
25+
/**
26+
* @param \Iterator ...$iterators
27+
*/
28+
public function append(\Iterator ...$iterators)
29+
{
30+
foreach ($iterators as $iterator){
31+
$this->iterator->append($iterator);
32+
}
33+
}
34+
35+
public function walkAcceptance(): iterable
36+
{
37+
return $this->iterator;
38+
}
39+
}

AcceptanceIteratorResultBucket.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Kiboko\Component\ETL\Bucket;
4+
5+
use Kiboko\Component\ETL\Contracts\AcceptanceResultBucketInterface;
6+
7+
final class AcceptanceIteratorResultBucket implements AcceptanceResultBucketInterface
8+
{
9+
/**
10+
* @var \Iterator
11+
*/
12+
private $iterator;
13+
14+
/**
15+
* @param \Iterator $iterator
16+
*/
17+
public function __construct(\Iterator $iterator)
18+
{
19+
$this->iterator = $iterator;
20+
}
21+
22+
public function walkAcceptance(): iterable
23+
{
24+
return $this->iterator;
25+
}
26+
}

AcceptanceResultBucket.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Kiboko\Component\ETL\Bucket;
4+
5+
use Kiboko\Component\ETL\Contracts\AcceptanceResultBucketInterface;
6+
7+
final class AcceptanceResultBucket implements AcceptanceResultBucketInterface
8+
{
9+
/**
10+
* @var array
11+
*/
12+
private $values;
13+
14+
/**
15+
* @param mixed[] $values
16+
*/
17+
public function __construct(...$values)
18+
{
19+
$this->values = $values;
20+
}
21+
22+
public function walkAcceptance(): iterable
23+
{
24+
return new \ArrayIterator($this->values);
25+
}
26+
}

0 commit comments

Comments
 (0)