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