$OpenBSD: patch-validate_php,v 1.16 2018/02/27 15:17:39 sthen Exp $

- files installed from packages should only be updated via packages so
it's safer if they are owned by root; adjust the ownership check so that
*only* rrds are checked.

- we have getcap, but it's not linux getcap.

Index: validate.php
--- validate.php.orig
+++ validate.php
@@ -72,7 +72,7 @@ if (!file_exists('config.php')) {
 }
 
 $pre_checks_failed = false;
-$syntax_check = `php -ln config.php`;
+$syntax_check = `%PHP% -ln config.php`;
 if (!str_contains($syntax_check, 'No syntax errors detected')) {
     print_fail('Syntax error in config.php');
     echo $syntax_check;
@@ -95,12 +95,12 @@ if (!file_exists('vendor/autoload.php')) {
     $pre_checks_failed = true;
 }
 
-if (!str_contains(shell_exec('php scripts/composer_wrapper.php --version'), 'Composer version')) {
+if (!str_contains(shell_exec('%PHP% scripts/composer_wrapper.php --version'), 'Composer version')) {
     print_fail("No composer available, please install composer", "https://getcomposer.org/");
     $pre_checks_failed = true;
 }
 
-$dep_check = shell_exec('php scripts/composer_wrapper.php install --no-dev --dry-run');
+$dep_check = shell_exec('%PHP% scripts/composer_wrapper.php install --no-dev --dry-run');
 preg_match_all('/Installing ([^ ]+\/[^ ]+) \(/', $dep_check, $dep_missing);
 if (!empty($dep_missing[0])) {
     print_fail("Missing dependencies!", "./scripts/composer_wrapper.php install --no-dev");
