xref: /webtrees/composer.json (revision 3ddb2c3f1b75331c0af6be131557ffc6c3bfb468)
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        "ext-zip": "*",
47        "aura/router": "3.2.0",
48        "doctrine/dbal": "3.3.4",
49        "ezyang/htmlpurifier": "4.14.0",
50        "fig/http-message-util": "1.1.5",
51        "fisharebest/algorithm": "1.6.0",
52        "fisharebest/ext-calendar": "2.5.0",
53        "fisharebest/flysystem-chroot-adapter": "2.0.0",
54        "fisharebest/localization": "1.15.1",
55        "guzzlehttp/guzzle": "7.4.2",
56        "illuminate/container": "8.83.5",
57        "illuminate/database": "8.83.5",
58        "illuminate/support": "8.83.5",
59        "intervention/image": "2.7.1",
60        "io-developer/php-whois": "4.1.6",
61        "league/commonmark": "2.2.3",
62        "league/flysystem": "2.4.3",
63        "league/flysystem-ziparchive": "2.3.1",
64        "middlewares/client-ip": "2.0.1",
65        "mlocati/ip-lib": "1.18.0",
66        "nesbot/carbon": "2.57.0",
67        "nyholm/psr7": "1.5.0",
68        "nyholm/psr7-server": "1.0.2",
69        "oscarotero/middleland": "1.0.1",
70        "psr/cache": "1.0.1",
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.2.3",
75        "sabre/vobject": "4.4.1",
76        "symfony/cache": "5.4.6",
77        "symfony/expression-language": "5.4.3",
78        "symfony/mailer": "5.4.5",
79        "symfony/polyfill-mbstring": "1.25.0",
80        "symfony/polyfill-php80": "1.25.0",
81        "tecnickcom/tcpdf": "6.4.4"
82    },
83    "require-dev": {
84        "ext-dom": "*",
85        "ext-libxml": "*",
86        "ext-pdo_sqlite": "*",
87        "ext-sqlite3": "*",
88        "composer/composer": "2.2.9",
89        "league/flysystem-memory": "2.0.6",
90        "php-coveralls/php-coveralls": "2.5.2",
91        "phpunit/phpunit": "9.5.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_sqlsvr": "Required to use SQL Server for database storage",
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=1G --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