-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for php.ini customization and fix bugs
- Loading branch information
1 parent
a398f54
commit e4a37d0
Showing
9 changed files
with
112 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a> | ||
</p> | ||
|
||
[GitHub Action](https://github.com/features/actions) to install PHP with required extensions and composer. This action can be added as a step in your action workflow and it will setup the PHP environment you need to test your application. Refer to [Usage](#usage) section to see how to use this. | ||
[GitHub Action](https://github.com/features/actions) to install PHP with required extensions, php.ini configuration and composer. This action can be added as a step in your action workflow and it will setup the PHP environment you need to test your application. Refer to [Usage](#usage) section to see how to use this. | ||
|
||
## PHP Versions Support | ||
- 5.6 | ||
|
@@ -36,9 +36,15 @@ | |
|
||
## Usage | ||
|
||
See [action.yml](action.yml) for inputs this action supports. | ||
Inputs supported by this GitHub Action. | ||
|
||
### Basic | ||
- php-version | ||
- extension-csv (optional) | ||
- ini-values-csv (optional) | ||
|
||
See [action.yml](action.yml) for more info | ||
|
||
### Basic Usage | ||
|
||
```yaml | ||
steps: | ||
|
@@ -48,7 +54,8 @@ steps: | |
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: 7.3 | ||
extension-csv: mbstring, xdebug | ||
extension-csv: mbstring, xdebug #optional | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
staabm
|
||
ini-values-csv: "post_max_size=256M, short_open_tag=On" #optional | ||
- name: Check PHP Version | ||
run: php -v | ||
- name: Check Composer Version | ||
|
@@ -76,7 +83,8 @@ jobs: | |
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extension-csv: mbstring, xdebug | ||
extension-csv: mbstring, xdebug #optional | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
ini-values-csv: "post_max_size=256M, short_open_tag=On" #optional | ||
- name: Check PHP Version | ||
run: php -v | ||
- name: Check Composer Version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
ua() | ||
{ | ||
for tool in php phar phar.phar php-cgi php-config phpize; do | ||
if [ -e "/usr/bin/$tool$version" ]; then | ||
sudo update-alternatives --set $tool /usr/bin/$tool$1; | ||
fi | ||
done | ||
} | ||
|
||
version=$(php-config --version | cut -c 1-3) | ||
if [ "$version" != "$1" ]; then | ||
if [ ! -e "/usr/bin/php$1" ]; then | ||
sudo add-apt-repository ppa:ondrej/php -y | ||
sudo apt update -y | ||
sudo apt install -y php$1 curl; | ||
sudo apt autoremove -y; | ||
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y | ||
sudo DEBIAN_FRONTEND=noninteractive apt update -y | ||
sudo DEBIAN_FRONTEND=noninteractive apt install -y php$1 curl; | ||
sudo DEBIAN_FRONTEND=noninteractive apt autoremove -y; | ||
fi | ||
ua $1; | ||
for tool in php phar phar.phar php-cgi php-config phpize; do | ||
if [ -e "/usr/bin/$tool$1" ]; then | ||
sudo update-alternatives --set $tool /usr/bin/$tool$1; | ||
fi | ||
done | ||
fi | ||
|
||
if [ ! -e "/usr/bin/composer" ]; then | ||
sudo curl -s https://getcomposer.org/installer | php; | ||
sudo mv composer.phar /usr/local/bin/composer; | ||
fi | ||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") | ||
sudo chmod 777 $ini_file | ||
php -v | ||
composer -V |
Does this line miss double quotes?