Skip to content

Instantly share code, notes, and snippets.

@philipborbon
Last active December 30, 2022 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipborbon/edc7cb8cc4efd82c19a1a35002fb5de8 to your computer and use it in GitHub Desktop.
Save philipborbon/edc7cb8cc4efd82c19a1a35002fb5de8 to your computer and use it in GitHub Desktop.
CLI - multiple PHP composer setup
# Start SSH Agent
#----------------------------
SSH_ENV="$HOME/.ssh/environment"
function run_ssh_env {
. "${SSH_ENV}" > /dev/null
}
function start_ssh_agent {
echo "Initializing new SSH agent..."
ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo "Succeeded"
chmod 600 "${SSH_ENV}"
run_ssh_env;
ssh-add ~/.ssh/id_rsa;
ssh-add ~/.ssh/id_ed25519;
}
if [ -f "${SSH_ENV}" ]; then
run_ssh_env;
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_ssh_agent;
}
else
start_ssh_agent;
fi
alias php5="C:/xampp/php56/php.exe"
alias composer5="C:/xampp/php56/php.exe C:/ProgramData/ComposerSetup/2.2.x-bin/composer.phar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment