diff options
33 files changed, 2 insertions, 4820 deletions
diff --git a/README.EXT_SKEL b/README.EXT_SKEL index afe03cb0df..261f72caf7 100644 --- a/README.EXT_SKEL +++ b/README.EXT_SKEL @@ -1,193 +1,2 @@ -(NOTE: you may also want to take a look at scripts/ext_skel_ng, - a PHP-only alternative for this script thats supposed - to replace it completely in the long run ...) - -WHAT IT IS - - It's a tool for automatically creating the basic framework for a PHP module - and writing C code handling arguments passed to your functions from a simple - configuration file. See an example at the end of this file. - -HOW TO USE IT - - Very simple. First, change to the ext/ directory of the PHP 4 sources. If - you just need the basic framework and will be writing all the code in your - functions yourself, you can now do - - ./ext_skel --extname=module_name - - and everything you need is placed in directory module_name. - - [ Note that GNU awk is likely required for this script to work. Debian - systems seem to default to using mawk, so you may need to change the - #! line in skeleton/create_stubs and the cat $proto | awk line in - ext_skel to use gawk explicitly. ] - - If you don't need to test the existence of any external header files, - libraries or functions in them, the module is already almost ready to be - compiled in PHP. Just remove 3 comments in your_module_name/config.m4, - change back up to PHP sources top directory, and do - - ./buildconf; ./configure --enable-module_name; make - - But if you already have planned the overall scheme of your module, what - functions it will contain, their return types and the arguments they take - (a very good idea) and don't want to bother yourself with creating function - definitions and handling arguments passed yourself, it's time to create a - function definitions file, which you will give as an argument to ext_skel - with option - - --proto=filename. - -FORMAT OF FUNCTION DEFINITIONS FILE - - All the definitions must be on one line. In it's simplest form, it's just - the function name, e.g. - - my_function - - but then you'll be left with an almost empty function body without any - argument handling. - - Arguments are given in parenthesis after the function name, and are of - the form 'argument_type argument_name'. Arguments are separated from each - other with a comma and optional space. Argument_type can be one of int, - bool, double, float, string, array, object or mixed. - - An optional argument is separated from the previous by an optional space, - then '[' and of course comma and optional space, like all the other - arguments. You should close a row of optional arguments with same amount of - ']'s as there where '['s. Currently, it does not harm if you forget to do it - or there is a wrong amount of ']'s, but this may change in the future. - - An additional short description may be added after the parameters. - If present it will be filled into the 'proto' header comments in the stubs - code and the <refpurpose> tag in the XML documentation. - - An example: - - my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st - - Arguments arg3 and arg4 are optional. - - If possible, the function definition should also contain it's return type - in front of the definition. It's not actually used for any C code generating - purposes but PHP in-source documentation instead, and as such, very useful. - It can be any of int, double, string, bool, array, object, resource, mixed - or void. - - The file must contain nothing else but function definitions, no comments or - empty lines. - -OTHER OPTIONS - - --no-help - - By default, ext_skel creates both comments in the source code and a test - function to help first time module writers to get started and testing - configuring and compiling their module. This option turns off all such things - which may just annoy experienced PHP module coders. Especially useful with - - --stubs=file - - which will leave out also all module specific stuff and write just function - stubs with function value declarations and passed argument handling, and - function entries and definitions at the end of the file, for copying and - pasting into an already existing module. - - --assign-params - --string-lens - - By default, function proto 'void foo(string bar)' creates the following: - ... - zval **bar; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar); - - Specifying both of these options changes the generated code to: - ... - zval **bar_arg; - int bar_len; - char *bar = NULL; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar_arg); - bar = Z_STRVAL_PP(bar_arg); - bar_len = Z_STRLEN_PP(bar_arg); - - You shouldn't have to ask what happens if you leave --string-lens out. If you - have to, it's questionable whether you should be reading this document. - - --with-xml[=file] - - Creates the basics for phpdoc .xml file. - - --full-xml - - Not implemented yet. When or if there will ever be created a framework for - self-contained extensions to use phpdoc system for their documentation, this - option enables it on the created xml file. - -CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES - - Only arguments of types int, bool, double, float, string and array are - handled. For other types you must write the code yourself. And for type - mixed, it wouldn't even be possible to write anything, because only you - know what to expect. - - It can't handle correctly, and probably never will, variable list of - of arguments. (void foo(int bar [, ...]) - - Don't trust the generated code too much. It tries to be useful in most of - the situations you might encounter, but automatic code generation will never - beat a programmer who knows the real situation at hand. ext_skel is generally - best suited for quickly generating a wrapper for c-library functions you - might want to have available in PHP too. - - This program doesn't have a --help option. It has --no-help instead. - -EXAMPLE - - The following _one_ line - - bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) - - will create this function definition for you (note that there are a few - question marks to be replaced by you, and you must of course add your own - value definitions too): - -/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) - */ -PHP_FUNCTION(my_drawtext) -{ - zval **image, **text, **font, **x, **y, **color; - int argc; - int image_id = -1; - int font_id = -1; - - argc = ZEND_NUM_ARGS(); - if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???_rsrc_id); - ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); - - switch (argc) { - case 6: - convert_to_long_ex(color); - /* Fall-through. */ - case 5: - convert_to_long_ex(y); - convert_to_long_ex(x); - /* font: fetching resources already handled. */ - convert_to_string_ex(text); - /* image: fetching resources already handled. */ - break; - default: - WRONG_PARAM_COUNT; - } - - php_error(E_WARNING, "my_drawtext: not yet implemented"); -} -/* }}} */ - +NOTE: ext_skel does no longer exist, it has been replaced + by the PEAR package PECL_Gen diff --git a/ext/ext_skel b/ext/ext_skel deleted file mode 100755 index 3abf341bdf..0000000000 --- a/ext/ext_skel +++ /dev/null @@ -1,284 +0,0 @@ -#!/bin/sh - -givup() { - echo $* - exit 1 -} - -usage() { -echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]" -echo " [--skel=dir] [--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" -echo " and helper functions to test if the module compiled" -exit 1 -} - -if test $# = 0; then - usage -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --extname=?*) - extname=$optarg - EXTNAME=`echo $extname | tr "[:lower:]" "[:upper:]"` - ;; - --proto=?*) - proto=$optarg - ;; - --stubs=*) - stubs=yes - stubfile=$optarg - ;; - --xml) - xml="yes" - ;; - --xml=?*) - xml=$optarg - ;; - --full-xml) - full_xml="yes" - ;; - --no-help) - no_help="yes" - ;; - --skel=?*) - skel_dir=$optarg - ;; - *) - usage - ;; - esac - shift -done - -if test -d "$extname" ; then - givup "Directory $extname already exists." -fi - -if test -z "$skel_dir"; then - skel_dir="skeleton" -fi - -## convert skel_dir to full path -skel_dir=`cd $skel_dir && pwd` - -test -d $skel_dir || givup "directory $skel_dir does not exist or is not directory" - -if echo '\c' | grep -s c >/dev/null 2>&1 -then - ECHO_N="echo -n" - ECHO_C="" -else - ECHO_N="echo" - ECHO_C='\c' -fi - -if test -z "$stubs"; then - echo "Creating directory $extname" - stubfile=$extname"/function_stubs" - mkdir $extname || givup "Cannot create directory $extname" -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 $skel_dir/create_stubs -fi - -if test -z "$stubs"; then - cd $extname - chmod 755 . - -$ECHO_N "Creating basic files:$ECHO_C" - -$ECHO_N " config.m4$ECHO_C" -cat >config.m4 <<eof -dnl \$Id\$ -dnl config.m4 for extension $extname - -dnl Comments in this file start with the string 'dnl'. -dnl Remove where necessary. This file will not work -dnl without editing. - -dnl If your extension references something external, use with: - -dnl PHP_ARG_WITH($extname, for $extname support, -dnl Make sure that the comment is aligned: -dnl [ --with-$extname Include $extname support]) - -dnl Otherwise use enable: - -dnl PHP_ARG_ENABLE($extname, whether to enable $extname support, -dnl Make sure that the comment is aligned: -dnl [ --enable-$extname Enable $extname support]) - -if test "\$PHP_$EXTNAME" != "no"; then - dnl Write more examples of tests here... - - dnl # --with-$extname -> check with-path - dnl SEARCH_PATH="/usr/local /usr" # you might want to change this - dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this - dnl if test -r \$PHP_$EXTNAME/\$SEARCH_FOR; then # path given as parameter - dnl ${EXTNAME}_DIR=\$PHP_$EXTNAME - dnl else # search default path list - dnl AC_MSG_CHECKING([for $extname files in default path]) - dnl for i in \$SEARCH_PATH ; do - dnl if test -r \$i/\$SEARCH_FOR; then - dnl ${EXTNAME}_DIR=\$i - dnl AC_MSG_RESULT(found in \$i) - dnl fi - dnl done - dnl fi - dnl - dnl if test -z "\$${EXTNAME}_DIR"; then - dnl AC_MSG_RESULT([not found]) - dnl AC_MSG_ERROR([Please reinstall the $extname distribution]) - dnl fi - - dnl # --with-$extname -> add include path - dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include) - - dnl # --with-$extname -> check for lib and symbol presence - dnl LIBNAME=$extname # you may want to change this - dnl LIBSYMBOL=$extname # you most likely want to change this - - dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, - dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) - dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) - dnl ],[ - dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) - dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm -ldl - dnl ]) - dnl - dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) - - PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared) -fi -eof - - -$ECHO_N " .cvsignore$ECHO_C" -cat >.cvsignore <<eof -.deps -*.lo -*.la -eof - -$ECHO_N " $extname.c$ECHO_C" -echo "s/extname/$extname/g" > sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_entries_here__/r function_entries' >> sedscript -echo '/__function_stubs_here__/r function_stubs' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_entries_here__/D' >> sedscript -echo '/__function_stubs_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo '/Remove the following/,/^\*\//D' >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi - -sed -f sedscript < $skel_dir/skeleton.c > $extname.c - - -$ECHO_N " php_$extname.h$ECHO_C" -echo "s/extname/$extname/g" > sedscript -echo "s/EXTNAME/$EXTNAME/g" >> sedscript -echo '/__function_declarations_here__/r function_declarations' >> sedscript -echo '/__header_here__/r ../../header' >> sedscript -echo '/__footer_here__/r ../../footer' >> sedscript -echo '/__function_declarations_here__/D' >> sedscript -echo '/__header_here__/D' >> sedscript -echo '/__footer_here__/D' >> sedscript -if [ ! -z "$no_help" ]; then - echo "/confirm_$extname_compiled/D" >> sedscript - echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript - echo 's/^\/\*.*\*\/$//' >> sedscript - echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript -fi -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 <$skel_dir/CREDITS > CREDITS - -$ECHO_N " EXPERIMENTAL$ECHO_C" -echo "s/extname/$extname/g" > sedscript -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 <$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" \ - <$skel_dir/skeleton.php \ - > $extname.php -fi - -rm sedscript - -if test -n "$proto"; then - if test -z "$stubs"; then - rm function_entries - rm function_declarations - rm function_stubs - fi - if test -f function_warning; then - rm function_warning - warning=" -NOTE! Because some arguments to functions were resources, the code generated -cannot yet be compiled without editing. Please consider this to be step 4.5 -in the instructions above. -" - fi -fi - -find . -type f | xargs chmod 644 -find . -type d | xargs chmod 755 -fi - -echo " [done]." - -if test -z "$no_help" && test -z "$stubs"; then - cat <<eof - -To use your new extension, you will have to execute the following steps: - -1. $ cd .. -2. $ vi ext/$extname/config.m4 -3. $ ./buildconf -4. $ ./configure --[with|enable]-$extname -5. $ make -6. $ ./php -f ext/$extname/$extname.php -7. $ vi ext/$extname/$extname.c -8. $ make - -Repeat steps 3-6 until you are satisfied with ext/$extname/config.m4 and -step 6 confirms that your module is compiled into PHP. Then, start writing -code and repeat the last two steps as often as necessary. -$warning -eof -fi diff --git a/ext/ext_skel_win32.php b/ext/ext_skel_win32.php deleted file mode 100644 index 5036ad21d8..0000000000 --- a/ext/ext_skel_win32.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/* $Id$ */ - -if (php_sapi_name() != "cli") { - echo "Please run this script using the CLI version of PHP\n"; - exit; -} -/* - 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 = ""; -$skel = "skeleton"; -foreach($argv as $arg) { - if (strtolower(substr($arg, 0, 9)) == "--extname") { - $extname = substr($arg, 10); - } - if (strtolower(substr($arg, 0, 6)) == "--skel") { - $skel = substr($arg, 7); - } -} - -$fp = fopen("$skel/skeleton.dsp", "rb"); -if ($fp) { - $dsp_file = fread($fp, filesize("$skel/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 diff --git a/ext/skeleton/CREDITS b/ext/skeleton/CREDITS deleted file mode 100644 index 58fc71019a..0000000000 --- a/ext/skeleton/CREDITS +++ /dev/null @@ -1 +0,0 @@ -extname
\ No newline at end of file diff --git a/ext/skeleton/EXPERIMENTAL b/ext/skeleton/EXPERIMENTAL deleted file mode 100644 index e69de29bb2..0000000000 --- a/ext/skeleton/EXPERIMENTAL +++ /dev/null diff --git a/ext/skeleton/create_stubs b/ext/skeleton/create_stubs deleted file mode 100755 index 61957289d0..0000000000 --- a/ext/skeleton/create_stubs +++ /dev/null @@ -1,289 +0,0 @@ -#!/usr/bin/awk -f - -function gobble(s, x) -{ - sub(/^ /, "", line) - match(line, "^" "(" s ")") - x = substr(line, 1, RLENGTH) - line = substr(line, RLENGTH+1) - return x -} - -function convert(i, j, t) -{ - type = argtypes[i,j] - name = argnames[i,j] - opt = optionals[i,j] - tabs = x = "" - - for (i = 0; i < t; i++) { tabs = tabs "\t" } - - if (type == "int" || type == "long") { - longs = longs "\tlong " name ";\n" - } else if (type == "bool" || type == "boolean") { - bools = bools "\tzend_bool " name ";\n" - } else if (type == "double" || type == "float") { - doubles = doubles "\tdouble " name ";\n" - } else if (type == "string") { - strings = strings "\tchar *" name " = NULL;\n" - ints = ints "\tint " name "_len;\n" - } else if (type == "array" || type == "object" || type == "mixed") { - zvals = zvals "\tzval *" name " = NULL;\n" - } else if (type == "resource" || type == "handle") { - zvals = zvals "\tzval *" name " = NULL;\n" - resources = resources "\tif (" name ") {\n" \ - "\t\tZEND_FETCH_RESOURCE(???, ???, " name ", " name "_id, \"???\", ???_rsrc_id);\n\t}\n" - ints = ints "\tint " name "_id = -1;\n" - } -} - -function comment(s) -{ - if (i_know_what_to_do_shut_up_i_dont_need_your_help_mode) { - return - } else { - return s - } -} - -BEGIN { - name = "[_A-Za-z][_A-Za-z0-9]*" - type = "int|long|double|float|string|bool|boolean|array|object|resource|handle|mixed|void" - spec = "l|l|d|d|s|b|b|a|o|r|r|z|" - num_funcs = 0 - -# create a map from type name to the spec - split(type, type_array, "\|") - split(spec, spec_array, "\|") - for (i in type_array) { - spec_map[type_array[i]] = spec_array[i] - } - - if (xml && xml != "yes") { - xmldoc = xml - } else { - xmldoc = extname "/" extname ".xml" - } - - - xmlhead = "<?xml version='1.0' encoding='iso-8859-1'?>\n" \ - "<!-- $Revision$ -->\n" \ - " <reference id=\"ref." extname "\">\n" \ - " <title> functions</title>\n" \ - " <titleabbrev></titleabbrev>\n\n" \ - " <partintro>\n" \ - " &warn.experimental;\n" \ - " <para>\n" \ - " </para>\n" \ - " </partintro>\n\n"; - - xmlfoot = " </reference>\n\n" \ - "<!-- Keep this comment at the end of the file\n" \ - "Local variables:\n" \ - "mode: sgml\n" \ - "sgml-omittag:t\n" \ - "sgml-shorttag:t\n" \ - "sgml-minimize-attributes:nil\n" \ - "sgml-always-quote-attributes:t\n" \ - "sgml-indent-step:1\n" \ - "sgml-indent-data:t\n" \ - "indent-tabs-mode:nil\n" \ - "sgml-parent-document:nil\n" \ - "sgml-default-dtd-file:\"../../manual.ced\"\n" \ - "sgml-exposed-tags:nil\n" \ - "sgml-local-catalogs:nil\n" \ - "sgml-local-ecat-files:nil\n" \ - "End:\n" \ - "vim600: syn=xml fen fdm=syntax fdl=2 si\n" \ - "vim: et tw=78 syn=sgml\n" \ - "vi: ts=1 sw=1\n" \ - "-->\n" -} - -{ - args_max = args_min = optional = i = spec_opt = 0 - line = $0 - spec_str = "\"" - -## php extension must use lower case function names. -## this will translate any capitalized letter to lowercase -## and warn the user - if (match(func_name,"[A-Z]") != 0) { - printf("NOTICE: lower casing function name '%s'\n",func_name) - func_name = tolower(func_name) - } - func_type = gobble(type); - func_name = gobble(name); - - if (gobble("\\(")) { - if (gobble("\\[")) optional = 1 - while (arg_type = gobble(type)) { - arg_name = gobble(name) - if(arg_type == "void") { - args_max = 0; - args_min = 0; - break; - } else { - argtypes[num_funcs,args_max] = arg_type - argnames[num_funcs,args_max] = arg_name - - args_max++ - if (optional) { - if (!spec_opt) { - spec_str = spec_str "|" - spec_opt = 1 - } - optionals[num_funcs,i] = optional - } else { - args_min++ - } - spec_str = spec_str spec_map[arg_type] - - if (x = gobble("\\[")) { - optional++ - } - - y = gobble(",") - if (!x && y && optional) { - grouped_optional_param[num_funcs,i] = 1 - } - i++ - } - } - } - -# if (x = gobble("\\)")) { - gobble("\\]* *\\)") - sub(/^[ \t]+/, "", line) - fcomments[num_funcs] = line -# } - - spec_str = spec_str "\"" - - funcs[num_funcs] = func_name - types[num_funcs] = func_type - maxargs[num_funcs] = args_max - minargs[num_funcs] = args_min - specs[num_funcs] = spec_str - spec_opts[num_funcs] = spec_opt - - num_funcs++ -} - -END { - if (xml) print xmlhead > xmldoc - for (i = 0; i < num_funcs; i++) { - compareargc = maxargs[i] - minargs[i] - closefetch = fetchargs = zvals = xmlparams = funcvals = resources = handleargs = closeopts = "" - ints = longs = doubles = strings = bools = zvals = "" - - proto = "/* {{{ proto " types[i] " " funcs[i] "(" - - refid = funcs[i] - gsub(/_/, "-", refid) - xmlstr = " <refentry id=\"function." refid "\">\n" \ - " <refnamediv>\n" \ - " <refname>" funcs[i] "</refname>\n" \ - " <refpurpose>" fcomments[i] "</refpurpose>\n" \ - " </refnamediv>\n" \ - " <refsect1>\n" \ - " <title>Description</title>\n" \ - " <funcsynopsis>\n" \ - " <funcprototype>\n" \ - " <funcdef>" types[i] " <function>" funcs[i] "</function></funcdef>\n" - - if (maxargs[i]>0) { - fetchargs = "\tif (zend_parse_parameters(" - ints = ints "\tint argc = ZEND_NUM_ARGS();\n" - fetchargs = fetchargs "argc TSRMLS_CC, " specs[i] - } else { - fetchargs = fetchargs "\tif (ZEND_NUM_ARGS() != 0) {\n\t\tWRONG_PARAM_COUNT;\n\t}" - xmlparams = xmlparams " <void/>\n" - } - - for (j = 0; j < maxargs[i]; j++) { - - fetchargs = fetchargs ", " - - fetchargs = fetchargs "&" argnames[i,j] - if (argtypes[i,j] == "string") { - fetchargs = fetchargs ", &" argnames[i,j] "_len" - } - - xmlparams = xmlparams " <paramdef>" argtypes[i,j] - if (j > minargs[i]-1) { - if (!grouped_optional_param[i,j-1]) { - if (j > 0) proto = proto " " - proto = proto "[" - closeopts = closeopts "]" - } - xmlparams = xmlparams "\n <parameter><optional>" \ - argnames[i,j] \ - "</optional></parameter>\n </paramdef>\n" - } else { - xmlparams = xmlparams \ - " <parameter>" \ - argnames[i,j] \ - "</parameter></paramdef>\n" - } - - if (j > 0) proto = proto ", " - proto = proto argtypes[i,j] " " argnames[i,j] - - convert(i, j, 1) - } - - proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i] ")\n{" - if (maxargs[i]>0) { - fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n" - } - funcvals = strings ints longs doubles bools zvals - xmlstr = xmlstr xmlparams \ - " </funcprototype>\n" \ - " </funcsynopsis>\n" \ - " &warn.experimental.func;\n" \ - " <para>\n" \ - " &warn.undocumented.func;\n" \ - " </para>\n" \ - " </refsect1>\n" \ - " </refentry>\n" - - print proto > stubfile - if (funcvals) print funcvals > stubfile - if (fetchargs) print fetchargs > stubfile - if (resources) { - print resources > stubfile - if (!stubs) print "" > extname "/function_warning" - } - if (!i_know_what_to_do_shut_up_i_dont_need_your_help_mode) { - print "\tphp_error(E_WARNING, \"" funcs[i] ": not yet implemented\");" > stubfile - } - print "}\n/* }}} */\n" > stubfile - - if (stubs) { - h_stubs = h_stubs "PHP_FUNCTION(" funcs[i] ");\n" - c_stubs = c_stubs "\tPHP_FE(" funcs[i] ",\tNULL)\n" - } else { - print "PHP_FUNCTION(" funcs[i] ");" > extname "/function_declarations" - print "\tPHP_FE(" funcs[i] ",\tNULL)" > extname "/function_entries" - } - - if (xml) print xmlstr > xmldoc - } - - if (stubs) { - print "\n/* ----------------------------------------------------------- */\n" > stubfile - print c_stubs > stubfile - print "\n/* ----------------------------------------------------------- */\n" > stubfile - print h_stubs > stubfile - } - - if (xml) print xmlfoot > xmldoc -} - -# -# Local variables: -# tab-width: 2 -# c-basic-offset: 2 -# End: - diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h deleted file mode 100644 index 76ad225754..0000000000 --- a/ext/skeleton/php_skeleton.h +++ /dev/null @@ -1,56 +0,0 @@ -/* __header_here__ */ - -#ifndef PHP_EXTNAME_H -#define PHP_EXTNAME_H - -extern zend_module_entry extname_module_entry; -#define phpext_extname_ptr &extname_module_entry - -#ifdef PHP_WIN32 -#define PHP_EXTNAME_API __declspec(dllexport) -#else -#define PHP_EXTNAME_API -#endif - -#ifdef ZTS -#include "TSRM.h" -#endif - -PHP_MINIT_FUNCTION(extname); -PHP_MSHUTDOWN_FUNCTION(extname); -PHP_RINIT_FUNCTION(extname); -PHP_RSHUTDOWN_FUNCTION(extname); -PHP_MINFO_FUNCTION(extname); - -PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ -/* __function_declarations_here__ */ - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(extname) - long global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(extname) -*/ - -/* In every utility function you add that needs to use variables - in php_extname_globals, call TSRM_FETCH(); after declaring other - variables used by that function, or better yet, pass in TSRMLS_CC - after the last function argument and declare your utility function - with TSRMLS_DC after the last declared argument. Always refer to - the globals in your function as EXTNAME_G(variable). You are - encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define EXTNAME_G(v) TSRMG(extname_globals_id, zend_extname_globals *, v) -#else -#define EXTNAME_G(v) (extname_globals.v) -#endif - -#endif /* PHP_EXTNAME_H */ - -/* __footer_here__ */ diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c deleted file mode 100644 index 021b76e789..0000000000 --- a/ext/skeleton/skeleton.c +++ /dev/null @@ -1,167 +0,0 @@ -/* __header_here__ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_extname.h" - -/* If you declare any globals in php_extname.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(extname) -*/ - -/* True global resources - no need for thread safety here */ -static int le_extname; - -/* {{{ extname_functions[] - * - * Every user visible function must have an entry in extname_functions[]. - */ -function_entry extname_functions[] = { - PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */ - /* __function_entries_here__ */ - {NULL, NULL, NULL} /* Must be the last line in extname_functions[] */ -}; -/* }}} */ - -/* {{{ extname_module_entry - */ -zend_module_entry extname_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif - "extname", - extname_functions, - PHP_MINIT(extname), - PHP_MSHUTDOWN(extname), - PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(extname), -#if ZEND_MODULE_API_NO >= 20010901 - "0.1", /* Replace with version number for your extension */ -#endif - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_EXTNAME -ZEND_GET_MODULE(extname) -#endif - -/* {{{ PHP_INI - */ -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("extname.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_extname_globals, extname_globals) - STD_PHP_INI_ENTRY("extname.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_extname_globals, extname_globals) -PHP_INI_END() -*/ -/* }}} */ - -/* {{{ php_extname_init_globals - */ -/* Uncomment this function if you have INI entries -static void php_extname_init_globals(zend_extname_globals *extname_globals) -{ - extname_globals->global_value = 0; - extname_globals->global_string = NULL; -} -*/ -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(extname) -{ - /* If you have INI entries, uncomment these lines - ZEND_INIT_MODULE_GLOBALS(extname, php_extname_init_globals, NULL); - REGISTER_INI_ENTRIES(); - */ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(extname) -{ - /* uncomment this line if you have INI entries - UNREGISTER_INI_ENTRIES(); - */ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request start */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(extname) -{ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request end */ -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(extname) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(extname) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "extname support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - - -/* Remove the following function when you have succesfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - -/* Every user-visible function in PHP should document itself in the source */ -/* {{{ proto string confirm_extname_compiled(string arg) - Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_extname_compiled) -{ - char *arg = NULL; - int arg_len, len; - char string[256]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) { - return; - } - - len = sprintf(string, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg); - RETURN_STRINGL(string, len, 1); -} -/* }}} */ -/* The previous line is meant for vim and emacs, so it can correctly fold and - unfold functions in source code. See the corresponding marks just before - function definition, where the functions purpose is also documented. Please - follow this convention for the convenience of others editing your code. -*/ - -/* __function_stubs_here__ */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/skeleton/skeleton.dsp b/ext/skeleton/skeleton.dsp deleted file mode 100644 index 5f84019f21..0000000000 --- a/ext/skeleton/skeleton.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="extname" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=extname - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak" CFG="extname - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "extname - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "extname - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "extname - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "extname - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/extname.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "extname - Win32 Release_TS"
-# Name "extname - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\extname.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_extname.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/skeleton/skeleton.php b/ext/skeleton/skeleton.php deleted file mode 100644 index 12e1e64bb4..0000000000 --- a/ext/skeleton/skeleton.php +++ /dev/null @@ -1,19 +0,0 @@ -<? -if(!extension_loaded('extname')) { - dl('extname.' . PHP_SHLIB_SUFFIX); -} -$module = 'extname'; -$functions = get_extension_funcs($module); -echo "Functions available in the test extension:<br>\n"; -foreach($functions as $func) { - echo $func."<br>\n"; -} -echo "<br>\n"; -$function = 'confirm_' . $module . '_compiled'; -if (extension_loaded($module)) { - $str = $function($module); -} else { - $str = "Module $module is not compiled into PHP"; -} -echo "$str\n"; -?> diff --git a/ext/skeleton/tests/001.phpt b/ext/skeleton/tests/001.phpt deleted file mode 100644 index 7ef8472db3..0000000000 --- a/ext/skeleton/tests/001.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -Check for extname presence ---SKIPIF-- -<?php if (!extension_loaded("extname")) print "skip"; ?> ---POST-- ---GET-- ---INI-- ---FILE-- -<?php -echo "extname extension is available"; -/* - you can add regression tests for your extension here - - the output of your test code has to be equal to the - text in the --EXPECT-- section below for the tests - to pass, differences between the output and the - expected text are interpreted as failure - - see php4/README.TESTING for further information on - writing regression tests -*/ -?> ---EXPECT-- -extname extension is available diff --git a/scripts/ext_skel_ng/BUGS b/scripts/ext_skel_ng/BUGS deleted file mode 100644 index 7577411252..0000000000 --- a/scripts/ext_skel_ng/BUGS +++ /dev/null @@ -1,2 +0,0 @@ -(just that this file is currently empty does not - prove that there are no bugs in this software ;)
\ No newline at end of file diff --git a/scripts/ext_skel_ng/README b/scripts/ext_skel_ng/README deleted file mode 100644 index 10d5cfd355..0000000000 --- a/scripts/ext_skel_ng/README +++ /dev/null @@ -1,36 +0,0 @@ -sorry, no real documentation yet ... -just a short look at what is going on - -ext_skel_ng.php gets an extension description -from an "extension.xml" file and generates working -code and documentation stubs from that - -call "php ext_skel_ng.php" to see it at work, -it will create a dummy extension including - -- module globals and ini paramter setup -- function registration and stubbs -- documentation framework -- config.m4 (only minimal for now) -- ... - -almost every aspect of an extension may now be -configured using one xml description file instead -of the old mixture of command line parameters -and a proto file - -it is even possible to embed function code into -the xml description right away, so it should be -possible to create complete working extensions -from just the xml description without further -editing in a not to distant future - -for now almost all the 'helpfull comments' have -been removed from the generated code. some of -them (like 'uncomment this if you have ini params) -just don't make sense anymore, others will come -back (configurable) at a later state - -... have fun! - -Hartmut Holzgraefe <hholzgra@php.net> diff --git a/scripts/ext_skel_ng/TODO b/scripts/ext_skel_ng/TODO deleted file mode 100644 index 5e8215f0fd..0000000000 --- a/scripts/ext_skel_ng/TODO +++ /dev/null @@ -1,35 +0,0 @@ -- *more* input checking - - XML level (libxml2 does cover all this?) - - needed attributes given - - tag nesting ok - - tags closed properly - - ... - - code level - - use of reserved names - - duplicate names - - ... - - ... -- config.m4 support for - - header checks - - ... -- class implementation and documentation support -- docbook namespace support -- protos - - object type specification (as in resources) - - default values (needs tokenizer/parser changes ...) - - code generation for 'pass by refecence' and 'return by reference' - - ? option for 'old style' parameter parsing code generation ? - (less readable but faster and more flexible) -- more licenses - - GPL (with exception to allow linking against PHP) - - QPL - - MPL? - - Artistic - - ... - - dual/multiple licensing? -- full support for stream wrappers and filters -- code generation for custom test tags -- XShema instead of DTD -- VC++ 7 (VS.net) project files -- create just function stubs instead of complete - extension (as supported by the old ext_skel) diff --git a/scripts/ext_skel_ng/config_m4.php b/scripts/ext_skel_ng/config_m4.php deleted file mode 100644 index af0a16d513..0000000000 --- a/scripts/ext_skel_ng/config_m4.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -class config_m4 { - # name, with[], libs[], language, files[] - var $name; - var $language = "c"; - var $with = false; - var $libs = array(); - var $files = array(); - - function __construct($name) { - $this->name = $name; - } - - function write_file() { - $upname = strtoupper($this->name); - - // CVS ID header - echo -'dnl -dnl $ Id: $ -dnl -'; - - } -} - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/dummy.gif b/scripts/ext_skel_ng/dummy.gif Binary files differdeleted file mode 100644 index e44ab4306a..0000000000 --- a/scripts/ext_skel_ng/dummy.gif +++ /dev/null diff --git a/scripts/ext_skel_ng/ext_skel_ng.php b/scripts/ext_skel_ng/ext_skel_ng.php deleted file mode 100644 index bb5e23b004..0000000000 --- a/scripts/ext_skel_ng/ext_skel_ng.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - $min_version = "5.0.0-dev"; - if (!function_exists("version_compare") || version_compare(phpversion(), $min_version) <0) { - die("need at least PHP version $min_version, you are running ".phpversion()); - } - - require_once "extension_parser.php"; - require_once "System.php"; - - // parse command line arguments - if (isset($_SERVER['argv'][1])) { - $filename = $_SERVER["argv"][1]; - echo "using '$filename' as specification file\n"; - } else { - $filename = "extension.xml"; - echo "using default file '$filename' as specification file\n"; - } - - // open specification file - $fp = fopen($filename, "r"); - if (!is_resource($fp)) { - error_log("can't read specification file '$filename'"); - exit; - } - - // parse specification file - $ext = new extension_parser($fp); - fclose($fp); - - // purge and create extension directory - System::rm("-rf {$ext->name}"); - mkdir($ext->name); - - // write LICENSE file - if(is_object($ext->license)) { - $ext->license->write_license_file("{$ext->name}/LICENSE"); - } - - // generate code - $ext->write_header_file(); - $ext->write_code_file(); - if (isset($ext->logo)) { - $fp = fopen("{$ext->name}/{$ext->name}_logo.h", "w"); - fwrite($fp, $ext->logo->h_code()); - fclose($fp); - } - - // generate project files for configure (unices and similar platforms like cygwin) - if ($ext->platform === "all" || in_array("unix", $ext->platform)) { - $ext->write_config_m4(); - } - - // generate project files for Windows platform (VisualStudio/C++ V6) - if ($ext->platform === "all" || in_array("win32", $ext->platform)) { - $ext->write_ms_devstudio_dsp(); - } - - // generate EXPERIMENTAL file for unstable release states - $ext->write_experimental(); - - // generate CREDITS file - $ext->write_credits(); - - // generate PEAR/PECL package.xml file - $ext->write_package_xml(); - - // generate DocBook XML documantation for PHP manual - $ext->generate_documentation(); - - // generate test case templates - $ext->write_test_files(); - -?> diff --git a/scripts/ext_skel_ng/extension.dtd b/scripts/ext_skel_ng/extension.dtd deleted file mode 100644 index bb8de1f493..0000000000 --- a/scripts/ext_skel_ng/extension.dtd +++ /dev/null @@ -1,126 +0,0 @@ -<!ELEMENT extension (name|summary|description|license|maintainers|logo|release|changelog|functions|constants|globals|deps|resources|code|streams|tests)*> - -<!ELEMENT name (#PCDATA)> - -<!ELEMENT summary (#PCDATA)> - -<!ELEMENT description (#PCDATA)> - -<!ELEMENT maintainers (maintainer)+> - -<!ELEMENT maintainer (user|role|name|email)*> - -<!ELEMENT logo (#PCDATA)> -<!ATTLIST logo - src CDATA #REQUIRED -> - -<!ELEMENT user (#PCDATA)> - -<!ELEMENT role (#PCDATA)> - -<!ELEMENT email (#PCDATA)> - -<!ELEMENT changelog (release)*> - -<!ELEMENT release (version|license|state|date|notes|filelist|deps)*> - -<!ELEMENT version (#PCDATA)> - -<!ELEMENT state (#PCDATA)> - -<!ELEMENT license (#PCDATA)> - -<!ELEMENT date (#PCDATA)> - -<!ELEMENT notes (#PCDATA)> - -<!ELEMENT functions (function)*> -<!ELEMENT function (summary|proto|description|code)*> -<!ATTLIST function - role (internal|private|public) "public" - name CDATA #REQUIRED -> -<!ELEMENT proto (#PCDATA)> -<!ELEMENT code (#PCDATA)> -<!ATTLIST code - role (header|code) "code" -> -<!ELEMENT constants (constant)*> -<!ELEMENT constant (#PCDATA)> -<!ATTLIST constant - name CDATA #REQUIRED - value CDATA #REQUIRED - type (string|int|float) "string" -> - -<!ELEMENT globals (phpini|global)*> -<!ELEMENT phpini (#PCDATA)> -<!ATTLIST phpini - name CDATA #REQUIRED - type CDATA #REQUIRED - value CDATA #REQUIRED - access (system|perdir|user|all) "all" - onupdate CDATA #IMPLIED -> -<!ELEMENT global (#PCDATA)> -<!ATTLIST global - name CDATA #REQUIRED - type CDATA #REQUIRED -> - -<!ELEMENT deps (with|lib|header|file|program)*> -<!ATTLIST deps - language (c|cpp) "c" - platform (unix|win32|all) "all" -> -<!ELEMENT with (#PCDATA)> -<!ATTLIST with - defaults CDATA #REQUIRED - testfile CDATA #REQUIRED - name CDATA #IMPLIED -> -<!ELEMENT lib (#PCDATA)> -<!ATTLIST lib - name CDATA #REQUIRED - function CDATA #REQUIRED - searchpath CDATA #IMPLIED - platform (unix|win32|all) "all" -> -<!ELEMENT header (#PCDATA)> -<!ATTLIST header - name CDATA #REQUIRED - function CDATA #IMPLIED - searchpath CDATA #IMPLIED - prepend (yes|no) "no" -> - -<!ELEMENT resources (resource)*> -<!ELEMENT resource (description?, destruct?)> -<!ATTLIST resource - name CDATA #REQUIRED - payload CDATA #IMPLIED - alloc (yes|no) "no" -> -<!ELEMENT destruct (#PCDATA)> - -<!ELEMENT streams (stream)*> -<!ELEMENT stream (description?, ops?, data?)> -<!ATTLIST stream - name CDATA #REQUIRED -> -<!ELEMENT ops (op)*> -<!ELEMENT op (#PCDATA)> -<!ATTLIST op - name CDATA #REQUIRED -> - - -<!ELEMENT tests (test)*> -<!ELEMENT test (title, skipif?, post?, get?, code, output)> -<!ELEMENT title (#PCDATA)> -<!ELEMENT skipif (#PCDATA)> -<!ELEMENT post (#PCDATA)> -<!ELEMENT get (#PCDATA)> -<!ELEMENT code (#PCDATA)> -<!ELEMENT output (#PCDATA)> diff --git a/scripts/ext_skel_ng/extension.xml b/scripts/ext_skel_ng/extension.xml deleted file mode 100644 index 03603bbd6d..0000000000 --- a/scripts/ext_skel_ng/extension.xml +++ /dev/null @@ -1,178 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE extension SYSTEM "extension.dtd"> -<extension> - <name>dummy</name> - <summary>experimental dummy extension</summary> - <description> - this is used for testing of the extension generater only - </description> - - <maintainers> - <maintainer> - <user>hholzgra</user> - <name>Hartmut Holzgraefe</name> - <email>hholzgra@php.net</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>dummy</user> - <name>Crashtest Dummy</name> - <email>dummy@example.com</email> - <role>dummy</role> - </maintainer> - </maintainers> - - <logo src='dummy.gif'></logo> - - <release> - <version>0.1</version> - <date>2002-02-16</date> - <state>alpha</state> - <license>php</license> - <notes> - - first experimental draft - </notes> - </release> - - <changelog> - </changelog> - - - <deps language="c"> - <!-- these are not yet used in any way :( --> - <with defaults='/usr:/usr/local' testfile='include/dummy.h'></with> - <lib name='dummy' function='dummy' searchpath='/usr/lib:/lib'></lib> - </deps> - - <constants> - <constant name="DUMMY_OK" type="int" value="1">dummy ok status</constant> - <constant name="DUMMY_ERR" type="int" value="0">dummy fault status</constant> - </constants> - - <globals> - <global name="foobar" type="int"></global> - <phpini name="foo_int" type="int" value="42" access="system">some int value</phpini> - <phpini name="foo_bool" type="int" value="on" access="all" onupdate="OnUpdateBool"></phpini> - <phpini name="foo_string" type="string" value="foobar" access="all" ></phpini> - </globals> - - <resources> - <resource name="dummy_resource" payload="char *"> - <description> - a dummy string resource - </description> - <destruct> -<![CDATA[ - free(resource); -]]> - </destruct> - </resource> - <resource name="dummy_resource2"> - </resource> - </resources> - - - <functions> - - <function role='internal' name='MINIT'> - <code> -<![CDATA[ - int dummy = 42; - - dummy = dummy; -]]> - </code> - </function> - - <function role='internal' name='MSHUTDOWN'> - <code> -<![CDATA[ - int dummy = 42; - - dummy = dummy; -]]> - </code> - </function> - - <function role='internal' name='RINIT'> - <code> -<![CDATA[ - int dummy = 42; - - dummy = dummy; -]]> - </code> - </function> - - <function role='internal' name='RSHUTDOWN'> - <code> -<![CDATA[ - int dummy = 42; - - dummy = dummy; -]]> - </code> - </function> - - <function role='internal' name='MINFO'> - <code> -<![CDATA[ - php_info_print_table_start(); - php_info_print_table_header(2, "test", "table"); - php_info_print_table_end(); -]]> - </code> - </function> - - <function role='private' name='myfunc'> - <code> -<![CDATA[ - static int myfunc(void) { - return 23; - } -]]> - </code> - </function> - - - <function role='public' name='dummy_int'> - <summary>dummy integer conversion</summary> - <proto>int dummy_int(int bar)</proto> - <description> -some funcy longer description - -foo -bar - </description> - </function> - - <function role='public' name='dummy_resource'> - <summary>dummy resource test</summary> - <proto>resource dummy_resource(resource bar)</proto> - </function> - - <function name='dummy_string'> - <summary>dummy string conversion</summary> - <proto>string dummy_string(string bar) foobar</proto> - <code> -<![CDATA[ - RETURN_STRINGL(bar, bar_len, 1); -]]> - </code> - </function> - - <function name="dummy_void"> - <proto>void dummy_void(void)</proto> - </function> - - <function name="dummy_void2"> - <proto>void dummy_void2()</proto> - </function> - - <function name="dummy_stream"> - <proto>stream dummy_stream(stream s)</proto> - </function> - - </functions> - -</extension>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/extension_parser.php b/scripts/ext_skel_ng/extension_parser.php deleted file mode 100644 index 30793a3407..0000000000 --- a/scripts/ext_skel_ng/extension_parser.php +++ /dev/null @@ -1,1395 +0,0 @@ -<?php - // {{{ includes - - require_once "php_element.php"; - require_once "php_constant.php"; - require_once "php_function.php"; - require_once "php_resource.php"; - require_once "php_ini.php"; - require_once "php_global.php"; - require_once "php_logo.php"; - - require_once "license.php"; - - require_once "xml_stream_parser.php"; - require_once "xml_stream_callback_parser.php"; - - // }}} - - class extension_parser extends xml_stream_callback_parser { - - // {{{ constructor - - function __construct($stream) { - $this->name = "extension"; - - $this->release = array("version" => "unknown", - "date" => date("Y-m-d"), - "state" => "", - "license" => "unknown", - "notes" => "", - ); - - $this->constants = array(); - $this->resources = array(); - $this->streams = array(); - $this->functions = array(); - $this->internal_functions = array(); - $this->private_functions = array(); - $this->globals = array(); - $this->phpini = array(); - $this->users = array(); - $this->dependson = array(); - $this->code = array(); - $this->libs = array(); - $this->headers = array(); - $this->language = "c"; - $this->platform = "all"; - - $this->files = array("c" => array(), - "h" => array(), - "conf" => array(), - "doc" => array() - ); - - parent::__construct($stream); - } - - // }}} - - // {{{ helper methods - - function _check_c_name($name, $msg) { - if (!ereg("^[[:alpha:]_][[:alnum:]_]*$", $name)) { - $this->error("$name is not a valid $msg"); - } - } - - function _trimdata() { - $text = preg_replace('|^\s*\n|m','', $this->cdata); - $text = preg_replace('|\n\s*$|m',"\n", $text); - return $text; - } - - - // }}} - - // {{{ parsing - - // {{{ general infos - function handle_extension_name($attr) { - $this->name = trim($this->cdata); - $this->_check_c_name($this->name, "extension name"); - } - - function handle_extension_summary($attr) { - $this->summary = trim($this->cdata); - } - - function handle_extension_description($attr) { - $this->description = $this->_trimdata(); - } - - function handle_extension_logo($attr) { - $this->logo = new php_logo($this->name, $attr); - } - - - function handle_release_version($attr) { - $this->release['version'] = trim($this->cdata); - } - - function handle_release_state($attr) { - $this->release['state'] = trim($this->cdata); - } - - function handle_release_license($attr) { - $this->release['license'] = trim($this->cdata); - $this->license = license::factory($this->release['license']); - if (is_object($this->license)) { - $this->license->write_license_file(); - $this->files['doc'][] = "LICENSE"; - } - } - - function handle_release_notes($attr) { - $this->release['notes'] = trim($this->cdata); - } - - function handle_maintainers_maintainer_user($attr) { - $this->user["user"] = trim($this->cdata); - } - - function handle_maintainers_maintainer_name($attr) { - $this->user["name"] = trim($this->cdata); - } - - function handle_maintainers_maintainer_email($attr) { - $this->user["email"] = trim($this->cdata); - } - - function handle_maintainers_maintainer_role($attr) { - $this->user["role"] = trim($this->cdata); - } - - function handle_maintainers_maintainer($attr) { - $this->users[$this->user["name"]] = $this->user; - unset($this->user); - } - - - - // }}} - - // {{{ dependencies - - function handle_deps($attr) { - if (isset($attr["language"])) $this->language = $attr["language"]; - if (isset($attr['platform'])) { - if ($attr['platform'] != "all") { - $this->platform = split("[[:space:]]*,[[:space:]]*", trim($attr['platform'])); - } - } else { - $this->platform = "all"; - } - } - - function handle_deps_lib($attr) { - $this->libs[$attr['name']] = $attr; - if (isset($attr['platform'])) { - if ($attr['platform'] != "all") { - $this->libs[$attr['name']]['platform'] = split("[[:space:]]*,[[:space:]]*", trim($attr['platform'])); - } - } else { - $this->libs[$attr['name']]['platform'] = "all"; - } - } - - function handle_deps_header($attr) { - $this->headers[$attr['name']] = $attr; - } - - function handle_deps_with($attr) { - $this->with = array(); - $this->with['attr'] = $attr; - $this->with['desc'] = trim($this->cdata); - } - - // }}} - - // {{{ constants - - function handle_constants_constant($attr) { - $constant = new php_constant($attr, $this->_trimdata); - if (isset($constant->error)) { - $this->error($constant->error); - } - $this->constants[$attr['name']] = $constant; - } - - // }}} - - // {{{ streams - function hamdle_steams($attr) { - } - - function hamdle_steams_stream($attr) { - $this->streams[$attr['name']] = new php_stream($attr, $this->stream_data); - unset($this->stream_data); - } - - function hamdle_steams_stream_description($attr) { - $this->stream_data['desc'] = $this->_trimdata; - } - - function hamdle_steams_stream_ops($attr) { - } - - function hamdle_steams_stream_ops_op($attr) { - } - - function hamdle_steams_stream_data($attr) { - } - // }}} - - // {{{ resources - - function handle_resources_resource_destruct($attr) { - $this->resource_destruct = $this->_trimdata(); - } - - function handle_resources_resource_description($attr) { - $this->resource_description = $this->_trimdata(); - } - - function handle_resources_resource($attr) { - $resource = new php_resource($attr, - @$this->resource_destruct, - @$this->resource_description - ); - - if (isset($resource->error)) { - $this->error($resource->error); - } - - $this->resources[$attr['name']] = $resource; - unset($this->resource_description); - unset($this->resource_destruct); - } - - // }}} - - // {{{ functions - - function handle_functions_function_summary($attr) { - $this->func_summary = trim($this->cdata); - } - - function handle_functions_function_proto($attr) { - $this->func_proto = trim($this->cdata); - } - - function handle_functions_function_description($attr) { - $this->func_desc = $this->_trimdata(); - } - - function handle_functions_function_code($attr) { - $this->func_code = $this->_trimdata(); - } - - function handle_code($attr) { - $this->code[$attr["role"]][] = $this->_trimdata(); - } - - function handle_functions_function($attr) { - $this->_check_c_name($attr['name'], "function name"); - - $role = isset($attr['role']) ? $attr['role'] : "public"; - $function = new php_function($attr['name'], - @$this->func_summary, - @$this->func_proto, - @$this->func_desc, - @$this->func_code, - $role); - - switch ($role) { - case "internal": - $this->internal_functions[$attr['name']] = $function; - break; - case "private": - $this->private_functions[$attr['name']] = $function; - break; - case "public": - if (is_string($function->status)) $this->error($function->status." in prototype"); - $this->functions[$attr['name']] = $function; - break; - default: - $this->error("function role must be either public, private or internal"); - break; - } - - unset($this->func_summary); - unset($this->func_proto); - unset($this->func_desc); - unset($this->func_code); - } - - // }}} - - // {{{ globals and php.ini - - function handle_globals_global($attr) { - $this->globals[$attr["name"]] = new php_global($attr); - if (isset($this->globals[$attr["name"]]->error)) { - $this->error($this->globals[$attr["name"]]->error); - } - } - - function handle_globals_phpini($attr) { - $attr["desc"] = $this->_trimdata(); - - $ini = new php_ini($attr); - if (isset($ini->error)) { - $this->error($ini->error); - } - $this->phpini[$attr['name']] = $ini; - - // php.ini settings are stored in modul-global variables - $attr['type'] = $ini->c_type; - $global = new php_global($attr); - $this->globals[$attr["name"]] = $global; - if (isset($global->error)) { - $this->error($global->error); - } - } - - // }}} - - // {{{ Tests - function handle_tests_test($attr) { - } - - function handle_tests_test_title($attr) { - } - - function handle_tests_test_skipif($attr) { - } - - function handle_tests_test_post($attr) { - } - - function handle_tests_test_get($attr) { - } - - function handle_tests_test_code($attr) { - } - - function handle_tests_test_output($attr) { - } - - // }}} - - // }}} - - // {{{ output generation - - // {{{ docbook documentation - - function generate_documentation() { - $id_name = str_replace('_', '-', $this->name); - - mkdir("{$this->name}/manual"); - - $docdir = "{$this->name}/manual/$id_name"; - mkdir($docdir); - - $fp = fopen("$docdir/reference.xml", "w"); - fputs($fp, -"<?xml version='1.0' encoding='iso-8859-1'?> -<!-- ".'$'."Revision: 1.1 $ --> - <reference id='ref.$id_name'> - <title>{$this->summary}</title> - <titleabbrev>$id_name</titleabbrev> - - <partintro> - <section id='$id_name.intro'> - &reftitle.intro; - <para> -{$this->description} - </para> - </section> - - <section id='$id_name.requirements'> - &reftitle.required; - <para> - </para> - </section> - - &reference.$id_name.configure; - - <section id='$id_name.resources'> - &reftitle.resources; -"); - - if (empty($this->resources)) { - fputs($fp, " &no.resource;\n"); - } else { - foreach ($this->resources as $resource) { - fputs($fp, $resource->docbook_xml($this->name)); - } - } - - - fputs($fp, -" </section> - - <section id='$id_name.constants'> - &reftitle.constants; -"); - - if (empty($this->constants)) { - fputs($fp, " &no.constants;\n"); - } else { - fputs($fp, php_constant::docbook_xml_header($id_name)); - - foreach ($this->constants as $constant) { - fputs($fp, $constant->docbook_xml($this->name)); - } - - fputs($fp, php_constant::docbook_xml_footer()); - } - fputs($fp, -" </section> - - </partintro> - -&reference.$id_name.functions; - - </reference> -"); - fputs($fp, php_element::docbook_editor_settings()); - - fclose($fp); - - // configure options and dependencies have their own file - $fp = fopen("$docdir/configure.xml","w"); - - fputs($fp,"\n <section id='$id_name.requirements'>\n &reftitle.required;\n"); - if (empty($this->libs) && empty($this->headers)) { - fputs($fp, " &no.requirement;\n"); - } else { - // TODO allow custom text - if (isset($this->libs)) { - $libs = array(); - foreach ($this->libs as $lib) { - $libs[] = $lib['name']; - } - $ies = count($libs)>1 ? "ies" :"y"; - fputs($fp, "<para>This extension requires the following librar$ies: ".join(",", $libs)."</para>\n"); - } - if (isset($this->headers)) { - $headers = array(); - foreach ($this->headers as $header) { - $headers[] = $header['name']; - } - $s = count($headers)>1 ? "s" : ""; - fputs($fp, "<para>This extension requires the following header$s: ".join(",", $headers)."</para>\n"); - } - } - fputs($fp, "\n </section>\n\n"); - - fputs($fp,"\n <section id='$id_name.install'>\n &reftitle.install;\n"); - if (empty($this->with)) { - fputs($fp, " &no.install;\n"); - } else { - if (isset($this->with['desc'])) { - if (strstr($this->with['desc'], "<para>")) { - fputs($fp, $this->with['desc']); - } else { - fputs($fp, " <para>\n".rtrim($this->with['desc'])."\n </para>\n"); - } - } else { - // TODO default text - } - } - fputs($fp, "\n </section>\n\n"); - - fputs($fp,"\n <section id='$id_name.configuration'>\n &reftitle.runtime;\n"); - if (empty($this->phpini)) { - fputs($fp, " &no.config;\n"); - } else { - fputs($fp, php_ini::docbook_xml_header($this->name)); - foreach ($this->phpini as $phpini) { - fputs($fp, $phpini->docbook_xml()); - } - fputs($fp, php_ini::docbook_xml_footer()); - } - fputs($fp, "\n </section>\n\n"); - - fputs($fp, php_element::docbook_editor_settings()); - fclose($fp); - - mkdir("$docdir/functions"); - foreach ($this->functions as $name => $function) { - $filename = $docdir . "/functions/" . strtolower(str_replace("_", "-", $name)) . ".xml"; - $funcfile = fopen($filename, "w"); - fputs($funcfile, $function->docbook_xml()); - fclose($funcfile); - } - } - - // }}} - - // {{{ extension entry - - function generate_extension_entry() { - $name = $this->name; - $upname = strtoupper($this->name); - - $code = " -/* {{{ {$name}_module_entry - */ -zend_module_entry {$name}_module_entry = { - STANDARD_MODULE_HEADER, - \"$name\", - {$name}_functions, - PHP_MINIT($name), /* Replace with NULL if there is nothing to do at php startup */ - PHP_MSHUTDOWN($name), /* Replace with NULL if there is nothing to do at php shutdown */ - PHP_RINIT($name), /* Replace with NULL if there is nothing to do at request start */ - PHP_RSHUTDOWN($name), /* Replace with NULL if there is nothing to do at request end */ - PHP_MINFO($name), - \"".$this->release['version']."\", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -"; - - $code .= "#ifdef COMPILE_DL_$upname\n"; - if ($this->language == "cpp") $code .= "extern \"C\" {\n"; - $code .= "ZEND_GET_MODULE($name)\n"; - if ($this->language == "cpp") $code .= "}\n"; - $code .= "#endif\n\n"; - - return $code; - } - - // }}} - - // {{{ globals and ini - - function generate_globals_c() { - if (empty($this->globals)) return ""; - - $code = "ZEND_DECLARE_MODULE_GLOBALS({$this->name})\n\n"; - - if (!empty($this->phpini)) { - $code .= php_ini::c_code_header($this->name); - foreach ($this->phpini as $phpini) { - $code .= $phpini->c_code($this->name); - } - $code .= php_ini::c_code_footer(); - } - - if (!empty($this->globals)) { - $code .= php_global::c_code_header($this->name); - foreach ($this->globals as $global) { - $code .= $global->c_code($this->name); - } - $code .= php_global::c_code_footer($this->name); - } - - return $code; - } - - function generate_globals_h() { - if (empty($this->globals)) return ""; - - $code = php_global::h_code_header($this->name); - foreach ($this->globals as $global) { - $code .= $global->h_code($this->name); - } - $code .= php_global::h_code_footer($this->name); - - return $code; - } - - // }}} - - // {{{ license and authoers - - function get_license() { - - $code = "/*\n"; - $code.= " +----------------------------------------------------------------------+\n"; - - if (is_object($this->license)) { - $code.= $this->license->license_comment(); - } else { - $code.= sprintf(" | unkown license: %-52s |\n", $this->release['license']); - } - - $code.= " +----------------------------------------------------------------------+\n"; - $prefix = "Authors: "; - foreach ($this->users as $name => $user) { - $code .= sprintf(" | $prefix %-58s |\n", "$user[name] <$user[email]>"); - $prefix = str_repeat(" ",strlen($prefix)); - } - $code.= " +----------------------------------------------------------------------+\n"; - $code.= "*/\n\n"; - - $code.= "/* $ Id: $ */ \n\n"; - - return $code; - } - - // }}} - - // {{{ editor config footer - - function editor_config_c() { - return ' -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ -'; - } - - // }}} - - // {{{ header file - - function write_header_file() { - $filename = "php_{$this->name}.h"; - - $this->files["h"][] = $filename; - $fp = fopen("{$this->name}/$filename", "w"); - - $upname = strtoupper($this->name); - - fputs($fp, $this->get_license()); - fputs($fp, "#ifndef PHP_{$upname}_H\n"); - fputs($fp, "#define PHP_{$upname}_H\n\n"); - - if (isset($this->headers)) { - foreach ($this->headers as $header) { - if (@$header["prepend"] === "yes") { - fputs($fp, "#include <$header[name]>\n"); - } - } - } - - if ($this->language == "cpp") { - fputs($fp, "extern \"C\" {\n"); - } - - fputs($fp, ' -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifdef HAVE_'.$upname.' - -#include <php.h> -#include <php_ini.h> -#include <SAPI.h> -#include <ext/standard/info.h> - -'); - - if ($this->language == "cpp") { - fputs($fp, "}\n"); - } - - if (isset($this->headers)) { - foreach ($this->headers as $header) { - if (@$header["prepend"] !== "yes") { - fputs($fp, "#include <$header[name]>\n"); - } - } - } - - if (isset($this->code["header"])) { - foreach ($this->code["header"] as $code) { - fputs($fp, $code); - } - } - - fputs($fp, " -extern zend_module_entry {$this->name}_module_entry; -#define phpext_{$this->name}_ptr &{$this->name}_module_entry - -#ifdef PHP_WIN32 -#define PHP_{$upname}_API __declspec(dllexport) -#else -#define PHP_{$upname}_API -#endif - -PHP_MINIT_FUNCTION({$this->name}); -PHP_MSHUTDOWN_FUNCTION({$this->name}); -PHP_RINIT_FUNCTION({$this->name}); -PHP_RSHUTDOWN_FUNCTION({$this->name}); -PHP_MINFO_FUNCTION({$this->name}); - -#ifdef ZTS -#include \"TSRM.h\" -#endif - -"); - - fputs($fp, $this->generate_globals_h()); - - fputs($fp, "\n"); - - foreach ($this->functions as $name => $function) { - fputs($fp, "PHP_FUNCTION($name);\n"); - } - - fputs($fp, "\n"); - - fputs($fp, "#endif /* PHP_HAVE_{$upname} */\n\n"); - fputs($fp, "#endif /* PHP_{$upname}_H */\n\n"); - - fputs($fp, $this->editor_config_c()); - - fclose($fp); - } - - // }}} - - // {{{ internal functions - - function internal_functions_c() { - $need_block = false; - - $code = " -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION({$this->name}) -{ -"; - - if (count($this->globals)) { - $code .= "\tZEND_INIT_MODULE_GLOBALS({$this->name}, php_{$this->name}_init_globals, php_{$this->name}_shutdown_globals)\n"; - $need_block = true; - } - - if (count($this->phpini)) { - $code .= "\tREGISTER_INI_ENTRIES();\n"; - $need_block = true; - } - - if (isset($this->logo)) { - $code .= $this->logo->minit_code(); - $need_block = true; - } - - if (count($this->constants)) { - foreach ($this->constants as $constant) { - $code .= $constant->c_code(); - } - $need_block = true; - } - - if (count($this->resources)) { - foreach ($this->resources as $resource) { - $code .= $resource->minit_code(); - } - $need_block = true; - } - - if (isset($this->internal_functions['MINIT'])) { - if ($need_block) $code .= "\n\t{\n"; - $code .= $this->internal_functions['MINIT']->code; - if ($need_block) $code .= "\n\t}\n"; - } else { - $code .="\n\t/* add your stuff here */\n"; - } - $code .= " - return SUCCESS; -} -/* }}} */ - -"; - - $code .= " -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION({$this->name}) -{ -"; - - if (count($this->phpini)) { - $code .= "\tUNREGISTER_INI_ENTRIES();\n"; - } - - if (isset($this->internal_functions['MSHUTDOWN'])) { - if (count($this->phpini)) $code .= "\n\t{\n"; - $code .= $this->internal_functions['MSHUTDOWN']->code; - if (count($this->phpini)) $code .= "\n\t}\n"; - } else { - $code .="\n\t/* add your stuff here */\n"; - } - - $code .= " - return SUCCESS; -} -/* }}} */ - -"; - - $code .= " -/* {{{ PHP_RINIT_FUNCTION */ -PHP_RINIT_FUNCTION({$this->name}) -{ -"; - - if (isset($this->internal_functions['RINIT'])) { - $code .= $this->internal_functions['RINIT']->code; - } else { - $code .= " /* add your stuff here */\n"; - } - - $code .= " -\treturn SUCCESS; -} -/* }}} */ - -"; - - $code .= " -/* {{{ PHP_RSHUTDOWN_FUNCTION */ -PHP_RSHUTDOWN_FUNCTION({$this->name}) -{ -"; - - if (isset($this->internal_functions['RSHUTDOWN'])) { - $code .= $this->internal_functions['RSHUTDOWN']->code; - } else { - $code .= " /* add your stuff here */\n"; - } - - $code .= " -\treturn SUCCESS; -} -/* }}} */ - -"; - - $code .= " -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION({$this->name}) -{ - php_info_print_box_start(0); -"; - - if (isset($this->logo)) - { - $code.= " - php_printf(\"<img src='\"); - if (SG(request_info).request_uri) { - php_printf(\"%s\", (SG(request_info).request_uri)); - } - php_printf(\"?=%s\", ".($this->logo->id)."); - php_printf(\"' align={'right' alt='image' border='0'>\\n\"); - -"; - } - - if (isset($this->summary)) { - $code .= " php_printf(\"<p>".str_replace('"','\\"',$this->summary)."</p>\\n\");\n"; - } - if (isset($this->release)) { - $code .= " php_printf(\"<p>Version {$this->release['version']}{$this->release['state']} ({$this->release['date']})</p>\\n\");\n"; - } - - if (count($this->users)) { - $code .= " php_printf(\"<p><b>Authors:</b></p>\\n\");\n"; - foreach ($this->users as $user) { - $code .= " php_printf(\"<p>$user[name] <$user[email]> ($user[role])</p>\\n\");\n"; - } - } - - $code.= -" php_info_print_box_end(); -"; - - if (isset($this->internal_functions['MINFO'])) { - $code .= "\n\t{\n"; - $code .= $this->internal_functions['MINFO']->code; - $code .= "\n\t}\n"; - } else { - $code .= "\t/* add your stuff here */\n"; - } - - -if (count($this->phpini)) { - $code .= "\n\tDISPLAY_INI_ENTRIES();"; -} -$code .= " -} -/* }}} */ - -"; - - return $code; - } - - // }}} - - - function private_functions_c() { - $code = ""; - - foreach ($this->private_functions as $name => $func) { - $code .= "\n\t/* {{{ $name() */\n{$func->code}\n\t/* }}} */\n\n"; - } - - return $code; - } - - // {{{ public functions - - function public_functions_c() { - $code = ""; - - foreach ($this->functions as $function) { - $code .= $function->c_code(&$this); - } - - return $code; - } - - // }}} - - - // {{{ code file - - function write_code_file() { - $filename = "{$this->name}.{$this->language}"; // todo extension logic - - $this->files["c"][] = $filename; - $fp = fopen("{$this->name}/$filename", "w"); - - $upname = strtoupper($this->name); - - fputs($fp, $this->get_license()); - - fputs($fp, "#include \"php_{$this->name}.h\"\n\n"); - - if (isset($this->logo)) { - fputs($fp, $this->logo->c_code()); - } - - if (!empty($this->globals)) { - fputs($fp, "ZEND_DECLARE_MODULE_GLOBALS({$this->name})\n\n"); - } - - fputs($fp, $this->private_functions_c()); - - if (!empty($this->resources)) { - foreach ($this->resources as $resource) { - fputs($fp, $resource->c_code()); - } - } - - fputs($fp, "/* {{{ {$this->name}_functions[] */\n"); - fputs($fp, "function_entry {$this->name}_functions[] = {\n"); - foreach ($this->functions as $name => $function) { - fputs($fp, sprintf("\tPHP_FE(%-20s, NULL)\n",$name)); - } - fputs($fp, "\t{ NULL, NULL, NULL }\n"); - fputs($fp, "};\n/* }}} */\n\n"); - - fputs($fp, $this->generate_extension_entry()); - - fputs($fp, "\n/* {{{ globals and ini entries */\n"); - fputs($fp, $this->generate_globals_c()); - fputs($fp, "/* }}} */\n\n"); - - fputs($fp, $this->internal_functions_c()); - - fputs($fp, $this->public_functions_c()); - - fputs($fp, $this->editor_config_c()); - } - - // }}} - - - // {{{ config.m4 file - function write_config_m4() { - $upname = strtoupper($this->name); - - ob_start(); - - echo -'dnl -dnl $ Id: $ -dnl -'; - - if (isset($this->with['attr'])) { - echo " -PHP_ARG_WITH({$this->name}, whether to enable {$this->name} functions, -[ --with-{$this->name}[=DIR] With {$this->name} support], yes) -"; - - echo " -if test \"\$PHP_$upname\" != \"no\"; then - if test -r \"\$PHP_$upname/{$this->with['attr']['testfile']}\"; then - PHP_{$upname}_DIR=\"\$PHP_$upname\" - else - AC_MSG_CHECKING(for {$this->name} in default path) - for i in ".str_replace(":"," ",$this->with['attr']['defaults'])."; do - if test -r \"\$i/{$this->with['attr']['testfile']}\"; then - PHP_{$upname}_DIR=\$i - AC_MSG_RESULT(found in \$i) - fi - done - fi -fi - -PHP_ADD_INCLUDE(\$PHP_{$upname}_DIR/include) -"; - - } else { - echo " -PHP_ARG_ENABLE({$this->name} , whether to enable {$this->name} functions, -[ --disable-{$this->name} Disable {$this->name} support], yes) -"; - } - - echo "\n"; - - - if (count($this->libs)) { - $first = true; - - foreach ($this->libs as $lib) { - if (is_array($lib['platform']) && !in_array("unix", $lib['platform'])) { - continue; - } - - if ($first) { - echo "PHP_SUBST({$upname}_SHARED_LIBADD)\n\n"; - $first = false; - } - - if (isset($this->with['attr'])) { - echo "PHP_ADD_LIBRARY_WITH_PATH($lib[name], \$PHP_{$upname}_DIR/lib, {$upname}_SHARED_LIBADD)\n"; - } else { - echo "PHP_ADD_LIBRARY($lib[name],, {$upname}_SHARED_LIBADD)\n"; - } - - if (isset($lib['function'])) { - echo "AC_CHECK_LIB($lib[name], $lib[function], [AC_DEFINE(HAVE_".strtoupper($lib['name']).",1,[ ])], [AC_MSG_ERROR($lib[name] library not found or wrong version)],)\n"; - } - } - } - - echo "\n"; - - if ($this->language === "cpp") { - echo "PHP_REQUIRE_CXX\n"; - echo "PHP_ADD_LIBRARY(stdc++)\n"; - } - - echo " -if test \"\$PHP_$upname\" != \"no\"; then - AC_DEFINE(HAVE_$upname, 1, [ ]) - PHP_NEW_EXTENSION({$this->name}, ".join(" ", $this->files['c'])." , \$ext_shared) -fi - -"; - - $filename = "{$this->name}/config.m4"; - $this->files['conf'][] = basename($filename); - - $fp = fopen($filename, "w"); - fputs($fp, ob_get_contents()); - fclose($fp); - ob_end_clean(); - } - - // }}} - - // {{{ M$ dev studio project file - - function write_ms_devstudio_dsp() { - ob_start(); - - // these system libraries are always needed? - // (list taken from sample *.dsp files in php ext tree...) - $winlibs = "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib "; - $winlibs.= "shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"; - - // add libraries from <deps> section - if (count($this->libs)) { - foreach ($this->libs as $lib) { - if (is_array($lib['platform']) && !in_array("win32", $lib['platform'])) { - continue; - } - $winlibs .= " $lib[name].lib"; - } - } - - echo -'# Microsoft Developer Studio Project File - Name="'.$this->name.'" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG='.$this->name.' - Win32 Debug_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "'.$this->name.'.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "'.$this->name.'.mak" CFG="'.$this->name.' - Win32 Debug_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "'.$this->name.' - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "'.$this->name.' - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "'.$this->name.' - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "'.strtoupper($this->name).'_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_'.strtoupper($this->name).'" /D ZTS=1 /D HAVE_'.strtoupper($this->name).'=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 '.$winlibs.' /nologo /dll /machine:I386 -# ADD LINK32 php4ts.lib '.$winlibs.' /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_'.$this->name.'.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "'.$this->name.' - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "'.strtoupper($this->name).'_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_'.strtoupper($this->name).'" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_'.strtoupper($this->name).'=1 /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 '.$winlibs.' /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 php4ts_debug.lib '.$winlibs.' /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_'.$this->name.'.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" - -!ENDIF - -# Begin Target - -# Name "'.$this->name.' - Win32 Release_TS" -# Name "'.$this->name.' - Win32 Debug_TS" -'; - - - echo ' -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -'; - - foreach ($this->files['c'] as $filename) { - if ($filename{0}!='/' && $filename{0}!='.') { - $filename = "./$filename"; - } - $filename = str_replace("/","\\",$filename); - - echo " -# Begin Source File - -SOURCE=$filename -# End Source File -"; - } - -echo ' -# End Group -'; - - - - -echo ' -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -'; - - foreach ($this->files['h'] as $filename) { - if ($filename{0}!='/' && $filename{0}!='.') { - $filename = "./$filename"; - } - $filename = str_replace("/","\\",$filename); - - echo " -# Begin Source File - -SOURCE=$filename -# End Source File -"; - } - -echo -'# End Group -# End Target -# End Project -'; - - $filename = "{$this->name}/{$this->name}.dsp"; - $this->files['conf'][] = basename($filename); - - // write file, enforce DOS/Windows line endings on all platforms - $fp = fopen($filename,"wb"); - fputs($fp, str_replace("\n","\r\n",ob_get_contents())); - fclose($fp); - ob_end_clean(); - } - -// }}} - - - function write_credits() { - if (count($this->users)) { - $this->files['doc'][] = "CREDITS"; - $fp = fopen("{$this->name}/CREDITS", "w"); - fputs($fp, "{$this->name}\n"); - $names = array(); - foreach($this->users as $user) { - if (isset($user['name'])) { - $names[] = $user['name']; - } - } - fclose($fp); - } - } - - - function write_experimental() { - if (isset($this->release['state']) && $this->release['state'] !== 'stable') { - $this->files['doc'][] = "EXPERIMENTAL"; - $fp = fopen("{$this->name}/EXPERIMENTAL", "w"); - fputs($fp, -"this extension is experimental, -its functions may change their names -or move to extension all together -so do not rely to much on them -you have been warned! -"); - fclose($fp); - } - } - - function write_package_xml() { - $status = false; - - ob_start(); - - echo -"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?> -<!DOCTYPE package SYSTEM \"../../package.dtd\"> -<package> - <name>{$this->name}</name> -"; - - if (isset($this->summary)) { - echo " <summary>{$this->summary}</summary>\n"; - } - - if (isset($this->description)) { - echo " <description>\n".rtrim($this->description)."\n </description>\n"; - } - - if (isset($this->release['license'])) { - echo " <license>".$this->release['license']."</license>\n"; - } - - if (isset($this->with['attr'])) { - echo " <configureoptions>\n"; - echo " <configureoption name=\"{$this->name}\" default=\"shared\" prompt=\"{$this->name} installation directory?\" />\n"; - echo " </configureoptions>\n"; - } - - if (@is_array($this->users)) { - echo "\n <maintainers>\n"; - foreach ($this->users as $user) { - echo " <maintainer>\n"; - foreach (array("user","name","email","role") as $key) { - if (isset($user[$key])) { - echo " <$key>{$user[$key]}</$key>\n"; - } - } - echo " </maintainer>\n"; - } - echo " </maintainers>\n"; - } - - if (is_array($this->release)) { - echo "\n <release>\n"; - foreach (array("version","date","state","notes") as $key) { - if (isset($this->release[$key])) { - echo " <$key>{$this->release[$key]}</$key>\n"; - } - } - echo " </release>\n"; - } - - echo "\n <filelist>\n"; - echo " <dir role=\"doc\" name=\"/\">\n"; - if (@is_array($this->files['doc'])) { - foreach ($this->files['doc'] as $file) { - echo " <file role=\"doc\">$file</file>\n"; - } - } - if (@is_array($this->files['conf'])) { - foreach ($this->files['conf'] as $file) { - echo " <file role=\"src\">$file</file>\n"; - } - } - if (@is_array($this->files['c'])) { - foreach ($this->files['c'] as $file) { - echo " <file role=\"src\">$file</file>\n"; - } - } - if (@is_array($this->files['h'])) { - foreach ($this->files['h'] as $file) { - echo " <file role=\"src\">$file</file>\n"; - } - } - - echo " </dir>\n"; - echo " </filelist>\n"; - - - echo "</package>\n"; - - $fp = fopen("{$this->name}/package.xml", "w"); - if (is_resource($fp)) { - fputs($fp, ob_get_contents()); - fclose($fp); - } - - ob_end_clean(); - return $status; - } - - // }}} - - function write_test_files() { - mkdir("$this->name/tests"); - - foreach ($this->functions as $function) { - $function->write_test($this); - } - } - -} - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/license.php b/scripts/ext_skel_ng/license.php deleted file mode 100644 index a2ed879902..0000000000 --- a/scripts/ext_skel_ng/license.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -abstract class license -{ - function __construct($options = array()) { - $this->options = $options; - } - - static function factory($name, $options=array()) { - $classname = "license_".strtolower($name); - - if (!class_exists($classname)) { - if (file_exists("./$classname.php")) { - require_once "./$classname.php"; - } - } - - return - class_exists($classname) - ? new $classname($options) - : false; - } - - abstract function license_comment(); - - function write_license_file($path = "./LICENSE") { - $fp = fopen($path, "w"); - - if (is_resource($fp)) { - fputs($fp, $this->license_file_text()); - fclose($fp); - return true; - } - - return false; - } - - abstract function license_file_text(); -} - - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/license_bsd.php b/scripts/ext_skel_ng/license_bsd.php deleted file mode 100644 index 8e1ad4a069..0000000000 --- a/scripts/ext_skel_ng/license_bsd.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -class license_lgpl extends license -{ - function license_comment() { - return <<<EOD - | All rights reserved | - | | - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the following conditions | - | are met: | - | | - | 1. Redistributions of source code must retain the above copyright | - | notice, this list of conditions and the following disclaimer. | - | 2. Redistributions in binary form must reproduce the above copyright | - | notice, this list of conditions and the following disclaimer in | - | the documentation and/or other materials provided with the | - | distribution. | - | 3. The names of the authors may not be used to endorse or promote | - | products derived from this software without specific prior | - | written permission. | - | | - | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | - | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | - | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | - | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | - | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | - | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | - | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | - | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | - | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | - | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | - | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | - | POSSIBILITY OF SUCH DAMAGE. | - -EOD; - } - - function license_file_text() { - return <<<EOD -All rights reserved - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The names of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -EOD; - } -} - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/license_lgpl.php b/scripts/ext_skel_ng/license_lgpl.php deleted file mode 100644 index cfdcf793a3..0000000000 --- a/scripts/ext_skel_ng/license_lgpl.php +++ /dev/null @@ -1,540 +0,0 @@ -<?php - -class license_lgpl extends license -{ - function license_comment() { - return <<<EOD - | This library is free software; you can redistribute it and/or | - | modify it under the terms of the GNU Lesser General Public | - | License as published by the Free Software Foundation; either | - | version 2.1 of the License, or (at your option) any later version. | - | | - | This library is distributed in the hope that it will be useful, | - | but WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | - | Lesser General Public License for more details. | - | | - | You should have received a copy of the GNU Lesser General Public | - | License in the file LICENSE along with this library; | - | if not, write to the | - | | - | Free Software Foundation, Inc., | - | 59 Temple Place, Suite 330, | - | Boston, MA 02111-1307 USA | - -EOD; - } - - function license_file_text() { - ob_start(); -?> - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -<?php - $text = ob_get_contents(); - ob_end_clean(); - return $text; - } -} - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/license_php.php b/scripts/ext_skel_ng/license_php.php deleted file mode 100644 index 58065470e4..0000000000 --- a/scripts/ext_skel_ng/license_php.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -class license_php extends license -{ - function license_comment() { - return <<<EOD - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - -EOD; - } - - function license_file_text() { - return <<<EOD --------------------------------------------------------------------- - The PHP License, Version 3.0 -Copyright (c) 1999 - 2003 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP, freely available from - <http://www.php.net/>". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see <http://www.php.net>. - -This product includes the Zend Engine, freely available at -<http://www.zend.com>. - -EOD; - } -} - -?> diff --git a/scripts/ext_skel_ng/php_constant.php b/scripts/ext_skel_ng/php_constant.php deleted file mode 100644 index 4f377a963d..0000000000 --- a/scripts/ext_skel_ng/php_constant.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php - - class php_constant extends php_element { - - function __construct($attr, $desc) { - - $this->name = $attr["name"]; - if (!$this->is_name($this->name)) { - $this->error[] = "'$attr[name]'is not a valid constant name"; - } - - $this->type = isset($attr["type"]) ? $this->is_type($attr["type"]) : "string"; - if (!in_array($this->type, array('int', 'float', 'string'))) { - $this->error[] = "'$attr[type]' is not a valid constant type, only int, float and string"; - } - - $this->value= $attr["value"]; - $this->desc = $desc; - } - - - static function c_code_header($name) { - return ""; - } - - function c_code() { - switch ($this->type) { - case "int": - return "REGISTER_LONG_CONSTANT(\"{$this->name}\", {$this->value}, 0);\n"; - - case "float": - return "REGISTER_DOUBLE_CONSTANT(\"{$this->name}\", {$this->value}, 0);\n"; - - case "string": - return "REGISTER_STRING_CONSTANT(\"{$this->name}\", \"$value\", ".strlen($this->value).", 0);\n"; - } - } - - static function c_code_footer() { - return ""; - } - - - - static function docbook_xml_header($name) { - return -" <table> - <title>$name constants</title> - <tgroup cols='3'> - <thead> - <row> - <entry>name</entry> - <entry>value</entry> - <entry>descrpition</entry> - </row> - </thead> - <tbody> -"; - } - - function docbook_xml() { - return trim(" -<row> - <entry> - <constant id='constant".strtolower(str_replace("_","-",$this->name))."'>{$this->name}</constant> - (<link linkend='language.types.integer'>integer</link>) - </entry> - <entry>{$this->value}</entry> - <entry>{$this->desc}</entry> -</row> -")."\n"; - } - - static function docbook_xml_footer() { - return -" </tbody> - </tgroup> - </table> -"; - } - } - -?> diff --git a/scripts/ext_skel_ng/php_element.php b/scripts/ext_skel_ng/php_element.php deleted file mode 100644 index 852e2d8e94..0000000000 --- a/scripts/ext_skel_ng/php_element.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -class php_element { - function is_type($name) { - $types = array("void" => "void", - "bool" => "bool", - "boolean" => "bool", - "int" => "int", - "integer" => "int", - "float" => "float", - "double" => "float", - "real" => "float", - "string" => "string", - "array" => "array", - "object" => "object", - "resource" => "resource", - "mixed" => "mixed", - "callback" => "callback", - "stream" => "stream" - ); - - if (isset($types[$name])) { - return $types[$name]; - } else { - return false; - } - } - - function is_name($name) { - if (ereg("^[[:alpha:]_][[:alnum:]_]*$",$name)) { - // TODO reserved words - return true; - } - return false; - } - - - function c_code() { - return ""; - } - - function h_code() { - return ""; - } - - function docbook_xml() { - return ""; - } - - function docbook_editor_settings($level=3) { - return ' -<!-- Keep this comment at the end of the file -Local'.' variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -indent-tabs-mode:nil -sgml-parent-document:nil -sgml-default-dtd-file:"'.str_repeat("../",$level).'manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> -'; - } -} - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/php_function.php b/scripts/ext_skel_ng/php_function.php deleted file mode 100644 index 1b2005b78c..0000000000 --- a/scripts/ext_skel_ng/php_function.php +++ /dev/null @@ -1,426 +0,0 @@ -<?php - - class php_function extends php_element { - - function __construct($name, $summary, $proto, $desc="", $code="", $role="") { - $this->name = $name; - $this->summary = $summary; - $this->desc = empty($desc) ? "&warn.undocumented.func;" : $desc; - $this->code = $code; - $this->role = empty($role) ? "public" : $role; - if ($this->role === "public") { - $this->status = $this->parse_proto($proto); - } - } - - function parse_proto($proto) { - /* TODO - a 'real' parser is needed here (lex/yacc with PHP output anyone?) - to support stuff like default values - the current tokenizer is not clever enough for this ... - - the grammer for a prototype would look like this: ? - - proto: type name '(' param-list ')' - - name: [A-Za-z_][A-Za-z0-9_]* - - type: "void" - | typespec - - typespec: typename - | typename '&' - - typename: bool | boolean - | int | integer | long - | float | double | real - | string - | array - | object | object name - | resource | resource name - | mixed - | callback - | stream - - param-list: void - | parameter - | parm-list ',' parameter - - parameter: typespec name - | typespec name '=' default-value - - default-value: "true" | "false" | "array()" - | numeric-value - | string - - string: '"' character* '"' - - number: ... the usual int, float, hex and octal stuff ... - */ - - // 'tokenize' it - $tokens=array(); - - // we collect valid C names as Strings, any other character for itself, blanks are skipped - // TODO: this does no longer work if we ever add default values ... - $len=strlen($proto); - $name=""; - for ($n=0;$n<$len;$n++) { - $char = $proto{$n}; - if (ctype_alpha($char) || $char == '_' || ($n && ctype_digit($char))) { - $name.=$char; - } else { - if ($name) $tokens[]=$name; - $name=""; - if (trim($char)) $tokens[]=$char; - } - } - if ($name) $tokens[]=$name; - - $n=0; - $opts=0; - $params=array(); - $return_type = ($this->is_type($tokens[$n])) ? $tokens[$n++] : "void"; - $function_name = $tokens[$n++]; - if ($return_type === "resource" && $tokens[$n] !== "(") { - $return_subtype = $function_name; - $function_name = $tokens[$n++]; - } - if (! $this->is_name($function_name)) { - return("$function_name is not a valid function name"); - } - if ($function_name != $this->name) { - return "proto function name is '$function_name' instead of '{$this->name}'"; - } - - if ($tokens[$n]!='(') return("'(' expected instead of '$tokens[$n]'"); - if ($tokens[++$n]!=')') { - for ($param=0;$tokens[$n];$n++,$param++) { - if ($tokens[$n]=='[') { - $params[$param]['optional']=true; - $opts++; - $n++; - if ($param>0) { - if ($tokens[$n]!=',') return("',' expected after '[' instead of '$token[$n]'"); - $n++; - } - } - if (!$this->is_type($tokens[$n])) return("type name expected instead of '$tokens[$n]'"); - $params[$param]['type']=$tokens[$n]; - $n++; - if ($tokens[$n] == "&") { - $params[$param]['by_ref'] = true; - $n++; - } - if ($this->is_name($tokens[$n])) { - $params[$param]['name']=$tokens[$n]; - $n++; - } - if ($tokens[$n] == "&") { - $params[$param]['by_ref'] = true; - $n++; - } - if ($params[$param]['type'] === "resource" && $this->is_name($tokens[$n])) { - $params[$param]['subtype'] = $params[$param]['name']; - $params[$param]['name'] = $tokens[$n]; - $n++; - } - if ($tokens[$n]=='[') { - $n--; - continue; - } - if ($tokens[$n]==',') continue; - if ($tokens[$n]==']') break; - if ($tokens[$n]==')') break; - } - } - $numopts=$opts; - while ($tokens[$n]==']') { - $n++; - $opts--; - } - if ($opts!=0) return ("'[' / ']' count mismatch"); - if ($tokens[$n] != ')') return("')' expected instead of '$tokens[$n]'"); - - $this->name = $function_name; - $this->returns = $return_type; - if (isset($return_subtype)) { - $this->returns .= " $return_subtype"; - } - $this->params = $params; - $this->optional = $numopts; - - return true; - } - - function c_code($extension) { - $code = ""; - - $returns = explode(" ", $this->returns); - - switch ($this->role) { - case "public": - $code .= "\n/* {{{ proto {$this->returns} {$this->name}("; - if (isset($this->params)) { - foreach ($this->params as $key => $param) { - if (!empty($param['optional'])) - $code.=" ["; - if ($key) - $code.=", "; - $code .= $param['type']." "; - if (isset($param['subtype'])) { - $code .= $param['subtype']." "; - } - if ($param['type'] !== 'void') { - if (isset($param['by_ref'])) { - $code .= "&"; - } - $code .= $param['name']; - } - } - } - for ($n=$this->optional; $n>0; $n--) { - $code .= "]"; - } - $code .= ")\n "; - if (!empty($this->summary)) { - $code .= $this->summary; - } - $code .= " */\n"; - $code .= "PHP_FUNCTION({$this->name})\n"; - $code .= "{\n"; - - if ($returns[0] === "resource" && isset($returns[1])) { - $resource = $extension->resources[$returns[1]]; - if ($resource->alloc === "yes") { - $payload = $resource->payload; - $code .= " $payload * return_res = ($payload *)emalloc(sizeof($payload));\n"; - } - } - - if (isset($this->params) && count($this->params)) { - $arg_string=""; - $arg_pointers=array(); - $optional=false; - $res_fetch=""; - foreach ($this->params as $key => $param) { - if ($param["type"] === "void") continue; - $name = $param['name']; - $arg_pointers[]="&$name"; - if (isset($param['optional'])&&!$optional) { - $optional=true; - $arg_string.="|"; - } - switch ($param['type']) { - case "bool": - $arg_string.="b"; - $code .= " zend_bool $name = 0;\n"; - break; - case "int": - $arg_string.="l"; - $code .= " long $name = 0;\n"; - break; - case "float": - $arg_string.="d"; - $code .= " double $name = 0.0;\n"; - break; - case "string": - $arg_string.="s"; - $code .= " char * $name = NULL;\n"; - $code .= " int {$name}_len = 0;\n"; - $arg_pointers[]="&{$name}_len"; - break; - case "array": - $arg_string.="a"; - $code .= " zval * $name = NULL;\n"; - break; - case "object": - $arg_string.="o"; - $code .= " zval * $name = NULL;\n"; - break; - case "resource": - $arg_string.="r"; - $code .= " zval * $name = NULL;\n"; - $code .= " int {$name}_id = -1;\n"; - // dummfug? $arg_pointers[]="&{$name}_id"; - if (isset($param['subtype'])) { - $resource = $extension->resources[$param['subtype']]; - $varname = "res_{$name}"; - $code .= " {$resource->payload} * $varname;\n"; - - $res_fetch.=" if ($name) {\n" - ." ZEND_FETCH_RESOURCE($varname, {$resource->payload} *, &$name, {$name}_id, \"$param[subtype]\", le_$param[subtype]);\n" - ." }\n"; - } else { - $res_fetch.=" if ($name) {\n" - ." ZEND_FETCH_RESOURCE(???, ???, $name, {$name}_id, \"???\", ???_rsrc_id);\n" - ." }\n"; - } - break; - case "stream": - $arg_string .= "r"; - $code .= " zval * _z$name = NULL; \n"; - $code .= " php_stream * $name = NULL:\n"; - $res_fetch.= " php_stream_from_zval($name, &_z$name);\n"; - break; - case "mixed": - case "callback": - $arg_string.="z"; - $code .= " zval * $name = NULL;\n"; - break; - } - } - } - - if (isset($arg_string) && strlen($arg_string)) { - $code .= " int argc = ZEND_NUM_ARGS();\n\n"; - $code .= " if (zend_parse_parameters(argc TSRMLS_CC, \"$arg_string\", ".join(", ",$arg_pointers).") == FAILURE) return;\n"; - if ($res_fetch) $code.="\n$res_fetch\n"; - } else { - $code .= " if (ZEND_NUM_ARGS()>0) { WRONG_PARAM_COUNT; }\n\n"; - } - - if ($this->code) { - $code .= " {\n$this->code }\n"; // {...} for local variables ... - } else { - $code .= " php_error(E_WARNING, \"{$this->name}: not yet implemented\"); RETURN_FALSE;\n\n"; - - switch ($returns[0]) { - case "void": - break; - - case "bool": - $code .= " RETURN_FALSE;\n"; - break; - - case "int": - $code .= " RETURN_LONG(0);\n"; - break; - - case "float": - $code .= " RETURN_DOUBLE(0.0);\n"; - break; - - case "string": - $code .= " RETURN_STRINGL(\"\", 0, 1);\n"; - break; - - case "array": - $code .= " array_init(return_value);\n"; - break; - - case "object": - $code .= " object_init(return_value)\n"; - break; - - case "resource": - if (isset($returns[1])) { - $code .= " ZEND_REGISTER_RESOURCE(return_value, return_res, le_$returns[1]);\n"; - } else { - $code .= " /* RETURN_RESOURCE(...); /*\n"; - } - break; - - case "stream": - $code .= " /* php_stream_to_zval(stream, return_value); */\n"; - break; - - case "mixed": - $code .= " /* RETURN_...(...); /*\n"; - break; - - default: - $code .= " /* UNKNOWN RETURN TYPE '$this->returns' /*\n"; - break; - } - } - - $code .= "}\n/* }}} */\n\n"; - break; - - case "internal": - if (!empty($this->code)) { - $code .= " {\n"; - $code .= $this->code."\n"; - $code .= " }\n"; - } - break; - - case "private": - $code .= $this->code."\n"; - break; - } - return $code; - } - - function docbook_xml() { - $xml = -'<?xml version="1.0" encoding="iso-8859-1"?> -<!-- '.'$'.'Revision: 1.0 $ --> - <refentry id="function.'.strtolower(str_replace("_","-",$this->name)).'"> - <refnamediv> - <refname>'.$this->name.'</refname> - <refpurpose>'.$this->summary.'</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <methodsynopsis> -'; - - $xml .= " <type>{$this->returns}</type><methodname>{$this->name}</methodname>\n"; - if (empty($this->params) || $this->params[0]["type"]==="void") { - $xml .= " <void/>\n"; - } else { - foreach ($this->params as $key => $param) { - if (isset($param['optional'])) { - $xml .= " <methodparam choice='opt'>"; - } else { - $xml .= " <methodparam>"; - } - $xml .= "<type>$param[type]</type><parameter>"; - if (isset($param['by_ref'])) { - $xml .= "&"; - } - $xml .= "$param[name]</parameter>"; - $xml .= "</methodparam>\n"; - } - } - - - $desc = $this->desc; - - if (!strstr($this->desc,"<para>")) { - $desc = " <para>\n$desc </para>\n"; - } - -$xml .= -' </methodsynopsis> -'.$desc.' - </refsect1> - </refentry> -'; - $xml .= $this->docbook_editor_settings(4); - - return $xml; - } - - function write_test($extension) { - $fp = fopen("{$extension->name}/tests/{$this->name}.phpt", "w"); - fputs($fp, -"--TEST-- -{$this->name}() function ---SKIPIF-- -<?php if (!extension_loaded('{$extension->name}')) print 'skip'; ?> ---POST-- ---GET-- ---FILE-- -<?php - echo 'no test case for {$this->name}() yet'; -?> ---EXPECT-- -no test case for {$this->name}() yet"); - fclose($fp); - } - } - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/php_global.php b/scripts/ext_skel_ng/php_global.php deleted file mode 100644 index df74b2a073..0000000000 --- a/scripts/ext_skel_ng/php_global.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - - class php_global extends php_element { - - function __construct($attr) { - - $this->name = $attr["name"]; - - if (!$this->is_name($this->name)) { - $this->error[] = "'$attr[name]' is not a valid C variable name"; - } - - $this->type = $attr['type']; - if (!$this->is_type($this->type)) { - $this->error[] = "'$attr[type]' is not a valid C data type"; - } - } - - /* overriding type check as we deal with C types here - check is rather naive as it doesn't know about context - so we check for a sequence of valid names for now - TODO: check for either simple type, struct/class or single word (typedef) - */ - function is_type($type) { - $array = explode(" ", str_replace('*',' ',$type)); - foreach ($array as $name) { - if (empty($name)) continue; - if (!$this->is_name($name)) return false; - } - return true; - } - - - - static function c_code_header($name) { - return "static void php_{$name}_init_globals(zend_{$name}_globals *{$name}_globals)\n{\n"; - } - - function c_code($name) { - $code = " {$name}_globals->{$this->name} = "; - if (strstr($this->type, "*")) { - $code .= "NULL;\n"; - } else { - $code .= "0;\n"; - } - return $code; - } - - static function c_code_footer($name) { - return " -} - -static void php_{$name}_shutdown_globals(zend_{$name}_globals *{$name}_globals) -{ -}"; - } - - static function h_code_header($name) { - return "ZEND_BEGIN_MODULE_GLOBALS({$name})\n"; - } - - function h_code($name) { - return " {$this->type} {$this->name};\n"; - } - - static function h_code_footer($name) { - $upname = strtoupper($name); - - return " -ZEND_END_MODULE_GLOBALS({$name}) - -#ifdef ZTS -#define {$upname}_G(v) TSRMG({$name}_globals_id, zend_{$name}_globals *, v) -#else -#define {$upname}_G(v) ({$name}_globals.v) -#endif - -"; - - } - - - } - -?> diff --git a/scripts/ext_skel_ng/php_ini.php b/scripts/ext_skel_ng/php_ini.php deleted file mode 100644 index 3ac6e44fab..0000000000 --- a/scripts/ext_skel_ng/php_ini.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - - class php_ini extends php_element { - - function __construct($attr) { - - $this->name = $attr["name"]; - - if (!$this->is_name($this->name)) { - $this->error[] = "'$attr[name]' is not a valid php.ini directive name"; - } - - $this->type = $this->is_type($attr['type']); - if (!$this->type) { - $this->error[] = "'$attr[type]' is not a valid PHP data type"; - } - - $this->value = $attr["value"]; - $this->desc = $attr["desc"]; - - switch (@$attr["access"]) { - case "system": - $this->access = "PHP_INI_SYSTEM"; - break; - case "perdir": - $this->access = "PHP_INI_PERDIR"; - break; - case "user": - $this->access = "PHP_INI_USER"; - break; - case "all": - case "": - $this->access = "PHP_INI_ALL"; - break; - default: - $this->error[] = "'$attr[access]' is not a valid access mode (system|perdir|user|all)"; - } - - switch ($this->type) { - case "bool": - $this->onupdate = "OnUpdateBool"; - $this->c_type = "zend_bool"; - break; - case "int": - $this->onupdate = "OnUpdateLong"; - $this->c_type = "long"; - break; - case "float": - $this->onupdate = "OnUpdateReal"; - $this->c_type = "double"; - break; - case "string": - $this->onupdate = "OnUpdateString"; - $this->c_type = "char *"; - break; - default: - $this->error[] = "'$this->type' not supported, only bool, int, float and string"; - break; - } - - if (isset($attr["onupdate"])) { - $this->onupdate = $attr["onupdate"]; - } - } - - - - static function c_code_header($name) { - return "PHP_INI_BEGIN()\n"; - } - - function c_code($name) { - return " STD_PHP_INI_ENTRY(\"$name.{$this->name}\", \"{$this->value}\", {$this->access}, {$this->onupdate}, {$this->name}, zend_{$name}_globals, {$name}_globals)\n"; - } - - static function c_code_footer() { - return "PHP_INI_END()\n\n"; - } - - - - static function docbook_xml_header($name) { - return -" <table> - <title>$name runtime configuration</title> - <tgroup cols='3'> - <thead> - <row> - <entry>directive</entry> - <entry>default value</entry> - <entry>descrpition</entry> - </row> - </thead> - <tbody> -"; - } - - function docbook_xml() { - return -" <row> - <entry>$this->name</entry> - <entry>$this->value</entry> - <entry>$this->desc</entry> - </row> -"; - } - - static function docbook_xml_footer() { - return -" </tbody> - </tgroup> - </table> -"; - } - } - -?> diff --git a/scripts/ext_skel_ng/php_logo.php b/scripts/ext_skel_ng/php_logo.php deleted file mode 100644 index e7fa4b56f0..0000000000 --- a/scripts/ext_skel_ng/php_logo.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - - class php_logo extends php_element { - - function __construct($name, $attr) { - $this->name = $name; - $this->attr = $attr; - $this->id = '"'.strtoupper($name).'_LOGO_ID"'; - - $this->data = file_get_contents($attr['src']); - $this->size = strlen($this->data); - - $this->mime_type = "image/gif"; - } - - function docbook_xml($base) { - return ""; - } - - function minit_code() { - return " php_register_info_logo({$this->id}, \"{$this->mime_type}\", {$this->name}_logo, {$this->size});\n"; - } - - function c_code() { - return " -static unsigned char {$this->name}_logo[] = { -#include \"{$this->name}_logo.h\" -}; -"; - } - - function h_code() { - $len = strlen($this->data); - $code = " "; - $i=0; - for ($n = 0; $n < $len; $n++) { - $code .= sprintf(" %3d",ord($this->data[$n])); - if ($n == $len - 1) break; - $code .= ","; - if (++$i==8) { - $code .= "\n "; - $i=0; - } - } - - $code .= "\n"; - - return $code; - } - } - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/php_resource.php b/scripts/ext_skel_ng/php_resource.php deleted file mode 100644 index 2ea631a489..0000000000 --- a/scripts/ext_skel_ng/php_resource.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php - - class php_resource extends php_element { - - function __construct($attr, $destruct, $description) { - $this->name = $attr['name']; - if (!$this->is_name($this->name)) { - $this->error[] = "'$attr[name] is not a valid resource name"; - } - - - $this->payload = @$attr['payload']; - $this->alloc = @$attr['alloc']; - $this->destruct = $destruct; - $this->description = $description; - - if (empty($this->payload)) { - $this->payload = "void"; - } - } - - function docbook_xml($base) { - return " - <section id='$base.resources.{$this->name}'> - <title><literal>{$this->name}</literal></title> - <para> - {$this->description} - </para> - </section> -"; - } - - function minit_code() { - return " -le_{$this->name} = zend_register_list_destructors_ex({$this->name}_dtor, - NULL, - \"{$this->name}\", - module_number); - -"; - } - - function c_code() { - $dtor = " -int le_{$this->name}; - -void {$this->name}_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - {$this->payload} * resource = ({$this->payload} *)(rsrc->ptr); - - {$this->destruct} -"; - - if ($this->alloc === "yes") { - $dtor .= " efree(resource);\n"; - } - - $dtor .= "}\n"; - - return $dtor; - } - - function h_code() { - $upname = strtoupper($this->name); - - return " -#define {$upname}_FETCH(r, z) ZEND_FETCH_RESOURCE(r, {$this->payload} *, z, -1, ${$this->name}, le_{$this->name }); \ - if (!r) { RETURN_FALSE; } - -#define {$upname}_REGISTER(r) ZEND_REGISTER_RESOURCE(return_value, r, le_{$this->name }); -"; - } - } - -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/xml_stream_callback_parser.php b/scripts/ext_skel_ng/xml_stream_callback_parser.php deleted file mode 100644 index 5ac0d62d31..0000000000 --- a/scripts/ext_skel_ng/xml_stream_callback_parser.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - class xml_stream_callback_parser extends xml_stream_parser { - - function __construct($stream) { - $this->cdata = ""; - $this->tags = array(); - $this->attrs = array(); - - parent::__construct($stream); - } - - function cdata($parser, $cdata) { - $this->cdata .= $cdata; - } - - function tag_open($parser, $tag, $attributes) { - array_push($this->tags, $tag); - array_push($this->attrs, $attributes); - } - - function tag_close($parser, $tag) { - $attributes = array_pop($this->attrs); - - for ($tags = $this->tags; count($tags); array_shift($tags)) { - $method = "handle_".join("_", $tags); - if (method_exists($this, $method)) { - $this->$method($attributes); - break; - } - } - - $this->cdata = ""; - array_pop($this->tags); - } - } -?>
\ No newline at end of file diff --git a/scripts/ext_skel_ng/xml_stream_parser.php b/scripts/ext_skel_ng/xml_stream_parser.php deleted file mode 100644 index fe0a4c9ad7..0000000000 --- a/scripts/ext_skel_ng/xml_stream_parser.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -class xml_stream_parser { - var $parser; - - function __construct($stream) - { - if (!is_resource($stream)) die("not a stream"); - if (get_resource_type($stream) != "stream") die("not a stream"); - - $this->parser = xml_parser_create(); - - xml_set_object($this->parser, $this); - xml_set_element_handler($this->parser, "tag_open", "tag_close"); - xml_set_character_data_handler($this->parser, "cdata"); - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); - - while (!feof($stream)) { - xml_parse($this->parser, fgets($stream), feof($stream)); - } - xml_parser_free($this->parser); - } - - function tag_open($parser, $tag, $attributes) - { - var_dump($parser, $tag, $attributes); - } - - function cdata($parser, $cdata) - { - var_dump($parser, $cdata); - } - - function tag_close($parser, $tag) - { - var_dump($parser, $tag); - } - - function error($msg) - { - if (is_array($msg)) { - if (count($msg)==1) { - $msg = current($msg); - } else { - foreach ($msg as $text) { - echo "$text\n"; - } - $msg = "..."; - } - } - - die("$msg on line ".xml_get_current_line_number($this->parser)); - } -} // end of class xml -?>
\ No newline at end of file |