Skip to content

Commit 48ff87a

Browse files
authored
NC22 compliant (#59)
1 parent 395a378 commit 48ff87a

12 files changed

Lines changed: 101 additions & 87 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
matrix:
2121
php-versions: ['8.0']
2222
databases: ['sqlite']
23-
server-versions: ['stable21']
23+
server-versions: ['stable22']
2424

25-
name: php-coverage
25+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-COVERAGE
2626

2727
steps:
2828
- name: Checkout server

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
php-versions: ['7.3', '7.4', '8.0']
2020

21-
name: php-lint-${{ matrix.php-versions }}
21+
name: php${{ matrix.php-versions }}-LINT
2222
steps:
2323
- uses: actions/checkout@v2
2424

@@ -32,14 +32,14 @@ jobs:
3232
run: composer run lint
3333

3434
nc-app-code-check:
35-
name: nc-app-code-check
35+
name: nc-app-code-check-${{ matrix.php-versions }}-${{ matrix.databases }}-CODECHECK
3636
runs-on: ubuntu-20.04
3737

3838
strategy:
3939
matrix:
4040
php-versions: ['8.0']
4141
databases: ['sqlite']
42-
server-versions: ['stable21']
42+
server-versions: ['stable22']
4343

4444
steps:
4545
- name: Checkout server

.github/workflows/phpunit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
php-versions: ['8.0']
2222
databases: ['sqlite']
23-
server-versions: ['stable21']
23+
server-versions: ['stable22']
2424

2525
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
2626

@@ -79,7 +79,7 @@ jobs:
7979
matrix:
8080
php-versions: ['7.3', '7.4', '8.0']
8181
databases: ['mysql']
82-
server-versions: ['stable21']
82+
server-versions: ['stable22']
8383

8484
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
8585

@@ -147,7 +147,7 @@ jobs:
147147
matrix:
148148
php-versions: ['8.0']
149149
databases: ['pgsql']
150-
server-versions: ['stable21']
150+
server-versions: ['stable22']
151151

152152
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
153153

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
"name": "Listen for XDebug",
1010
"type": "php",
1111
"request": "launch",
12-
"port": 9000
12+
"port": 9003
1313
},
1414
{
1515
"name": "Listen for XDebug (CLI)",
1616
"type": "php",
1717
"request": "launch",
18-
"port": 9001
18+
"port": 9003
1919
},
2020
{
2121
"name": "Run cron.php",
2222
"type": "php",
2323
"request": "launch",
2424
"program": "${workspaceRoot}/../../cron.php",
25-
"port": 9001
25+
"port": 9003
2626
},
2727
{
2828
"name": "Debug Unittests",
@@ -31,7 +31,7 @@
3131
"program": "${workspaceRoot}/vendor/phpunit/phpunit/phpunit",
3232
"args": ["-c", "phpunit.xml"],
3333
"cwd": "${workspaceRoot}",
34-
"port": 9001
34+
"port": 9003
3535
},
3636
{
3737
"name": "Debug Integrationtests",
@@ -40,7 +40,7 @@
4040
"program": "${workspaceRoot}/vendor/phpunit/phpunit/phpunit",
4141
"args": ["-c", "phpunit.integration.xml"],
4242
"cwd": "${workspaceRoot}",
43-
"port": 9001
43+
"port": 9003
4444
}
4545
]
4646
}

