1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 18:52:42 +01:00
phorge-phorge/src/infrastructure/env
Angelos Evripiotis bfdce02689 prepend path/to/phabricator/support/bin/ to $PATH
Summary:
It's sometimes necessary to specify the paths to individual binaries
explicitly, e.g. a particular build of 'javelinsymbols' or a newer
version of git than is installed on your shared system.

By adding symlinks in the .../phabricator/support/bin/ directory you
can now spell these out using the file system.

Test Plan:
Ran on local Ubuntu VM:

  .. add 'TEST' repo to diffusion ..
  .. visit 127.0.01/diffusion/TEST - see ok ..

  $ cd /opt
  $ sudo sh -c 'echo "exit 1" > badgit'
  $ sudo chmod +x /opt/badgit
  $ sudo mkdir goodgit
  $ sudo mv /usr/bin/git /opt/goodgit/

  .. unset environment.append-paths ..
  .. visit 127.0.01/diffusion/TEST - see error 'git: not found' ..
  .. set environment.append-paths to /opt/goodgit/ ..
  .. visit 127.0.01/diffusion/TEST - see ok ..

  $ sudo ln -s /opt/badgit /usr/bin/git
  .. visit 127.0.01/diffusion/TEST - see error 'error #1' ..
  sudo ln -s /opt/goodgit/git web/phabricator/support/bin/git
  .. visit 127.0.01/diffusion/TEST - see ok ..

  .. unset environment.append-paths ..
  .. visit 127.0.01/diffusion/TEST - see ok ..

  $ sudo rm web/phabricator/support/bin/git
  .. visit 127.0.01/diffusion/TEST - see error 'error #1' ..

  $ sudo rm /usr/bin/git
  $ sudo mv /opt/goodgit/git /usr/bin/
  .. visit 127.0.01/diffusion/TEST - see ok ..

Note that 'DIRECTORY_SEPARATOR' was not used because apparently it's
portable and ok to just use '/'.
http://alanhogan.com/tips/php/directory-separator-not-necessary
(I'm pretty new to PHP so looking for guidance :)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2378

Differential Revision: https://secure.phabricator.com/D5561
2013-04-03 12:49:46 -07:00
..
__tests__ Testing that PhabricatorEnv::getEnvConfig throws an exception if config option is not found. 2013-01-19 17:05:45 -08:00
PhabricatorConfigDatabaseSource.php Add database configuration source to the source stack 2013-01-17 15:10:21 -08:00
PhabricatorConfigDefaultSource.php Read default values of custom config options 2013-01-19 08:36:08 -08:00
PhabricatorConfigDictionarySource.php Formalize configuration sources and source stacks 2012-12-25 06:44:29 -08:00
PhabricatorConfigFileSource.php Formalize configuration sources and source stacks 2012-12-25 06:44:29 -08:00
PhabricatorConfigLocalSource.php Add a local configuration source and a non-environmental ENV config source 2012-12-30 06:16:15 -08:00
PhabricatorConfigProxySource.php Increase the power of bin/config 2013-01-21 15:27:42 -08:00
PhabricatorConfigSource.php Show all configuration defaults when editing configuration 2013-01-01 14:10:33 -08:00
PhabricatorConfigStackSource.php Show all configuration defaults when editing configuration 2013-01-01 14:10:33 -08:00
PhabricatorEnv.php prepend path/to/phabricator/support/bin/ to $PATH 2013-04-03 12:49:46 -07:00
PhabricatorScopedEnv.php Formalize configuration sources and source stacks 2012-12-25 06:44:29 -08:00