xref: /webtrees/composer.json (revision 354a9dba5390121e4a1e00e10c580c5313773f45)
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            "modules_v4/",
20            "tests/TestCase.php",
21            "tests/MockGlobalFunctions.php"
22        ]
23    },
24    "config": {
25        "platform": {
26            "php": "7.4"
27        },
28        "sort-packages": true,
29        "process-timeout": 3600
30    },
31    "require": {
32        "ext-curl": "*",
33        "ext-gd": "*",
34        "ext-iconv": "*",
35        "ext-intl": "*",
36        "ext-json": "*",
37        "ext-pcre": "*",
38        "ext-pdo": "*",
39        "ext-session": "*",
40        "ext-simplexml": "*",
41        "ext-xml": "*",
42        "ext-zip": "*",
43        "aura/router": "~3.1",
44        "doctrine/dbal": "~3.0",
45        "ezyang/htmlpurifier": "~4.13",
46        "fig/http-message-util": "^1.1",
47        "fisharebest/algorithm": "~1.5",
48        "fisharebest/ext-calendar": "~2.5",
49        "fisharebest/flysystem-chroot-adapter": "~2.0",
50        "fisharebest/localization": "~1.15",
51        "guzzlehttp/guzzle": "~7.3",
52        "illuminate/container": "~8.36",
53        "illuminate/database": "~8.36",
54        "illuminate/support": "~8.36",
55        "intervention/image": "^2.5",
56        "io-developer/php-whois": "~4.0",
57        "league/commonmark": "~1.5",
58        "league/flysystem": "~2.0",
59        "league/flysystem-ziparchive": "~2.0",
60        "middlewares/client-ip": "~2.0",
61        "mlocati/ip-lib": "~1.14",
62        "nesbot/carbon": "~2.46",
63        "nyholm/psr7": "~1.4",
64        "nyholm/psr7-server": "~1.0",
65        "oscarotero/middleland": "~1.0",
66        "psr/cache": "~1.0",
67        "psr/http-message": "~1.0",
68        "psr/http-server-handler": "~1.0",
69        "psr/http-server-middleware": "~1.0",
70        "ramsey/uuid": "~4.1",
71        "sabre/vobject": "~4.3",
72        "swiftmailer/swiftmailer": "~6.2",
73        "symfony/cache": "~5.2",
74        "symfony/expression-language": "~5.2",
75        "symfony/polyfill-mbstring": "~1.22",
76        "symfony/polyfill-php80": "^1.22",
77        "tecnickcom/tcpdf": "^6.4.1"
78    },
79    "require-dev": {
80        "ext-dom": "*",
81        "ext-pdo_sqlite": "*",
82        "ext-sqlite3": "*",
83        "composer/composer": "~2.0",
84        "league/flysystem-memory": "~2.0",
85        "maximebf/debugbar": "~1.16",
86        "php-coveralls/php-coveralls": "~2.2",
87        "phpunit/phpunit": "~9.5"
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_sqlsvr": "Required to use SQL Server for database storage",
95        "ext-zlib": "Required to compress HTTP respnses"
96    },
97    "scripts": {
98        "webtrees:build": [
99            "rm -Rf webtrees/",
100            "git archive --prefix=webtrees/ HEAD --format=tar | tar -x",
101            "@composer webtrees:lang",
102            "for FILE in resources/lang/*/messages.php; do cp $FILE webtrees/$FILE; done",
103            "zip --quiet --recurse-paths --move -9 webtrees.zip webtrees"
104        ],
105        "webtrees:pre-commit-hook": [
106            "@composer webtrees:phpcs",
107            "@composer webtrees:phpstan",
108            "@composer webtrees:test"
109        ],
110        "webtrees:check": [
111            "### PHP-CODE-SNIFFER",
112            "@composer webtrees:phpcs",
113            "### PHPSTAN",
114            "@composer webtrees:phpstan",
115            "### PSALM",
116            "@composer webtrees:psalm"
117        ],
118        "webtrees:phpcs": [
119            "@composer global require squizlabs/php_codesniffer=* --quiet",
120            "~/.composer/vendor/bin/phpcs --standard=PSR12 --colors --extensions=php --exclude=Generic.Files.LineLength index.php app modules_v4/example* tests",
121            "~/.composer/vendor/bin/phpcs --colors --extensions=css resources/css"
122        ],
123        "webtrees:phpstan": [
124            "@composer global require --quiet phpstan/phpstan=*",
125            "@composer global require --quiet phpstan/extension-installer=*",
126            "@composer global require --quiet phpstan/phpstan-deprecation-rules=*",
127            "@composer global require --quiet phpstan/phpstan-strict-rules=*",
128            "@composer global require --quiet phpstan/phpstan-phpunit=*",
129            "@composer install --quiet",
130            "~/.composer/vendor/bin/phpstan analyze --level=max app modules_v4/example* index.php",
131            "@composer install --no-dev --quiet"
132        ],
133        "webtrees:psalm": [
134            "@composer global require --quiet vimeo/psalm",
135            "@composer install --quiet",
136            "~/.composer/vendor/bin/psalm",
137            "@composer install --no-dev --quiet"
138        ],
139        "webtrees:test": [
140            "@composer install --quiet",
141            "@php vendor/bin/phpunit",
142            "@composer install --no-dev --quiet"
143        ],
144        "webtrees:coverage": [
145            "@composer install --dev --quiet",
146            "vendor/bin/phpunit --coverage-html=tests/coverage",
147            "@composer install --no-dev --quiet"
148        ],
149        "webtrees:lang": [
150            "Fisharebest\\Webtrees\\Console\\ComposerScripts::languageFiles"
151        ],
152        "webtrees:missing-tests": [
153            "Fisharebest\\Webtrees\\Console\\ComposerScripts::missingTests"
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 --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",
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    },
167    "scripts-descriptions": {
168        "webtrees:build": "Create a distribution file (webtrees.zip)",
169        "webtrees:check": "Run various static analysis tools",
170        "webtrees:coverage": "Generate test coverage report",
171        "webtrees:lang": "Compile the language files (messages.php)",
172        "webtrees:po": "Update the language (webtrees.pot, *.po)"
173    }
174}
175