xref: /webtrees/composer.json (revision 8634febf6487fcb3ee7b59e88f828071a22cba22)
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": "8.1.0"
26        },
27        "sort-packages": true,
28        "process-timeout": 3600
29    },
30    "require": {
31        "php": "8.1 - 8.2",
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.5.2",
48        "ezyang/htmlpurifier": "4.16.0",
49        "fig/http-message-util": "1.1.5",
50        "fisharebest/algorithm": "1.6.0",
51        "fisharebest/ext-calendar": "2.6.0",
52        "fisharebest/flysystem-chroot-adapter": "3.0.0",
53        "fisharebest/localization": "1.17.0",
54        "guzzlehttp/guzzle": "7.5.0",
55        "illuminate/container": "9.46.0",
56        "illuminate/database": "9.46.0",
57        "illuminate/support": "9.46.0",
58        "intervention/image": "2.7.2",
59        "io-developer/php-whois": "4.1.7",
60        "league/commonmark": "2.3.8",
61        "league/flysystem": "3.12.1",
62        "league/flysystem-path-prefixing": "3.10.4",
63        "league/flysystem-ziparchive": "3.12.0",
64        "middlewares/client-ip": "2.0.1",
65        "mlocati/ip-lib": "1.18.0",
66        "nesbot/carbon": "2.65.0",
67        "nyholm/psr7": "1.5.1",
68        "nyholm/psr7-server": "1.0.2",
69        "oscarotero/middleland": "1.0.1",
70        "psr/cache": "3.0.0",
71        "psr/http-message": "1.0.1",
72        "psr/http-server-handler": "1.0.1",
73        "psr/http-server-middleware": "1.0.1",
74        "ramsey/uuid": "4.7.1",
75        "sabre/vobject": "4.5.1",
76        "symfony/cache": "6.2.4",
77        "symfony/expression-language": "6.2.2",
78        "symfony/mailer": "6.2.2",
79        "symfony/polyfill-mbstring": "1.27.0",
80        "tecnickcom/tcpdf": "6.6.2"
81    },
82    "require-dev": {
83        "ext-dom": "*",
84        "ext-libxml": "*",
85        "ext-pdo_sqlite": "*",
86        "ext-sqlite3": "*",
87        "composer/composer": "2.5.1",
88        "league/flysystem-memory": "3.10.3",
89        "php-coveralls/php-coveralls": "2.5.3",
90        "phpunit/phpunit": "9.5.27"
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_sqlsrv": "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 --colors --extensions=php   --standard=PSR12 --exclude=Generic.Files.LineLength index.php app tests",
127            "#~/.composer/vendor/bin/phpcs --colors --extensions=phtml --standard=PSR12 --exclude=Generic.Files.LineLength resources/views",
128            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
129        ],
130        "webtrees:phpstan": [
131            "@composer global require --quiet phpstan/phpstan=*",
132            "@composer global require --quiet phpstan/extension-installer=*",
133            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
134            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
135            "@composer global require --quiet phpstan/phpstan-phpunit=*",
136            "@composer install --quiet",
137            "~/.composer/vendor/bin/phpstan analyze --memory-limit=-1 --xdebug --level=max index.php app",
138            "@composer install --no-dev --quiet"
139        ],
140        "webtrees:phpstan-baseline": [
141            "@composer global require --quiet phpstan/phpstan=*",
142            "@composer global require --quiet phpstan/extension-installer=*",
143            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
144            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
145            "@composer global require --quiet phpstan/phpstan-phpunit=*",
146            "@composer install --quiet",
147            "~/.composer/vendor/bin/phpstan analyze --level=max --generate-baseline=phpstan-baseline.neon index.php app",
148            "@composer install --no-dev --quiet"
149        ],
150        "webtrees:psalm": [
151            "@composer global require --quiet vimeo/psalm",
152            "@composer install --quiet",
153            "~/.composer/vendor/bin/psalm --threads=8 --php-version=8.1",
154            "@composer install --no-dev --quiet"
155        ],
156        "webtrees:test": [
157            "@composer install --quiet",
158            "@php vendor/bin/phpunit",
159            "@composer install --no-dev --quiet"
160        ],
161        "webtrees:coverage": [
162            "@composer install --dev --quiet",
163            "vendor/bin/phpunit --coverage-html=tests/coverage",
164            "@composer install --no-dev --quiet"
165        ],
166        "webtrees:lang": [
167            "Fisharebest\\Webtrees\\Console\\ComposerScripts::languageFiles"
168        ],
169        "webtrees:po": [
170            "sed -i.bak -e 's/\\(I18N::[^)]*[)]\\)/<?php echo \\1; ?>/g' resources/xml/reports/*.xml",
171            "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",
172            "find resources/xml/reports/ -name '*.xml' -exec mv {}.bak {} \\;",
173            "find resources/lang -name '*.po' -exec msgmerge --no-wrap --sort-output --no-fuzzy-matching --quiet --output={} {} resources/lang/webtrees.pot \\;"
174        ],
175        "webtrees:png": [
176            "find resources/css -name *.png -exec pngquant --ext .png --force --skip-if-larger --speed 1 {} \\;",
177            "find resources/css -name *.png -exec pngcrush -rem allb -brute -reduce {} {} \\;",
178            "find resources/css -name *.png -exec optipng -o7 -zm1-9 {} \\;"
179        ]
180    },
181    "scripts-descriptions": {
182        "webtrees:build": "Create a distribution file (webtrees.zip)",
183        "webtrees:check": "Run various static analysis tools",
184        "webtrees:coverage": "Generate test coverage report",
185        "webtrees:lang": "Compile the language files (messages.php)",
186        "webtrees:po": "Update the language (webtrees.pot, *.po)"
187    }
188}
189