xref: /webtrees/composer.json (revision 5cf3b11faf191d83ec5e7576aa8e8fe3fd2ba15d)
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            "tests/TestCase.php",
20            "tests/MockGlobalFunctions.php"
21        ]
22    },
23    "config": {
24        "platform": {
25            "php": "7.4"
26        },
27        "sort-packages": true,
28        "process-timeout": 3600
29    },
30    "require": {
31        "php": "7.4 - 8.1",
32        "ext-ctype": "*",
33        "ext-curl": "*",
34        "ext-exif": "*",
35        "ext-fileinfo": "*",
36        "ext-gd": "*",
37        "ext-iconv": "*",
38        "ext-intl": "*",
39        "ext-json": "*",
40        "ext-mbstring": "*",
41        "ext-pcre": "*",
42        "ext-pdo": "*",
43        "ext-session": "*",
44        "ext-simplexml": "*",
45        "ext-xml": "*",
46        "aura/router": "3.2.0",
47        "doctrine/dbal": "3.3.6",
48        "ezyang/htmlpurifier": "4.14.0",
49        "fig/http-message-util": "1.1.5",
50        "fisharebest/algorithm": "1.6.0",
51        "fisharebest/ext-calendar": "2.5.0",
52        "fisharebest/flysystem-chroot-adapter": "2.0.0",
53        "fisharebest/localization": "1.15.1",
54        "guzzlehttp/guzzle": "7.4.2",
55        "illuminate/container": "8.83.10",
56        "illuminate/database": "8.83.10",
57        "illuminate/support": "8.83.10",
58        "intervention/image": "2.7.1",
59        "io-developer/php-whois": "4.1.6",
60        "league/commonmark": "2.3.0",
61        "league/flysystem": "2.4.5",
62        "league/flysystem-ziparchive": "2.3.1",
63        "middlewares/client-ip": "2.0.1",
64        "mlocati/ip-lib": "1.18.0",
65        "nesbot/carbon": "2.57.0",
66        "nyholm/psr7": "1.5.0",
67        "nyholm/psr7-server": "1.0.2",
68        "oscarotero/middleland": "1.0.1",
69        "psr/cache": "1.0.1",
70        "psr/http-message": "1.0.1",
71        "psr/http-server-handler": "1.0.1",
72        "psr/http-server-middleware": "1.0.1",
73        "ramsey/uuid": "4.2.3",
74        "sabre/vobject": "4.4.1",
75        "symfony/cache": "5.4.8",
76        "symfony/expression-language": "5.4.8",
77        "symfony/mailer": "5.4.8",
78        "symfony/polyfill-mbstring": "1.25.0",
79        "symfony/polyfill-php80": "1.25.0",
80        "tecnickcom/tcpdf": "6.4.4"
81    },
82    "require-dev": {
83        "ext-dom": "*",
84        "ext-libxml": "*",
85        "ext-pdo_sqlite": "*",
86        "ext-sqlite3": "*",
87        "composer/composer": "2.3.5",
88        "league/flysystem-memory": "2.0.6",
89        "php-coveralls/php-coveralls": "2.5.2",
90        "phpunit/phpunit": "9.5.20"
91    },
92    "suggest": {
93        "ext-imagick": "Required to generate thumbnail images",
94        "ext-pdo_mysql": "Required to use MySQL for database storage",
95        "ext-pdo_sqlite": "Required to use SQLite for database storage",
96        "ext-pdo_pgsql": "Required to use PostgreSQL for database storage",
97        "ext-pdo_sqlsvr": "Required to use SQL Server for database storage",
98        "ext-zip": "Required to compress downloads and use the upgrade wizard",
99        "ext-zlib": "Required to compress HTTP responses"
100    },
101    "scripts": {
102        "webtrees:build": [
103            "rm -Rf webtrees/",
104            "git archive --prefix=webtrees/ HEAD --format=tar | tar -x",
105            "@composer install --no-dev --quiet",
106            "cp -r vendor/ webtrees/vendor/",
107            "@composer webtrees:lang",
108            "for FILE in resources/lang/*/messages.php; do cp $FILE webtrees/$FILE; done",
109            "zip --quiet --recurse-paths --move -9 webtrees-`git describe`.zip webtrees"
110        ],
111        "webtrees:pre-commit-hook": [
112            "@composer webtrees:phpcs",
113            "@composer webtrees:phpstan",
114            "@composer webtrees:test"
115        ],
116        "webtrees:check": [
117            "### PHP-CODE-SNIFFER",
118            "@composer webtrees:phpcs",
119            "### PHPSTAN",
120            "@composer webtrees:phpstan",
121            "### PSALM",
122            "@composer webtrees:psalm"
123        ],
124        "webtrees:phpcs": [
125            "@composer global require squizlabs/php_codesniffer=* --quiet",
126            "~/.composer/vendor/bin/phpcs --standard=PSR12 --colors --extensions=php --exclude=Generic.Files.LineLength index.php app tests",
127            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
128        ],
129        "webtrees:phpstan": [
130            "@composer global require --quiet phpstan/phpstan=*",
131            "@composer global require --quiet phpstan/extension-installer=*",
132            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
133            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
134            "@composer global require --quiet phpstan/phpstan-phpunit=*",
135            "@composer install --quiet",
136            "~/.composer/vendor/bin/phpstan analyze --memory-limit=-1 --level=max index.php app",
137            "@composer install --no-dev --quiet"
138        ],
139        "webtrees:phpstan-baseline": [
140            "@composer global require --quiet phpstan/phpstan=*",
141            "@composer global require --quiet phpstan/extension-installer=*",
142            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
143            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
144            "@composer global require --quiet phpstan/phpstan-phpunit=*",
145            "@composer install --quiet",
146            "~/.composer/vendor/bin/phpstan analyze --level=max --generate-baseline=phpstan-baseline.neon index.php app",
147            "@composer install --no-dev --quiet"
148        ],
149        "webtrees:psalm": [
150            "@composer global require --quiet vimeo/psalm",
151            "@composer install --quiet",
152            "~/.composer/vendor/bin/psalm --threads=8 --php-version=8.1",
153            "@composer install --no-dev --quiet"
154        ],
155        "webtrees:test": [
156            "@composer install --quiet",
157            "@php vendor/bin/phpunit",
158            "@composer install --no-dev --quiet"
159        ],
160        "webtrees:coverage": [
161            "@composer install --dev --quiet",
162            "vendor/bin/phpunit --coverage-html=tests/coverage",
163            "@composer install --no-dev --quiet"
164        ],
165        "webtrees:lang": [
166            "Fisharebest\\Webtrees\\Console\\ComposerScripts::languageFiles"
167        ],
168        "webtrees:missing-tests": [
169            "Fisharebest\\Webtrees\\Console\\ComposerScripts::missingTests"
170        ],
171        "webtrees:po": [
172            "sed -i.bak -e 's/\\(I18N::[^)]*[)]\\)/<?php echo \\1; ?>/g' resources/xml/reports/*.xml",
173            "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",
174            "find resources/xml/reports/ -name '*.xml' -exec mv {}.bak {} \\;",
175            "find resources/lang -name '*.po' -exec msgmerge --no-wrap --sort-output --no-fuzzy-matching --quiet --output={} {} resources/lang/webtrees.pot \\;"
176        ],
177        "webtrees:png": [
178            "find resources/css -name *.png -exec pngquant --ext .png --force --skip-if-larger --speed 1 {} \\;",
179            "find resources/css -name *.png -exec pngcrush -rem allb -brute -reduce {} {} \\;",
180            "find resources/css -name *.png -exec optipng -o7 -zm1-9 {} \\;"
181        ]
182    },
183    "scripts-descriptions": {
184        "webtrees:build": "Create a distribution file (webtrees.zip)",
185        "webtrees:check": "Run various static analysis tools",
186        "webtrees:coverage": "Generate test coverage report",
187        "webtrees:lang": "Compile the language files (messages.php)",
188        "webtrees:po": "Update the language (webtrees.pot, *.po)"
189    }
190}
191