resolve merge conflicts

This commit is contained in:
v-kaywon 2017-08-22 09:41:56 -07:00
parent 0c8a4b731a
commit 463d30b0ad
4 changed files with 209 additions and 168 deletions

View file

@ -1,28 +1,32 @@
## Setup Environment on a clean machine
### Windows
Install Visual Studio 2015 before running the following commands. Make sure C++ tools are enabled.
Run `cmd` as administrator.
The PHP zip file can be downloaded from <http://php.net/downloads.php>.
The SQLSRV and PDO_SQLSRV driver binaries can be downloaded from <https://github.com/Microsoft/msphpsql/releases>.
### Windows
Install Visual Studio 2015 redistributable before running the following commands.
Run `Windows PowerShell` as administrator.
powershell
Set-ExecutionPolicy Unrestricted
.\setup_env_windows.ps1 <PHP_VERSION - 7.x.x> <PHP_THREAD - ts or nts> <Absolute path to driver source folder> <ARCH - x86 or x64>
.\setup_env_windows.ps1 <absolute path to the PHP zip file> <absolute path to the SQLSRV driver DLL> <absolute path to the PDO_SQLSRV driver DLL>
### Ubuntu 16
sudo env "PATH=$PATH" bash setup_env_unix.sh Ubuntu16 <PHP_VERSION - 7.x.x> <PHP_THREAD - ts or nts> <Absolute path to driver source folder>
sudo env "PATH=$PATH" bash setup_env_unix.sh Ubuntu16 <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
### RedHat 7
sudo env "PATH=$PATH" bash setup_env_unix.sh RedHat7 <PHP_VERSION - 7.x.x> <PHP_THREAD - ts or nts> <Absolute path to driver source folder>
### Sierra
sudo env "PATH=$PATH" bash setup_env_unix.sh RedHat7 <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
### MacOS 10.12 Sierra
`brew` cannot be run with `sudo` on Sierra. Either enable passwordless `sudo` on the machine or enter the password when prompted.
bash setup_env_unix.sh Sierra <PHP_VERSION - 7.x.x> <PHP_THREAD - ts or nts> <Absolute path to driver source folder>
bash setup_env_unix.sh Sierra <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
## Run benchmarks
PHPBench is used to run the benchmarks. Visit http://phpbench.readthedocs.io/en/latest/introduction.html to have an idea how the tool works.
### 1. Modify lib/connect.php with the test database credentials
### 2. Modify lib/result_db.php with the result database credentials
### 3. The number of iterations for each test can be modified in the test itself (e.g., in test/Performance/benchmark/sqlsrv). Each test has a @Iteration(n) annotation. If you change the number in this annotation, you will change the number of iterations run for this test. By default, most tests are set to 1000 iterations.
### 4. Execute run-perf_tests.py.
##### 1. Modify lib/connect.php with the test database credentials
##### 2. Modify lib/result_db.php with the result database credentials
##### 3. The number of iterations for each test can be modified in the test itself (e.g., in test/Performance/benchmark/sqlsrv). Each test has a @Iteration(n) annotation. If you change the number in this annotation, you will change the number of iterations run for this test. By default, most tests are set to 1000 iterations.
##### 4. Execute run-perf_tests.py.
### Windows
py.exe run-perf_tests.py -platform <PLATFORM> > tee run-perf_output.txt
### Linux and Mac
@ -30,6 +34,16 @@ On Linux and Mac, the script must be executed with `sudo python3` because to ena
python3 run-perf_tests.py -platform <PLATFORM> | tee run-perf_output.txt
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra
<<<<<<< HEAD
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra.
`-php-driver` (optional) - The driver that the tests are ran on. Must be one of the following: sqlsrv, pdo_sqlsrv, or both. Default is both.
`-test-only` (optional) - The test to run. Must be the file name (not including path) of one test or 'all'. Default is 'all'. If one test is specified, must also specify the -php-driver option to sqlsrv or pdo_sqlsrv.
`-test-only` (optional) - The test to run. Must be the file name (not including path) of one test or 'all'. Default is 'all'. If one test is specified, must also specify the -php-driver option to sqlsrv or pdo_sqlsrv.
=======
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra.
`-iterations` - The number of iterations for regular tests.
`-iterations-large` - The number of iterations for the tests that fetch large data. Usually set to 1.
`-result-server` - The server containing the result database. It is assumed that the result database s already setup before running the tests.
`-result-db` - Database name. With the current result database setup files, this should be set to `TestResults`.
`-result-uid` - Result database username.
`-result-pwd` - Result database password.
>>>>>>> upstream/dev

