xref: /webtrees/composer.json (revision 7365d67fe089b7407541363f6d8962e90d58fa40)
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.2.0"
27        },
28        "sort-packages": true,
29        "process-timeout": 3600
30    },
31    "require": {
32        "php": "8.2 - 8.4",
33        "ext-ctype": "*",
34        "ext-curl": "*",
35        "ext-gd": "*",
36        "ext-iconv": "*",
37        "ext-intl": "*",
38        "ext-json": "*",
39        "ext-mbstring": "*",
40        "ext-pcre": "*",
41        "ext-pdo": "*",
42        "ext-session": "*",
43        "ext-xml": "*",
44        "aura/router": "3.3.0",
45        "ezyang/htmlpurifier": "4.17.0",
46        "fig/http-message-util": "1.1.5",
47        "fisharebest/algorithm": "1.6.0",
48        "fisharebest/ext-calendar": "2.6.0",
49        "fisharebest/localization": "1.17.0",
50        "guzzlehttp/guzzle": "7.8.1",
51        "illuminate/database": "11.14.0",
52        "illuminate/support": "11.14.0",
53        "intervention/image": "3.7.2",
54        "io-developer/php-whois": "4.1.10",
55        "league/commonmark": "2.4.2",
56        "league/flysystem": "3.28.0",
57        "league/flysystem-path-prefixing": "3.28.0",
58        "league/flysystem-ziparchive": "3.28.0",
59        "middlewares/client-ip": "2.0.1",
60        "mlocati/ip-lib": "1.18.0",
61        "nesbot/carbon": "3.6.0",
62        "nyholm/psr7": "1.8.1",
63        "nyholm/psr7-server": "1.1.0",
64        "oscarotero/middleland": "1.0.1",
65        "psr/cache": "3.0.0",
66        "psr/http-message": "1.1",
67        "psr/http-server-handler": "1.0.2",
68        "psr/http-server-middleware": "1.0.2",
69        "ramsey/uuid": "4.7.6",
70        "sabre/vobject": "4.5.5",
71        "symfony/cache": "7.1.2",
72        "symfony/console": "7.1.2",
73        "symfony/expression-language": "7.1.1",
74        "symfony/mailer": "7.1.2",
75        "symfony/polyfill-mbstring": "1.30.0",
76        "tecnickcom/tcpdf": "6.7.5"
77    },
78    "require-dev": {
79        "ext-dom": "*",
80        "ext-libxml": "*",
81        "ext-pdo_sqlite": "*",
82        "ext-sqlite3": "*",
83        "league/flysystem-memory": "3.28.0",
84        "php-coveralls/php-coveralls": "2.7.0",
85        "phpunit/phpunit": "11.2.6"
86    },
87    "suggest": {
88        "ext-imagick": "Required to generate thumbnail images",
89        "ext-pdo_mysql": "Required to use MySQL for database storage",
90        "ext-pdo_sqlite": "Required to use SQLite for database storage",
91        "ext-pdo_pgsql": "Required to use PostgreSQL for database storage",
92        "ext-pdo_sqlsrv": "Required to use SQL Server for database storage",
93        "ext-zip": "Required to compress downloads and use the upgrade wizard",
94        "ext-zlib": "Required to compress HTTP responses"
95    },
96    "scripts": {
97        "webtrees:build": [
98            "rm -Rf webtrees/",
99            "git archive --prefix=webtrees/ HEAD --format=tar | tar -x",
100            "@composer install --no-dev --quiet",
101            "cp -r vendor/ webtrees/vendor/",
102            "php index.php compile-po-files",
103            "for FILE in resources/lang/*/messages.php; do cp $FILE webtrees/$FILE; done",
104            "zip --quiet --recurse-paths --move -9 webtrees-`git describe`.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 --colors --extensions=php   --standard=PSR12 --exclude=Generic.Files.LineLength index.php app tests",
122            "#~/.composer/vendor/bin/phpcs --colors --extensions=phtml --standard=PSR12 --exclude=Generic.Files.LineLength resources/views",
123            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
124        ],
125        "webtrees:phpstan": [
126            "@composer global require --quiet phpstan/phpstan=* phpstan/extension-installer=* phpstan/phpstan-deprecation-rules=* phpstan/phpstan-strict-rules=* phpstan/phpstan-phpunit=*",
127            "@composer install --quiet",
128            "~/.composer/vendor/bin/phpstan analyze --memory-limit=-1",
129            "@composer install --no-dev --quiet"
130        ],
131        "webtrees:phpstan-baseline": [
132            "@composer global require --quiet phpstan/phpstan=* phpstan/extension-installer=* phpstan/phpstan-deprecation-rules=* phpstan/phpstan-strict-rules=* phpstan/phpstan-phpunit=*",
133            "@composer install --quiet",
134            "~/.composer/vendor/bin/phpstan analyze --memory-limit=-1 --level=max --generate-baseline=phpstan-baseline.php",
135						"sed -i -e 's/\\t/    /' phpstan-baseline.php",
136						"sed -i -e 's/ declare(strict_types = 1)/\\n\\ndeclare(strict_types=1)/' phpstan-baseline.php",
137            "@composer install --no-dev --quiet"
138        ],
139        "webtrees:psalm": [
140            "@composer global require --quiet vimeo/psalm",
141            "@composer install --quiet",
142            "~/.composer/vendor/bin/psalm --threads=8 --php-version=8.1",
143            "@composer install --no-dev --quiet"
144        ],
145        "webtrees:test": [
146            "@composer install --quiet",
147            "@php vendor/bin/phpunit",
148            "@composer install --no-dev --quiet"
149        ],
150        "webtrees:coverage": [
151            "@composer install --dev --quiet",
152            "vendor/bin/phpunit --coverage-html=tests/coverage",
153            "@composer install --no-dev --quiet"
154        ],
155        "webtrees:po": [
156            "sed -i.bak -e 's/\\(I18N::[^)]*[)]\\)/<?php echo \\1; ?>/g' resources/xml/reports/*.xml",
157            "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",
158            "find resources/xml/reports/ -name '*.xml' -exec mv {}.bak {} \\;",
159            "find resources/lang -name '*.po' -exec msgmerge --no-wrap --sort-output --no-fuzzy-matching --quiet --output={} {} resources/lang/webtrees.pot \\;"
160        ],
161        "webtrees:png": [
162            "find resources/css -name *.png -exec pngquant --ext .png --force --skip-if-larger --speed 1 {} \\;",
163            "find resources/css -name *.png -exec pngcrush -rem allb -brute -reduce {} {} \\;",
164            "find resources/css -name *.png -exec optipng -o7 -zm1-9 {} \\;"
165        ],
166        "ci" : [
167            "@composer validate",
168            "@composer install --quiet",
169            "@composer webtrees:test",
170            "@composer webtrees:phpcs",
171            "@composer webtrees:phpstan"
172        ]
173    },
174    "scripts-descriptions": {
175        "webtrees:build": "Create a distribution file (webtrees.zip)",
176        "webtrees:check": "Run various static analysis tools",
177        "webtrees:coverage": "Generate test coverage report",
178        "webtrees:lang": "Compile the language files (messages.php)",
179        "webtrees:po": "Update the language (webtrees.pot, *.po)"
180    }
181}
182