hmm.. the patch didn't seem to come thru... here it is... --- ext_skel.ORIG Mon Jul 15 08:58:08 2002 +++ ext_skel Mon Jul 15 10:42:30 2002 @@ -6,13 +6,14 @@ }
usage() { -echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]" +echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]] [--skel=dir]" echo " [--full-xml] [--no-help]" echo "" echo " --extname=module module is the name of your extension" echo " --proto=file file contains prototypes of functions to create" echo " --stubs=file generate only function stubs in file" echo " --xml generate xml documentation to be added to phpdoc-cvs" +echo " --skel=dir path to the skeleton directory" echo " --full-xml generate xml documentation for a self-contained extension" echo " (not yet implemented)" echo " --no-help don't try to be nice and create comments in the code" @@ -33,7 +34,7 @@ case $1 in --extname=?*) extname=$optarg - EXTNAME=`echo $extname | tr [a-z] [A-Z]` + EXTNAME=`echo $extname | tr "[:lower:]" "[:upper:]"` ;; --proto=?*) proto=$optarg @@ -54,6 +55,9 @@ --no-help) no_help="yes" ;; + --skel=?*) + skel_dir=$optarg + ;; *) usage ;; @@ -65,8 +69,16 @@ givup "Directory $extname already exists." fi -test -f ext_skel || givup "ext_skel must be in the current directory" -test -d skeleton || givup "subdirectory skeleton does not exist or is not directory" +if test -z "$skel_dir"; then + skel_dir="skeleton" +fi + +test -d $skel_dir || givup "$skel_dir must exist" +## convert skel_dir to full path +skel_dir=`cd $skel_dir && pwd` + +##test -f ext_skel || givup "ext_skel must be in the current directory" +test -d $skel_dir || givup "subdirectory $skel_dir does not exist or is not directory" if echo '\c' | grep -s c >/dev/null 2>&1 then @@ -84,7 +96,7 @@ fi if test -n "$proto"; then - cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f ./skeleton/create_stubs + cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f $skel_dir/create_stubs fi if test -z "$stubs"; then @@ -202,7 +214,7 @@ echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript fi -sed -f sedscript <../skeleton/skeleton.c > $extname.c +sed -f sedscript < $skel_dir/skeleton.c > $extname.c $ECHO_N " php_$extname.h$ECHO_C" @@ -220,26 +232,26 @@ echo 's/^\/\*.*\*\/$//' >> sedscript echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript fi -sed -f sedscript <../skeleton/php_skeleton.h > php_$extname.h +sed -f sedscript <$skel_dir/php_skeleton.h > php_$extname.h $ECHO_N " CREDITS$ECHO_C" echo "s/extname/$extname/g" > sedscript -sed -f sedscript <../skeleton/CREDITS > CREDITS +sed -f sedscript <$skel_dir/CREDITS > CREDITS $ECHO_N " EXPERIMENTAL$ECHO_C" echo "s/extname/$extname/g" > sedscript -sed -f sedscript <../skeleton/EXPERIMENTAL > EXPERIMENTAL +sed -f sedscript <$skel_dir/EXPERIMENTAL > EXPERIMENTAL $ECHO_N " tests/001.phpt$ECHO_C" mkdir tests || givup "Cannot create tests directory" chmod 755 tests -sed -f sedscript <../skeleton/tests/001.phpt > tests/001.phpt +sed -f sedscript <$skel_dir/tests/001.phpt > tests/001.phpt if test -z "$stubs" && test -z "$no_help"; then $ECHO_N " $extname.php$ECHO_C" sed \ -e "s/extname/$extname/g" \ - <../skeleton/skeleton.php \ + <$skel_dir/skeleton.php \ > $extname.php fi -----Original Message----- From: David Viner [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 10:48 AM To: [EMAIL PROTECTED] Subject: [PHP-DEV] patch for ext_skel here's a patch for ext_skel that allows you to run ext_skel from any directory. Essentially, this just allows the user to specify the location of the skeleton subdirectory. I'm a relative newbie to this mailing list, so if this is the wrong place, please let me know which php mailing list is the correct one. thanks dave -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php