Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rasteiner/a260893be85019113aa28fad9315f479 to your computer and use it in GitHub Desktop.
Save rasteiner/a260893be85019113aa28fad9315f479 to your computer and use it in GitHub Desktop.
function APACHE {
docker run -d --rm -p 80:80 -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs
}
function APACHE7 {
docker run -d --rm -p 80:80 --env XDEBUG_CONFIG="remote_enable=0 profiler_enable=0" -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs:php7
}
function APACHE7-DEBUG {
$HostIP = ( `
Get-NetIPConfiguration | `
Where-Object { `
$null -ne $_.IPv4DefaultGateway `
-and `
$_.NetAdapter.Status -ne "Disconnected" `
} `
).IPv4Address.IPAddress
Write-Output "Debug enabled for ${HostIP}"
docker run -d --rm -p 80:80 --env XDEBUG_CONFIG="remote_enable=1 remote_host=${HostIP} profiler_enable=0" -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs:php7
}
function APACHE7-PROFILE {
$HostIP = ( `
Get-NetIPConfiguration | `
Where-Object { `
$null -ne $_.IPv4DefaultGateway `
-and `
$_.NetAdapter.Status -ne "Disconnected" `
} `
).IPv4Address.IPAddress
docker run -d --rm -p 80:80 --env XDEBUG_CONFIG="remote_enable=1 remote_host=${HostIP} profiler_enable=1" -v "${PWD}:/var/www/html" rasteiner/phpapache-for-devs:php7
}
function STOP-APACHE {
$containers = docker ps -q --filter ancestor=rasteiner/phpapache-for-devs
docker stop $containers
}
function STOP-APACHE7 {
$containers = docker ps -q --filter ancestor=rasteiner/phpapache-for-devs:php7
docker stop $containers
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment