diff options
author | Frank M. Kromann <fmk@php.net> | 2003-01-31 03:44:20 +0000 |
---|---|---|
committer | Frank M. Kromann <fmk@php.net> | 2003-01-31 03:44:20 +0000 |
commit | 941dc7260dad6aa18d30b4f1310072f5d052af46 (patch) | |
tree | b7100e3e8701064de40517921876b3e28923535a /ext/ext_skel.php | |
parent | 9e95db3769d212da579c4bce7ee92a11631fb3e3 (diff) | |
download | php-git-941dc7260dad6aa18d30b4f1310072f5d052af46.tar.gz |
Wrapper script to use ext_skel on Win32
Diffstat (limited to 'ext/ext_skel.php')
-rw-r--r-- | ext/ext_skel.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/ext_skel.php b/ext/ext_skel.php new file mode 100644 index 0000000000..c2891a05f4 --- /dev/null +++ b/ext/ext_skel.php @@ -0,0 +1,44 @@ +<?php +/* $Id$ */ + +/* + This script can be used on Win32 systems + + 1) Make sure you have CygWin installed + 2) Adjust the $cygwin_path to match your installation + 3) Change the environment cariable PATHEXT to include .PHP + 4) run ext_skel --ext_name=... + the first time you run this script you will be asked to + associate it with a program. chooses the CLI version of php. +*/ + +$cygwin_path = 'c:\cygwin\bin'; + +$path = getenv("PATH"); +putenv("PATH=$cygwin_path;$path"); + +array_shift($argv); +system("sh ext_skel " . implode(" ", $argv)); + +$extname = ""; +foreach($argv as $arg) { + if (strtolower(substr($arg, 0, 9)) == "--extname") { + $extname = substr($arg, 10); + } +} + +$fp = fopen("skeleton/skeleton.dsp", "rb"); +if ($fp) { + $dsp_file = fread($fp, filesize("skeleton/skeleton.dsp")); + fclose($fp); + + $dsp_file = str_replace("extname", $extname, $dsp_file); + $dsp_file = str_replace("EXTNAME", strtoupper($extname), $dsp_file); + $fp = fopen("$extname/$extname.dsp", "wb"); + if ($fp) { + fwrite($fp, $dsp_file); + fclose($fp); + } +} + +?>
\ No newline at end of file |