Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
103 lines (68 sloc) 2.17 KB
#
# PHP turbo.me file
# https://github.com/turboapps/turbome/tree/master/php
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
###################################
# Meta tags
###################################
meta title="PHP"
meta name="php"
meta namespace="php"
###################################
# Pull dependency images
###################################
layer microsoft/vcredist:2012
using gnu/wget,7-zip/7-zip,python/python:3.4.1,fart/fart
###################################
# Download and install
###################################
cmd pip install requests --quiet
# Create app directory
cmd mkdir C:\php
workdir C:\php
batch
echo import requests >> getVersion.py
echo import re >> getVersion.py
echo host = "http://windows.php.net/download/" >> getVersion.py
echo headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'} >> getVersion.py
echo r = requests.get(host , headers=headers, timeout=10) >> getVersion.py
echo print(list(re.findall(' href=^"(.*php-(\d*\.\d*\.\d*)-Win32-VC11-x86.zip)', r.text )[0])) >> getVersion.py
cmd python getVersion.py
var data = last
cmd "python -c ""print(%data%[0])"""
var url = "http://windows.php.net" + last
cmd "python -c ""print(%data%[1])"""
var tag = last
# Download
cmd "wget --no-check-certificate --no-verbose -O php.zip %url%"
# Install
cmd 7z.exe x php.zip
# Create php.ini file from template
cmd "copy php.ini-production php.ini"
# Add extension directory
batch cmd
fart.exe --ignore-case -C php.ini "; extension_dir = \"ext\"" "extension_dir = \"c:/php/ext\""
ver > nul
###################################
# Environment Variables
###################################
env path="C:\php"
###################################
# Startup File
###################################
setworkdir C:\php
# No startup files needed
###################################
# Version
###################################
meta tag=tag
meta version=tag
###################################
# Clean up
###################################
cmd del C:\php\php.zip /Q
cmd del C:\php\getVersion.py /Q
cmd rmdir c:\wget /s /q
cmd rmdir c:\python34 /s /q