README.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![codecov](https://codecov.io/gh/R0Wi/workflow_ocr/branch/master/graph/badge.svg)](https://codecov.io/gh/R0Wi/workflow_ocr)
55
![Lint](https://github.com/R0Wi/workflow_ocr/workflows/Lint/badge.svg)
66
[![Generic badge](https://img.shields.io/github/v/release/R0Wi/workflow_ocr)](https://github.com/R0Wi/workflow_ocr/releases)
7-
[![Generic badge](https://img.shields.io/badge/Nextcloud-21-orange)](https://github.com/nextcloud/server)
7+
[![Generic badge](https://img.shields.io/badge/Nextcloud-22-orange)](https://github.com/nextcloud/server)
88

99
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1010
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -21,6 +21,7 @@
2121
- [Development](#development)
2222
- [Dev setup](#dev-setup)
2323
- [Debugging](#debugging)
24+
- [`docker`-based setup](#docker-based-setup)
2425
- [Executing tests](#executing-tests)
2526
- [Adding a new `OcrProcessor`](#adding-a-new-ocrprocessor)
2627
- [Limitations](#limitations)
@@ -84,7 +85,7 @@ To **test** if your file gets processed properly you can do the following steps:
8485
## How it works
8586
### General
8687
<p align="center">
87-
<img width="50%" src="doc/diagramms/general.svg" alt="General diagramm">
88+
<img width="50%" src="doc/diagramms/general.png" alt="General diagramm">
8889
</p>
8990

9091
### PDF
@@ -118,8 +119,8 @@ when being inside of the debug-tab.
118119
<img src="doc/img/debug.jpg" alt="VSCode debug profile">
119120
</p>
120121

121-
To get the debugger profiles working you need to ensure that `XDebug` for `Apache` (or your preferred webserver) is connected to you machine at
122-
port `9000` while `XDebug` for the PHP CLI should be configured to bind to port `9001`. Depending on your system a possible configuration could
122+
To get the debugger profiles working you need to ensure that `XDebug` for `Apache` (or your preferred webserver) and `XDebug` for PHP CLI both connect to your machine at
123+
port `9003`. Depending on your system a possible configuration could
123124
look like this:
124125

125126
```ini
@@ -129,7 +130,7 @@ look like this:
129130
zend_extension=/usr/lib/php/20190902/xdebug.so
130131
xdebug.remote_enable=1
131132
xdebug.remote_host=127.0.0.1
132-
xdebug.remote_port=9001
133+
xdebug.remote_port=9003
133134
xdebug.remote_autostart=1
134135
```
135136

@@ -140,7 +141,7 @@ xdebug.remote_autostart=1
140141
zend_extension=/usr/lib/php/20190902/xdebug.so
141142
xdebug.remote_enable=1
142143
xdebug.remote_host=127.0.0.1
143-
xdebug.remote_port=9000
144+
xdebug.remote_port=9003
144145
xdebug.remote_autostart=1
145146
```
146147

@@ -158,6 +159,55 @@ If you're looking for some good sources on how to setup `VSCode` + `XDebug` we c
158159
* https://tighten.co/blog/configure-vscode-to-debug-phpunit-tests-with-xdebug/
159160
* https://code.visualstudio.com/docs/languages/php
160161

162+
### `docker`-based setup
163+
If you're interested in a `docker`-based setup we can recommend
164+
the images from https://github.com/thecodingmachine/docker-images-php which already come with `Apache` and
165+
`XDebug` installed.
166+
167+
A working `docker-compose.yml`-file could look like this:
168+
```yaml
169+
version: '3'
170+
services:
171+
apache_dev:
172+
restart: always
173+
container_name: apache_dev
174+
image: ${IMAGE}-custom
175+
build:
176+
dockerfile: ./Dockerfile
177+
args:
178+
IMAGE: ${IMAGE}
179+
environment:
180+
- PHP_INI_MEMORY_LIMIT=1g
181+
- PHP_INI_ERROR_REPORTING=E_ALL
182+
- PHP_INI_XDEBUG__START_WITH_REQUEST=yes
183+
- PHP_INI_XDEBUG__LOG_LEVEL=7
184+
- PHP_EXTENSIONS=xdebug gd intl bcmath gmp imagick
185+
volumes:
186+
- ./html:/var/www/html
187+
- ./000-default.conf:/etc/apache2/sites-enabled/000-default.conf
188+
ports:
189+
- 80:80
190+
networks:
191+
- web_dev
192+
```
193+
`IMAGE` could be set to `IMAGE=thecodingmachine/php:7.4-v4-apache-node14` and the content of `Dockerfile` might
194+
look like this:
195+
196+
```dockerfile
197+
ARG IMAGE
198+
FROM $IMAGE
199+
200+
USER root
201+
RUN apt-get update \
202+
&& apt-get install -y make ocrmypdf tesseract-ocr-eng tesseract-ocr-deu smbclient \
203+
&& apt-get clean \
204+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
205+
USER docker
206+
```
207+
> :information_source: Please note that these are just
208+
working snippets which you might have to modify to fit
209+
your needs.
210+
161211
### Executing tests
162212
To execute the implemented PHPUnit tests you can use one of the following commands:
163213

appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<summary>OCR processing via workflow</summary>
77
<description>This app makes it possible to process various files via OCR algorithms.
88
The processing is done via workflow-engine and can therefore easily be customized.</description>
9-
<version>1.21.0</version>
9+
<version>1.22.0</version>
1010
<licence>agpl</licence>
1111
<author mail="ro.windey@gmail.com">Robin Windey</author>
1212
<namespace>WorkflowOcr</namespace>
@@ -22,6 +22,6 @@
2222
<repository type="git">https://github.com/R0Wi/workflow_ocr.git</repository>
2323
<screenshot>https://github.com/R0Wi/workflow_ocr/blob/eb2d65e9610406bbab22c4c8dda1cea015b5c791/doc/img/usage_1.jpg?raw=true</screenshot>
2424
<dependencies>
25-
<nextcloud min-version="21" max-version="21" />
25+
<nextcloud min-version="22" max-version="22" />
2626
</dependencies>
2727
</info>

doc/diagramms/general.drawio

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/diagramms/general.png

26.2 KB
Loading

0 commit comments

Comments
 (0)