Skip to content

Commit 03931a2

Browse files
authored
Merge pull request #24 from wmde/extract-interface
Modularize code and update dependencies
2 parents 1992c89 + 7e55e67 commit 03931a2

15 files changed

+712
-1085
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
22
/vendor/
3-
.phpunit.result.cache
3+
.phpunit.result.cache
4+
.phpunit.cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: php
33
matrix:
44
fast_finish: true
55
include:
6-
- php: 8.0
6+
- php: 8.1
77

88
sudo: false
99

README.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# fundraising-content-provider
22

3-
[![Build Status](https://travis-ci.org/wmde/fundraising-content-provider.svg?branch=master)](https://travis-ci.org/wmde/fundraising-content-provider)
4-
53
A wrapper around [htmlpurifier](http://htmlpurifier.org) and [twig](https://github.com/twigphp/Twig)
64
to purify [fundraising-frontend-content](https://github.com/wmde/fundraising-frontend-content) content
75
before rendering it into [FundraisingFrontend](https://github.com/wmde/FundraisingFrontend/).
86

97
# Using fundraising-frontend-content inside FundraisingFrontend
108

11-
$contentProvider = new ContentProvider( ['content_path' => '/my/fundraising-frontend-content'] );
12-
// contents of fundraising-frontend-content/web & fundraising-frontend-content/shared
9+
$contentProvider = TwigContentProviderFactory::createContentProvider(
10+
new TwigContentProviderConfig( '/my/fundraising-frontend-content/i18n/LOCALE/' )
11+
);
12+
13+
// get contents of fundraising-frontend-content/web & fundraising-frontend-content/shared
1314
$contentProvider->getWeb('template_name');
14-
// contents of fundraising-frontend-content/mail & fundraising-frontend-content/shared
15+
16+
// get contents of fundraising-frontend-content/mail & fundraising-frontend-content/shared
1517
$contentProvider->getMail('template_name');
1618

1719
# Running lints
@@ -26,23 +28,10 @@ before rendering it into [FundraisingFrontend](https://github.com/wmde/Fundraisi
2628

2729
# Development
2830

29-
## Run phpunit tests
31+
## Run PHPUnit tests
3032

3133
docker run -it --rm --user $(id -u):$(id -g) -v "$PWD":/app -w /app
3234
php:8.0-alpine ./vendor/bin/phpunit
3335

3436
(you have to have docker installed for this to work)
3537

36-
# Release notes
37-
38-
## Version 2.0 (2017-04-28)
39-
40-
* Content is no longer purified when loading it (purifying broke twig templates)
41-
* renamed linter & added twig syntax checks
42-
* Also allowing the following HTML tags: `hr`, `u`
43-
* Also allowing `target="_blank"` attribute links (`a`)
44-
45-
## Version 1.0 (2017-04-26)
46-
47-
* Initial Release
48-
* Providing a service that loads and purifies (some paths) templates, returns content

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "wmde/fundraising-content-provider",
33
"description": "WMDE fundraising application content provider and filter",
4-
"license": "GPL-2.0+",
4+
"license": "GPL-2.0-or-later",
55
"require": {
6-
"php": ">=8.0",
6+
"php": ">=8.1",
77
"ezyang/htmlpurifier": "^4.9",
8-
"twig/twig": "~3.0",
8+
"twig/twig": "~3.4",
99
"symfony/console": "^5.4 || ^6.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "~9.5",
13-
"wmde/fundraising-phpcs": "~5.0",
12+
"phpunit/phpunit": "~10.0",
13+
"wmde/fundraising-phpcs": "~7.0",
1414
"mikey179/vfsstream": "^1.6"
1515
},
1616
"repositories": [

0 commit comments

Comments
 (0)