Skip to content

Commit a806bf3

Browse files
committed
Check for required extensions in the script itself instead of composer.json
1 parent b55cbb7 commit a806bf3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

bin/phpcs-check-doc-examples

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,22 @@
2020

2121
if (PHP_VERSION_ID < 70000) {
2222
$error = 'ERROR: This script requires PHP version 7.0.0 or greater.' . PHP_EOL;
23-
fwrite(STDERR, $error);
23+
\fwrite(STDERR, $error);
2424
exit(1);
2525
}
2626

27+
if (\extension_loaded('libxml') === false) {
28+
$error = 'ERROR: This script requires the libxml extension.' . PHP_EOL;
29+
\fwrite(STDERR, $error);
30+
exit(1);
31+
}
32+
33+
if (\extension_loaded('dom') === false) {
34+
$error = 'ERROR: This script requires the DOM extension.' . PHP_EOL;
35+
\fwrite(STDERR, $error);
36+
exit(1);
37+
}
38+
2739
require_once __DIR__ . '/../Scripts/DocCodeExamples/Functions.php';
2840

2941
$devToolsAutoloadLocations = [

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
"php" : ">=5.4",
2626
"squizlabs/php_codesniffer" : "^3.1.0 || ^4.0",
2727
"dealerdirect/phpcodesniffer-composer-installer" : "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
28-
"ext-dom": "*",
29-
"ext-libxml": "*"
3028
},
3129
"require-dev" : {
3230
"roave/security-advisories" : "dev-master",

0 commit comments

Comments
 (0)