View file

@ -1,3 +0,0 @@
set options=%2
set options=%options:"=%
C:\php-sdk\bin\phpsdk_setvars.bat && "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %1 && .\buildconf --force && .\configure %options% && nmake && nmake install

View file

@ -1,72 +1,91 @@
#!/bin/bash
set -e
if [[ ("$1" = "Ubuntu16" || "$1" = "RedHat7" || "$1" = "Sierra") ]]; then
PLATFORM=$1
else
echo "First argument must be one of Ubuntu16, RedHat7, Sierra. Exiting..."
echo "1st argument must be one of Ubuntu16, RedHat7, Sierra. Exiting..."
exit 1
fi
if [[ "$2" != 7.*.* ]]; then
echo "Second argument must be PHP version in format of 7.x.x.Exiting..."
echo "2nd argument must be PHP version in format of 7.x.y. Exiting..."
exit
else
PHP_VERSION=$2
fi
if [[ ("$3" != "nts" && "$3" != "ts") ]]; then
echo "Thrid argument must be either nts or ts. Exiting..."
echo "3rd argument must be either nts or ts. Exiting..."
exit 1
else
PHP_THREAD=$3
fi
if [[ (! -d "$4") || (! -d $4/sqlsrv) || (! -d $4/pdo_sqlsrv) || (! -d $4/shared) ]]; then
echo "Fourth argument must be path to source folder.Path not found.Exiting..."
if [[ (! -f "$4") || (! -f "$5") ]]; then
echo "5th and 6th argument must be paths to sqlsrv and pdo drivers. Exiting..."
exit 1
else
DRIVER_SOURCE_PATH=$4
SQLSRV_DRIVER=$4
PDO_DRIVER=$5
fi
rm -rf env_setup.log
touch env_setup.log
if [ $PLATFORM = "Ubuntu16" ]; then
echo "Update..."
yes | sudo dpkg --configure -a >> env_setup.log 2>&1
yes | sudo apt-get update >> env_setup.log 2>&1
echo "Installing git, zip, curl, libxml, autoconf, openssl, python3, pip3..."
yes | sudo apt-get install git zip curl autoconf libxml2-dev libssl-dev pkg-config python3 python3-pip >> env_setup.log 2>&1
echo "OK"
echo "Installing MSODBCSQL..."
printf "Update..."
yes | sudo dpkg --configure -a > env_setup.log
yes | sudo apt-get update >> env_setup.log
printf "done\n"
printf "Installing git, zip, curl, libxml, autoconf, openssl, python3, pip3..."
yes | sudo apt-get install git zip curl autoconf libxml2-dev libssl-dev pkg-config python3 python3-pip >> env_setup.log
printf "done\n"
printf "Installing MSODBCSQL..."
curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl -s https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
yes | sudo apt-get update >> env_setup.log 2>&1
yes | sudo ACCEPT_EULA=Y apt-get install msodbcsql >> env_setup.log 2>&1
yes | sudo apt-get install -qq unixodbc-dev >> env_setup.log 2>&1
echo "Installing pyodbc"
pip3 install --upgrade pip >> env_setup.log 2>&1
pip3 install pyodbc >> env_setup.log 2>&1
echo "OK"
yes | sudo apt-get update >> env_setup.log
yes | sudo ACCEPT_EULA=Y apt-get install msodbcsql >> env_setup.log
yes | sudo apt-get install -qq unixodbc-dev >> env_setup.log
printf "done\n"
printf "Installing pyodbc"
pip3 install --upgrade pip >> env_setup.log
pip3 install pyodbc >> env_setup.log
printf "done\n"
elif [ $PLATFORM = "RedHat7" ]; then
echo "Update..."
yes | sudo yum update >> env_setup.log 2>&1
echo "OK"
echo "Enabling EPEL repo..."
printf "Update..."
yes | sudo yum update >> env_setup.log
printf "done\n"
printf "Enabling EPEL repo..."
# pipe non-error to log file (wget and yum install reports error when there's nothing to do)
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm >> env_setup.log 2>&1
yes | sudo yum install epel-release-latest-7.noarch.rpm >> env_setup.log 2>&1 || true
echo "OK"
echo "Installing python34-setuptools..."
yes | sudo yum install python34-setuptools -y >> env_setup.log 2>&1
echo "OK"
echo "Installing gcc, git, zip libxml, openssl, EPEL, python3, pip3..."
yes | sudo yum install -y gcc-c++ libxml2-devel git zip openssl-devel python34 python34-devel python34-pip >> env_setup.log 2>&1
echo "OK"
echo "Installing MSODBCSQL..."
printf "done\n"
printf "Installing python34-setuptools..."
yes | sudo yum install python34-setuptools -y >> env_setup.log
printf "done\n"
printf "Installing gcc, git, zip libxml, openssl, EPEL, python3, pip3..."
yes | sudo yum install -y gcc-c++ libxml2-devel git zip openssl-devel python34 python34-devel python34-pip >> env_setup.log
printf "done\n"
printf "Installing MSODBCSQL..."
curl -s https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
(yes | sudo ACCEPT_EULA=Y yum install -y msodbcsql >> env_setup.log 2>&1)
(yes | sudo yum install -y unixODBC-devel autoconf >> env_setup.log 2>&1)
echo "OK"
echo "Installing pyodbc"
pip3 install --upgrade pip >> env_setup.log 2>&1
pip3 install pyodbc >> env_setup.log 2>&1
echo "OK"
(yes | sudo ACCEPT_EULA=Y yum install -y msodbcsql >> env_setup.log)
(yes | sudo yum install -y unixODBC-devel autoconf >> env_setup.log)
printf "done\n"
printf "Installing pyodbc"
pip3 install --upgrade pip >> env_setup.log
pip3 install pyodbc >> env_setup.log
printf "done\n"
elif [ $PLATFORM = "Sierra" ]; then
<<<<<<< HEAD
echo "Installing homebrew..."
yes | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" >> env_setup.log 2>&1
echo "OK"
@ -92,49 +111,108 @@ elif [ $PLATFORM = "Sierra" ]; then
echo "Installing pyodbc..."
pip3 install pyodbc >> env_setup.log 2>&1
echo "OK"
=======
printf "Installing homebrew..."
yes | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" >> env_setup.log
printf "done\n"
printf "Installing wget..."
brew install wget >> env_setup.log
printf "done\n"
printf "Installing svn..."
brew install svn >> env_setup.log
printf "done\n"
printf "Installing openssl..."
brew install pkg-config >> env_setup.log
brew install openssl >> env_setup.log
printf "done\n"
printf "Installing python3..."
brew install python3 >> env_setup.log
printf "done\n"
printf "Installing MSODBCSQL..."
brew tap microsoft/msodbcsql https://github.com/Microsoft/homebrew-msodbcsql >> env_setup.log
brew update >> env_setup.log
yes | ACCEPT_EULA=Y brew install --no-sandbox msodbcsql >> env_setup.log
printf "done\n"
yes | brew install autoconf >> env_setup.log
printf "Installing pyodbc..."
pip3 install pyodbc >> env_setup.log
printf "done\n"
>>>>>>> upstream/dev
fi
echo "Downloading PHP-$PHP_VERSION source tarball..."
printf "Downloading PHP-$PHP_VERSION source tarball..."
# pipe non-error to log file
wget http://ca1.php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -O php-$PHP_VERSION.tar.gz >> env_setup.log 2>&1
echo "OK"
echo "Extracting PHP source tarball..."
printf "done\n"
printf "Extracting PHP source tarball..."
rm -rf php-$PHP_VERSION
tar -xf php-$PHP_VERSION.tar.gz
echo "OK"
cd php-$PHP_VERSION
mkdir ext/sqlsrv ext/pdo_sqlsrv
cp -r $DRIVER_SOURCE_PATH/sqlsrv/* $DRIVER_SOURCE_PATH/shared ext/sqlsrv
cp -r $DRIVER_SOURCE_PATH/pdo_sqlsrv/* $DRIVER_SOURCE_PATH/shared ext/pdo_sqlsrv
printf "done\n"
phpDir=php-$PHP_VERSION
cd $phpDir
printf "Configuring PHP..."
./buildconf --force >> ../env_setup.log 2>&1
CONFIG_OPTIONS="--enable-cli --enable-cgi --enable-pdo --enable-sqlsrv=shared --with-pdo_sqlsrv=shared --with-odbcver=0x0380 --with-zlib --enable-mbstring --prefix=/usr/local"
CONFIG_OPTIONS="--enable-cli --enable-cgi --with-zlib --enable-mbstring --prefix=/usr/local"
[ "${PHP_THREAD}" == "ts" ] && CONFIG_OPTIONS=${CONFIG_OPTIONS}" --enable-maintainer-zts"
if [ $PLATFORM = "Sierra" ]; then
CONFIG_OPTIONS=$CONFIG_OPTIONS" --with-openssl=/usr/local/opt/openssl/"
else
CONFIG_OPTIONS=$CONFIG_OPTIONS" --with-openssl"
fi
echo "Configuring PHP..."
#pipe non-error to log file
(./configure $CONFIG_OPTIONS >> ../env_setup.log 2>&1)
echo "OK"
echo "Compiling PHP and the drivers..."
make >> ../env_setup.log 2>&1
echo "OK"
sudo make install >> ../env_setup.log 2>&1
printf "done\n"
printf "Compiling and installing PHP..."
make >> ../env_setup.log
sudo make install >> ../env_setup.log
printf "done\n"
# check PHP version
/usr/local/bin/php -v
printf "Setting up drivers..."
phpExtDir=`/usr/local/bin/php-config --extension-dir`
cp php.ini-production php.ini
echo "extension=sqlsrv.so" >> php.ini
echo "extension=pdo_sqlsrv.so" >> php.ini
driverName=$(basename $SQLSRV_DRIVER)
echo "extension=$driverName" >> php.ini
sudo cp -r $SQLSRV_DRIVER $phpExtDir/$driverName
sudo chmod a+r $SQLSRV_DRIVER $phpExtDir/$driverName
driverName=$(basename $PDO_DRIVER)
echo "extension=$driverName" >> php.ini
sudo cp -r $PDO_DRIVER $phpExtDir/$driverName
sudo chmod a+r $SQLSRV_DRIVER $phpExtDir/$driverName
sudo cp php.ini /usr/local/lib
printf "done\n"
# check drivers
/usr/local/bin/php --ri sqlsrv
/usr/local/bin/php --ri pdo_sqlsrv
printf "Installing Composer..."
cd ..
php -v
php --ri sqlsrv
php --ri pdo_sqlsrv
echo "Installing Composer..."
# pipe non-error to log file
wget https://getcomposer.org/installer -O composer-setup.php >> env_setup.log 2>&1
php composer-setup.php >> env_setup.log 2>&1
echo "OK"
echo "Installing PHPBench..."
php composer.phar install >> env_setup.log 2>&1
echo "OK"
echo "Cleaning up..."
rm -rf php-$PHP_VERSION* compser-setup.php
echo "OK"
echo "Setup completed!"
/usr/local/bin/php composer-setup.php >> env_setup.log
printf "done\n"
printf "Installing PHPBench...\n"
/usr/local/bin/php composer.phar install >> env_setup.log
printf "done\n"
printf "Cleaning up..."
rm -rf $phpDir compser-setup.php
printf "done\n"
echo "Setup completed!"

View file

@ -1,28 +1,13 @@
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$PHP_VERSION,
[Parameter(Mandatory=$True,Position=2)]
[string]$PHP_THREAD,
[string]$PHP_ZIP,
[Parameter(Mandatory=$True,Position=2)]
[string]$SQLSRV_DRIVER,
[Parameter(Mandatory=$True,Position=3)]
[string]$DRIVER_SOURCE_PATH,
[Parameter(Mandatory=$True,Position=4)]
[string]$ARCH
[string]$PDO_DRIVER
)
IF($ARCH -ne "x64" -And $ARCH -ne "x86"){
Write-Host "ARCH must either x64 or x86"
Break
}
IF($PHP_THREAD -ne "nts" -And $PHP_THREAD -ne "ts"){
Write-Host "PHP_THREAD must either nts or ts"
Break
}
IF($PHP_VERSION -NotMatch "7.[0-1].[0-9]"){
Write-Host "PHP_VERSION must be in format of 7.x.x"
Break
}
$ErrorActionPreference = "Stop"
$startingDir=$pwd.Path
$tempFolder=Join-Path $startingDir "temp"
@ -30,17 +15,12 @@ $tempFolder=Join-Path $startingDir "temp"
Remove-Item temp -Recurse -Force -ErrorAction Ignore
New-Item -ItemType directory -Path temp
(New-Object System.Net.WebClient).DownloadFile("http://windows.php.net/downloads/releases/sha1sum.txt","$tempFolder\sha1sum.txt")
$PHP70_LATEST_VERSION=type $tempFolder\sha1sum.txt | where { $_ -match "php-(7.0\.\d+)-src" } | foreach { $matches[1] }
$PHP71_LATEST_VERSION=type $tempFolder\sha1sum.txt | where { $_ -match "php-(7.1\.\d+)-src" } | foreach { $matches[1] }
$PHP_VERSION_MINOR=$PHP_VERSION.split(".")[1]
Write-Host "Installing chocolatey..."
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Host "Installing Git..."
choco install -y git
Set-Alias git 'C:\Program Files\Git\cmd\git.exe'
$gitDir = 'C:\Program Files\Git\cmd\git.exe'
Write-Host "Installing Python3..."
choco install -y python3
RefreshEnv
@ -54,65 +34,37 @@ msiexec /quiet /passive /qn /i $tempFolder\msodbcsql.msi IACCEPTMSODBCSQLLICENSE
Write-Host "Installing 7-Zip..."
choco install -y 7zip.install
Write-Host "Downloading PHP-SDK..."
(New-Object System.Net.WebClient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', "$tempFolder\binary_tools.zip")
Write-Host "Downloading PHP-$PHP_VERSION source..."
IF($PHP_VERSION -eq $PHP70_LATEST_VERSION -Or $PHP_VERSION -eq $PHP71_LATEST_VERSION){
(New-Object System.Net.WebClient).DownloadFile("http://windows.php.net/downloads/releases/php-$PHP_VERSION-src.zip", "$tempFolder\php-$PHP_VERSION-src.zip")
}
ELSE{
(New-Object System.Net.WebClient).DownloadFile("http://windows.php.net/downloads/releases/archives/php-$PHP_VERSION-src.zip", "$tempFolder\php-$PHP_VERSION-src.zip")
}
Write-Host "Installing PHP..."
$phpDir="C:\php"
Write-Host "Downloading Dependencies..."
(New-Object System.Net.WebClient).DownloadFile("http://windows.php.net/downloads/php-sdk/deps-7.$PHP_VERSION_MINOR-vc14-$ARCH.7z", "$tempFolder\deps-7.$PHP_VERSION_MINOR-vc14-$ARCH.7z")
# remove existing PHP and setup new one
Remove-Item $phpDir -Recurse -ErrorAction Ignore
New-Item -ItemType directory -Path $phpDir
Expand-Archive $PHP_ZIP -DestinationPath $phpDir
Copy-Item $SQLSRV_DRIVER $phpDir\ext
Copy-Item $PDO_DRIVER $phpDir\ext
Add-Type -AssemblyName System.IO.Compression.FileSystem
Remove-Item C:\php-sdk -Recurse -Force -ErrorAction Ignore
New-Item -ItemType directory -Path C:\php-sdk
[System.IO.Compression.ZipFile]::ExtractToDirectory("$tempFolder\binary_tools.zip", "C:\php-sdk")
cd C:\php-sdk\
bin\phpsdk_buildtree.bat phpdev
New-Item -ItemType directory -Path .\phpdev\vc14
Copy-Item .\phpdev\vc9\* phpdev\vc14\ -recurse
[System.IO.Compression.ZipFile]::ExtractToDirectory("$tempFolder\php-$PHP_VERSION-src.zip", "C:\php-sdk\phpdev\vc14\$ARCH\")
7z.exe x $tempFolder\deps-7.$PHP_VERSION_MINOR-vc14-$ARCH.7z -oC:\php-sdk\phpdev\vc14\$ARCH\
# setup driver
Copy-Item $phpDir\php.ini-production $phpDir\php.ini
Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_openssl.dll"
Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_mbstring.dll"
bin\phpsdk_setvars.bat
cd C:\php-sdk\phpdev\vc14\$ARCH\php-$PHP_VERSION-src
New-Item -ItemType directory -Path .\ext\sqlsrv
New-Item -ItemType directory -Path .\ext\pdo_sqlsrv
Copy-Item $DRIVER_SOURCE_PATH\sqlsrv\* .\ext\sqlsrv\ -recurse
Copy-Item $DRIVER_SOURCE_PATH\shared\ .\ext\sqlsrv\ -recurse
Copy-Item $DRIVER_SOURCE_PATH\pdo_sqlsrv\* .\ext\pdo_sqlsrv\ -recurse
Copy-Item $DRIVER_SOURCE_PATH\shared\ .\ext\pdo_sqlsrv\ -recurse
$CONFIG_OPTIONS="--enable-cli --enable-cgi --enable-sqlsrv=shared --enable-pdo=shared --with-pdo-sqlsrv=shared --with-odbcver=0x0380 --enable-mbstring --with-openssl"
if ($PHP_THREAD -ceq "nts") {
$CONFIG_OPTIONS=$CONFIG_OPTIONS + " --disable-zts"
}
& $startingDir\compile_php.bat $ARCH $CONFIG_OPTIONS
Copy-Item php.ini-production php.ini
Add-Content php.ini "extension=C:\php\ext\php_sqlsrv.dll"
Add-Content php.ini "extension=C:\php\ext\php_pdo_sqlsrv.dll"
Add-Content php.ini "extension=C:\php\ext\php_openssl.dll"
Move-Item php.ini C:\Windows -force
Copy-Item C:\php-sdk\phpdev\vc14\$ARCH\deps\bin\ssleay32.dll C:\Windows -force
Copy-Item C:\php-sdk\phpdev\vc14\$ARCH\deps\bin\libeay32.dll C:\Windows -force
$driverName=Split-Path $SQLSRV_DRIVER -leaf
Add-Content $phpDir\php.ini "extension=$phpDir\ext\$driverName"
$driverName=Split-Path $PDO_DRIVER -leaf
Add-Content $phpDir\php.ini "extension=$phpDir\ext\$driverName"
Move-Item $phpDir\php.ini C:\Windows -force
Copy-Item $phpDir\ssleay32.dll C:\Windows -force
Copy-Item $phpDir\libeay32.dll C:\Windows -force
cd $startingDir
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\php\", [System.EnvironmentVariableTarget]::Machine)
$env:Path += ";C:\php\"
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $phpDir + ";" + $gitDir, [System.EnvironmentVariableTarget]::Machine)
$env:Path = $env:Path + ";" + $phpDir + ";" + $gitDir
RefreshEnv
# setup composer
wget https://getcomposer.org/installer -O composer-setup.php
php composer-setup.php
php composer.phar install
Remove-Item temp -Recurse -Force -ErrorAction Ignore
Write-Host "Setup completed!"
Write-Host "Setup completed!"