xref: /webtrees/composer.json (revision edf6ae5b0d35e10e7e82da63bf2168c85a8df026)
1{
2    "name": "fisharebest/webtrees",
3    "description": "webtrees online genealogy",
4    "keywords": [
5        "webtrees",
6        "genealogy"
7    ],
8    "license": "GPL-3.0-or-later",
9    "autoload": {
10        "psr-4": {
11            "Fisharebest\\Webtrees\\": "app/"
12        },
13        "files": [
14            "app/Helpers/functions.php"
15        ]
16    },
17    "autoload-dev": {
18        "classmap": [
19            "modules_v4/",
20            "tests/TestCase.php",
21            "tests/MockGlobalFunctions.php"
22        ]
23    },
24    "config": {
25        "platform": {
26            "php": "7.4"
27        },
28        "sort-packages": true,
29        "process-timeout": 3600
30    },
31    "require": {
32        "php": "7.4|8.0",
33        "ext-curl": "*",
34        "ext-gd": "*",
35        "ext-iconv": "*",
36        "ext-intl": "*",
37        "ext-json": "*",
38        "ext-pcre": "*",
39        "ext-pdo": "*",
40        "ext-session": "*",
41        "ext-simplexml": "*",
42        "ext-xml": "*",
43        "ext-zip": "*",
44        "aura/router": "~3.1",
45        "doctrine/dbal": "~3.1",
46        "ezyang/htmlpurifier": "~4.13",
47        "fig/http-message-util": "^1.1",
48        "fisharebest/algorithm": "~1.5",
49        "fisharebest/ext-calendar": "~2.5",
50        "fisharebest/flysystem-chroot-adapter": "~2.0",
51        "fisharebest/localization": "~1.15",
52        "guzzlehttp/guzzle": "~7.3",
53        "illuminate/container": "~8.38",
54        "illuminate/database": "~8.38",
55        "illuminate/support": "~8.38",
56        "intervention/image": "^2.5",
57        "io-developer/php-whois": "~4.0",
58        "league/commonmark": "~1.5",
59        "league/flysystem": "~2.0",
60        "league/flysystem-ziparchive": "~2.0",
61        "middlewares/client-ip": "~2.0",
62        "mlocati/ip-lib": "~1.14",
63        "nesbot/carbon": "~2.46",
64        "nyholm/psr7": "~1.4",
65        "nyholm/psr7-server": "~1.0",
66        "oscarotero/middleland": "~1.0",
67        "psr/cache": "~1.0",
68        "psr/http-message": "~1.0",
69        "psr/http-server-handler": "~1.0",
70        "psr/http-server-middleware": "~1.0",
71        "ramsey/uuid": "~4.1",
72        "sabre/vobject": "~4.3",
73        "swiftmailer/swiftmailer": "~6.2",
74        "symfony/cache": "~5.2",
75        "symfony/expression-language": "~5.2",
76        "symfony/polyfill-mbstring": "~1.22",
77        "symfony/polyfill-php80": "^1.22",
78        "tecnickcom/tcpdf": "^6.4.1"
79    },
80    "require-dev": {
81        "ext-dom": "*",
82        "ext-pdo_sqlite": "*",
83        "ext-sqlite3": "*",
84        "composer/composer": "~2.0",
85        "league/flysystem-memory": "~2.0",
86        "maximebf/debugbar": "~1.16",
87        "php-coveralls/php-coveralls": "~2.4",
88        "phpunit/phpunit": "~9.5"
89    },
90    "suggest": {
91        "ext-imagick": "Required to generate thumbnail images",
92        "ext-pdo_mysql": "Required to use MySQL for database storage",
93        "ext-pdo_sqlite": "Required to use SQLite for database storage",
94        "ext-pdo_pgsql": "Required to use PostgreSQL for database storage",
95        "ext-pdo_sqlsvr": "Required to use SQL Server for database storage",
96        "ext-zlib": "Required to compress HTTP respnses"
97    },
98    "scripts": {
99        "webtrees:build": [
100            "rm -Rf webtrees/",
101            "git archive --prefix=webtrees/ HEAD --format=tar | tar -x",
102            "@composer webtrees:lang",
103            "for FILE in resources/lang/*/messages.php; do cp $FILE webtrees/$FILE; done",
104            "zip --quiet --recurse-paths --move -9 webtrees.zip webtrees"
105        ],
106        "webtrees:pre-commit-hook": [
107            "@composer webtrees:phpcs",
108            "@composer webtrees:phpstan",
109            "@composer webtrees:test"
110        ],
111        "webtrees:check": [
112            "### PHP-CODE-SNIFFER",
113            "@composer webtrees:phpcs",
114            "### PHPSTAN",
115            "@composer webtrees:phpstan",
116            "### PSALM",
117            "@composer webtrees:psalm"
118        ],
119        "webtrees:phpcs": [
120            "@composer global require squizlabs/php_codesniffer=* --quiet",
121            "~/.composer/vendor/bin/phpcs --standard=PSR12 --colors --extensions=php --exclude=Generic.Files.LineLength index.php app modules_v4/example* tests",
122            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
123        ],
124        "webtrees:phpstan": [
125            "@composer global require --quiet phpstan/phpstan=*",
126            "@composer global require --quiet phpstan/extension-installer=*",
127            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
128            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
129            "@composer global require --quiet phpstan/phpstan-phpunit=*",
130            "@composer install --quiet",
131            "~/.composer/vendor/bin/phpstan analyze --level=max app modules_v4/example* index.php",
132            "@composer install --no-dev --quiet"
133        ],
134        "webtrees:psalm": [
135            "@composer global require --quiet vimeo/psalm",
136            "@composer install --quiet",
137            "~/.composer/vendor/bin/psalm",
138            "@composer install --no-dev --quiet"
139        ],
140        "webtrees:test": [
141            "@composer install --quiet",
142            "@php vendor/bin/phpunit",
143            "@composer install --no-dev --quiet"
144        ],
145        "webtrees:coverage": [
146            "@composer install --dev --quiet",
147            "vendor/bin/phpunit --coverage-html=tests/coverage",
148            "@composer install --no-dev --quiet"
149        ],
150        "webtrees:lang": [
151            "Fisharebest\\Webtrees\\Console\\ComposerScripts::languageFiles"
152        ],
153        "webtrees:missing-tests": [
154            "Fisharebest\\Webtrees\\Console\\ComposerScripts::missingTests"
155        ],
156        "webtrees:po": [
157            "sed -i.bak -e 's/\\(I18N::[^)]*[)]\\)/<?php echo \\1; ?>/g' resources/xml/reports/*.xml",
158            "git grep -I --name-only --fixed-strings -e I18N:: -- '*.php' '*.phtml' '*.xml' | xargs xgettext --package-name=webtrees --package-version=1.0 --msgid-bugs-address=i18n@webtrees.net --output=resources/lang/webtrees.pot --no-wrap --language=PHP --add-comments=I18N --from-code=utf-8 --keyword --keyword=translate:1 --keyword=translateContext:1c,2 --keyword=plural:1,2",
159            "find resources/xml/reports/ -name '*.xml' -exec mv {}.bak {} \\;",
160            "find resources/lang -name '*.po' -exec msgmerge --no-wrap --sort-output --no-fuzzy-matching --quiet --output={} {} resources/lang/webtrees.pot \\;"
161        ],
162        "webtrees:png": [
163            "find resources/css -name *.png -exec pngquant --ext .png --force --skip-if-larger --speed 1 {} \\;",
164            "find resources/css -name *.png -exec pngcrush -rem allb -brute -reduce {} {} \\;",
165            "find resources/css -name *.png -exec optipng -o7 -zm1-9 {} \\;"
166        ]
167    },
168    "scripts-descriptions": {
169        "webtrees:build": "Create a distribution file (webtrees.zip)",
170        "webtrees:check": "Run various static analysis tools",
171        "webtrees:coverage": "Generate test coverage report",
172        "webtrees:lang": "Compile the language files (messages.php)",
173        "webtrees:po": "Update the language (webtrees.pot, *.po)"
174    }
175}
176