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