php-src/ext/skeleton/php_skeleton.h
Kalle Sommer Nielsen f35f45906e Redesigned ext_skel to be written entirely in PHP with no dependencies, this means it will now run on Windows without Cygwin and other nonsense.
It no longer includes a way to generate XML documentation (the PHP documentation utilities already got tools for that in svn under phpdoc/doc-base) and it no longer support function stubs.

$ php ext_skel.php --help
php ext_skel.php --ext=<name> [--experimental] [--author=<name>]
                 [--dir=<path>] [--std] [--onlyunix]
                 [--onlywindows] [--help]

  --ext=<name>          The name of the extension defined as <name>
  --experimental        Passed if this extension is experimental, this creates
                        the EXPERIMENTAL file in the root of the extension
  --author=<name>       Your name, this is used if --header is passed and
                        for the CREDITS file
  --dir=<path>          Path to the directory for where extension should be
                        created. Defaults to the directory of where this script
                        lives
  --std                 If passed, the standard header and vim rules footer used

                        in extensions that is included in the core, will be used

  --onlyunix            Only generate configure scripts for Unix
  --onlywindows         Only generate configure scripts for Windows
  --help                This help

Example usage:
$ php ext_skel.php --ext test --std --experimental
$ php ext_skel.php --ext kalle --author "Kalle Sommer Nielsen"
$ php ext_skel.php --ext phpfi --dir "/home/kalle/dev/" --onlyunix
2017-07-23 10:36:35 +02:00

16 lines
348 B
C

%HEADER%
#ifndef PHP_%EXTNAMECAPS%_H
# define PHP_%EXTNAMECAPS%_H
extern zend_module_entry %EXTNAME%_module_entry;
# define phpext_%EXTNAME%_ptr &%EXTNAME%_module_entry
# define PHP_%EXTNAMECAPS%_VERSION "0.1.0"
# if defined(ZTS) && defined(COMPILE_DL_%EXTNAMECAPS%)
ZEND_TSRMLS_CACHE_EXTERN()
# endif
#endif /* PHP_%EXTNAMECAPS%_H */
%FOOTER%