mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 13:03:04 +07:00
Add perimission for composer self-update
This commit is contained in:
parent
5de6285e1f
commit
99161b7790
@ -95,7 +95,6 @@ add_unstable_extension() {
|
|||||||
add_tool() {
|
add_tool() {
|
||||||
url=$1
|
url=$1
|
||||||
tool=$2
|
tool=$2
|
||||||
tool_path_dir=/usr/local/bin
|
|
||||||
tool_path="$tool_path_dir/$tool"
|
tool_path="$tool_path_dir/$tool"
|
||||||
if [ ! -e "$tool_path" ]; then
|
if [ ! -e "$tool_path" ]; then
|
||||||
rm -rf "$tool_path"
|
rm -rf "$tool_path"
|
||||||
@ -186,7 +185,8 @@ tick="✓"
|
|||||||
cross="✗"
|
cross="✗"
|
||||||
version=$1
|
version=$1
|
||||||
old_versions="5.[3-5]"
|
old_versions="5.[3-5]"
|
||||||
php5=/usr/local/php5
|
php5="/usr/local/php5"
|
||||||
|
tool_path_dir="/usr/local/bin"
|
||||||
existing_version=$(php-config --version | cut -c 1-3)
|
existing_version=$(php-config --version | cut -c 1-3)
|
||||||
[[ -z "${update}" ]] && update='false' || update="${update}"
|
[[ -z "${update}" ]] && update='false' || update="${update}"
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ else
|
|||||||
status="Found"
|
status="Found"
|
||||||
fi
|
fi
|
||||||
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
sudo chmod 777 "$ini_file"
|
sudo chmod 777 "$ini_file" "$tool_path_dir"
|
||||||
echo "date.timezone=UTC" >>"$ini_file"
|
echo "date.timezone=UTC" >>"$ini_file"
|
||||||
echo "detect_unicode=Off" >>"$ini_file"
|
echo "detect_unicode=Off" >>"$ini_file"
|
||||||
ext_dir=$(php -i | grep -Ei "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
ext_dir=$(php -i | grep -Ei "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
||||||
|
@ -148,7 +148,6 @@ update_extension() {
|
|||||||
add_tool() {
|
add_tool() {
|
||||||
url=$1
|
url=$1
|
||||||
tool=$2
|
tool=$2
|
||||||
tool_path_dir=/usr/local/bin
|
|
||||||
tool_path="$tool_path_dir/$tool"
|
tool_path="$tool_path_dir/$tool"
|
||||||
if [ ! -e "$tool_path" ]; then
|
if [ ! -e "$tool_path" ]; then
|
||||||
rm -rf "$tool_path"
|
rm -rf "$tool_path"
|
||||||
@ -274,6 +273,7 @@ version=$1
|
|||||||
old_versions="5.[4-5]"
|
old_versions="5.[4-5]"
|
||||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
apt_install="sudo $debconf_fix apt-fast install -y"
|
apt_install="sudo $debconf_fix apt-fast install -y"
|
||||||
|
tool_path_dir="/usr/local/bin"
|
||||||
existing_version=$(php-config --version | cut -c 1-3)
|
existing_version=$(php-config --version | cut -c 1-3)
|
||||||
[[ -z "${update}" ]] && update='false' || update="${update}"
|
[[ -z "${update}" ]] && update='false' || update="${update}"
|
||||||
|
|
||||||
@ -317,5 +317,5 @@ semver=$(php_semver)
|
|||||||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
|
ext_dir=$(php -i | grep "extension_dir => /" | sed -e "s|.*=> s*||")
|
||||||
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
||||||
sudo chmod 777 "$ini_file"
|
sudo chmod 777 "$ini_file" "$tool_path_dir"
|
||||||
add_log "$tick" "PHP" "$status PHP $semver"
|
add_log "$tick" "PHP" "$status PHP $semver"
|
||||||
|
Loading…
Reference in New Issue
Block a user