From f981d50f5db6c33b7f270d592e1049fd5d037546 Mon Sep 17 00:00:00 2001 From: iodragon Date: Fri, 3 Jan 2014 09:38:51 -0800 Subject: [PATCH] Set php PATH for repository's hook Summary: ~~Set PATH for repository's hook, so the environment.append-paths can used~~ repository's hook may can't find php path if user's profile like bash_profile is not loaded. Test Plan: check the hook generated is contain the right path Reviewers: epriestley, #blessed_reviewers CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7743 --- .../repository/engine/PhabricatorRepositoryPullEngine.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/applications/repository/engine/PhabricatorRepositoryPullEngine.php diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php old mode 100644 new mode 100755 index 60d264b472..ef55da4374 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -159,7 +159,13 @@ final class PhabricatorRepositoryPullEngine $root = dirname(phutil_get_library_root('phabricator')); $bin = $root.'/bin/commit-hook'; - $cmd = csprintf('exec %s %s "$@"', $bin, $callsign); + + $full_php_path = Filesystem::resolveBinary('php'); + $cmd = csprintf( + 'exec %s -f %s -- %s "$@"', + $full_php_path, + $bin, + $callsign); $hook = "#!/bin/sh\n{$cmd}\n";