Skip to content

Commit 70ece9b

Browse files
authored
Merge pull request #2 from netiul/zf3
Added support for zend framework 3
2 parents 7e330ea + 4c49191 commit 70ece9b

12 files changed

Lines changed: 90 additions & 3482 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Composer files
22
composer.phar
3+
composer.lock
34
vendor/
45

56
# Local configs

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: php
22

33
env:
4-
- ZF_VERSION=^2.4
5-
- ZF_VERSION=2.4.*
6-
- ZF_VERSION=2.5.*
4+
- FLAG=
5+
- FLAG=--prefer-lowest
6+
- FLAG=--prefer-stable
77

88
php:
99
- 5.6
1010
- 7.0
1111
- 7.1
1212

1313
before_install:
14-
- composer require --update-with-dependencies zendframework/zend-loader:${ZF_VERSION} zendframework/zend-servicemanager:${ZF_VERSION} zendframework/zend-modulemanager:${ZF_VERSION} zendframework/zend-mvc:${ZF_VERSION} zendframework/zend-view:${ZF_VERSION} zendframework/zend-serializer:${ZF_VERSION} zendframework/zend-log:${ZF_VERSION} zendframework/zend-i18n:${ZF_VERSION} zendframework/zend-http:${ZF_VERSION} zendframework/zend-console:${ZF_VERSION}
14+
- composer update ${FLAG}
1515

1616
script: ./build.sh
1717

Dockerfile

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,30 @@ FROM php:${PHP_VERSION}
44
ENV COMPOSER_HOME=/var/lib/composer
55
WORKDIR /opt/app
66

7-
RUN apt-get update -y && \
8-
apt-get install -y git zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev && \
9-
pecl install xdebug-2.5.0 && \
10-
docker-php-ext-install -j$(nproc) zip gd && \
11-
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
12-
docker-php-ext-enable xdebug && \
13-
php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');" && \
14-
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); exit(1); } echo PHP_EOL;" && \
15-
php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer && \
16-
rm -rf /tmp/composer-setup.php
7+
RUN apt-get update -y \
8+
&& apt-get install -y git zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev \
9+
&& pecl install xdebug-2.5.0 \
10+
&& docker-php-ext-install -j$(nproc) zip gd \
11+
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
12+
&& docker-php-ext-enable xdebug
13+
14+
RUN { \
15+
echo '#!/bin/sh'; \
16+
echo 'EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)"'; \
17+
echo 'php -r "copy('\''https://getcomposer.org/installer'\'', '\''composer-setup.php'\'');"'; \
18+
echo 'ACTUAL_SIGNATURE="$(php -r "echo hash_file('\''sha384'\'', '\''composer-setup.php'\'');")"'; \
19+
echo 'if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then'; \
20+
echo ' >&2 echo '\''ERROR: Invalid installer signature'\'''; \
21+
echo ' rm composer-setup.php'; \
22+
echo ' exit 1'; \
23+
echo 'fi'; \
24+
echo 'php composer-setup.php --quiet --install-dir=/usr/local/bin --filename=composer'; \
25+
echo 'RESULT=$?'; \
26+
echo 'rm composer-setup.php'; \
27+
echo 'exit $RESULT'; \
28+
} | tee /composer-install.sh \
29+
&& chmod +x /composer-install.sh \
30+
&& /composer-install.sh \
31+
&& rm /composer-install.sh
1732

1833
ENTRYPOINT ["./build.sh" ]

README.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@ PHP Composer, please visit the official [PHP Composer site](http://getcomposer.o
1515
#### Installation steps
1616

1717
1. `cd my/project/directory`
18-
2. create a `composer.json` file with following contents:
19-
20-
```json
21-
{
22-
"require": {
23-
"netiul/dompdf-module": "^0.4"
24-
}
25-
}
26-
```
27-
3. install PHP Composer via `curl -s http://getcomposer.org/installer | php` (on windows, download
28-
http://getcomposer.org/installer and execute it with PHP)
29-
4. run `php composer.phar install`
30-
5. open `my/project/directory/config/application.config.php` and add the following key to your `modules`:
18+
2. Add the module to the project by:
19+
20+
composer require netiul/dompdf-module
21+
22+
3. open `my/project/directory/config/application.config.php` and add the following key to your `modules`:
3123

3224
```php
3325
'DOMPDFModule',

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ echo "Verifying source...";
114114
${VENDOR_BIN}/phpcs --standard=PSR2 src
115115
${VENDOR_BIN}/phpcs --standard=PSR2 config
116116
${VENDOR_BIN}/phpcs --standard=PSR2 tests
117-
${VENDOR_BIN}/phpmd config,src,tests text cleancode,codesize,controversial,design,naming,unusedcode
117+
${VENDOR_BIN}/phpmd config,src,tests text cleancode,codesize,controversial,design
118118

119119
# ------------------------------------------------------------------
120120
# Install

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
"keywords": ["pdf","dompdf", "zf2"],
66
"license": "MIT",
77
"authors": [
8-
{
9-
"name": "Zacharias Luiten",
10-
"email": "[email protected]"
11-
},
128
{
139
"name": "Raymond J. Kolbe",
1410
"email": "[email protected]"
@@ -20,9 +16,9 @@
2016
"require": {
2117
"php": ">=5.6",
2218
"zendframework/zend-loader": "^2.4",
23-
"zendframework/zend-servicemanager": "^2.4",
19+
"zendframework/zend-servicemanager": "^2.4 | ^3.0",
2420
"zendframework/zend-modulemanager": "^2.4",
25-
"zendframework/zend-mvc": "^2.4",
21+
"zendframework/zend-eventmanager": "^2.4 | ^3.0",
2622
"zendframework/zend-view": "^2.4",
2723
"zendframework/zend-serializer": "^2.4",
2824
"zendframework/zend-log": "^2.4",
@@ -33,10 +29,13 @@
3329
},
3430
"require-dev": {
3531
"phpunit/phpunit": "^4.8.27",
32+
"zendframework/zend-mvc": "^2.4 | ^3.0",
3633
"codeclimate/php-test-reporter": "^0.3.2",
3734
"fabpot/php-cs-fixer": "^1.12",
3835
"squizlabs/php_codesniffer": "^2.7",
39-
"phpmd/phpmd": "^2.4"
36+
"phpmd/phpmd": "^2.4",
37+
"symfony/dependency-injection": "^3.0",
38+
"symfony/config": "^3.0"
4039
},
4140
"autoload": {
4241
"psr-4": {

0 commit comments

Comments
 (0)