Permalink
Browse files

This project is no longer maintained within PEAR CVS,

developement is now hosted on

  http://CodeGenerators.php-baustelle.de/

instead.


git-svn-id: http://svn.php.net/repository/pear/packages/CodeGen_PECL/trunk@235325 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
Hartmut Holzgraefe
Hartmut Holzgraefe committed May 10, 2007
1 parent 1eda7f6 commit 3579cec325d27f0a27bbe9e453d3a6558c06ba87
Showing with 4 additions and 22,292 deletions.
  1. +0 −68 LICENSE
  2. +0 −265 PECL/Command.php
  3. +0 −267 PECL/Dependency/Extension.php
  4. +0 −73 PECL/Dependency/Header.php
  5. +0 −123 PECL/Dependency/Lib.php
  6. +0 −84 PECL/Dependency/Platform.php
  7. +0 −425 PECL/Dependency/With.php
  8. +0 −158 PECL/Element.php
  9. +0 −669 PECL/Element/Class.php
  10. +0 −244 PECL/Element/ClassConstant.php
  11. +0 −353 PECL/Element/Constant.php
  12. +0 −1,660 PECL/Element/Function.php
  13. +0 −294 PECL/Element/Global.php
  14. +0 −451 PECL/Element/Ini.php
  15. +0 −307 PECL/Element/Interface.php
  16. +0 −261 PECL/Element/Logo.php
  17. +0 −466 PECL/Element/Method.php
  18. +0 −9 PECL/Element/ObjectInterface.php
  19. +0 −232 PECL/Element/Property.php
  20. +0 −356 PECL/Element/Resource.php
  21. +0 −241 PECL/Element/Stream.php
  22. +0 −464 PECL/Element/Test.php
  23. +0 −2,566 PECL/Extension.php
  24. +0 −1,369 PECL/ExtensionParser.php
  25. +0 −125 PECL/Maintainer.php
  26. +0 −127 PECL/Release.php
  27. +0 −279 PECL/Tools/ProtoLexer.php
  28. +0 −139 PECL/Tools/ProtoLexer.plex
  29. +0 −1,292 PECL/Tools/ProtoParser.php
  30. +0 −105 PECL/Tools/ProtoParser.y
  31. +4 −8 README
  32. +0 −90 TODO
  33. +0 −8 docs/Makefile
  34. +0 −44 docs/RFC_proto.txt
  35. +0 −4 docs/examples/Makefile
  36. +0 −73 docs/examples/README
  37. +0 −45 docs/examples/api_functions.xml
  38. +0 −275 docs/examples/cairo.xml
  39. +0 −24 docs/examples/class_abstract.xml
  40. +0 −25 docs/examples/class_constant.xml
  41. +0 −18 docs/examples/class_extends.xml
  42. +0 −80 docs/examples/class_methods.xml
  43. +0 −69 docs/examples/class_methods_abstract.xml
  44. +0 −26 docs/examples/class_methods_final.xml
  45. +0 −9 docs/examples/class_minimal.xml
  46. +0 −77 docs/examples/class_payload.xml
  47. +0 −232 docs/examples/class_properties.xml
  48. +0 −47 docs/examples/class_type_hints.xml
  49. +0 −9 docs/examples/code_pi.xml
  50. +0 −21 docs/examples/constants.xml
  51. +0 −11 docs/examples/crossext.xml
  52. +0 −70 docs/examples/function_by_ref.xml
  53. +0 −41 docs/examples/function_type_hints.xml
  54. +0 −31 docs/examples/globals.xml
  55. +0 −82 docs/examples/interface.xml
  56. +0 −53 docs/examples/interface_simple.xml
  57. +0 −5 docs/examples/license.xml
  58. +0 −3 docs/examples/minimal.xml
  59. +0 −20 docs/examples/parsing.xml
  60. +0 −1 docs/examples/parsing_1.inc
  61. +0 −3 docs/examples/parsing_2.inc
  62. +0 −17 docs/examples/phpini.xml
  63. +0 −57 docs/examples/release.xml
  64. +0 −56 docs/examples/resource.xml
  65. +0 −48 docs/examples/resource_cpp.xml
  66. +0 −56 docs/examples/resource_old.xml
  67. +0 −3 docs/examples/snippet.c
  68. +0 −3 docs/examples/snippet1.c
  69. +0 −3 docs/examples/snippet2.c
  70. +0 −29 docs/examples/test.sh
  71. +0 −37 docs/examples/testcase.xml
  72. +0 −8 docs/examples/with_1.xml
  73. +0 −194 docs/extension.dtd
  74. +0 −4,331 docs/manual.html
  75. BIN docs/manual.pdf
  76. +0 −1,922 docs/manual.xml
  77. +0 −504 package2.xml
  78. +0 −48 pecl-gen
View
68 LICENSE
@@ -1,68 +0,0 @@
---------------------------------------------------------------------
- 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>.
View
@@ -1,265 +0,0 @@
-<?php
-/**
- * Command wrapper class
- *
- * PHP versions 5
- *
- * LICENSE: This source file is subject to version 3.0 of the PHP license
- * that is available through the world-wide-web at the following URI:
- * 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 web, please
- * send a note to license@php.net so we can mail you a copy immediately.
- *
- * @category Tools and Utilities
- * @package CodeGen
- * @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
- * @link http://pear.php.net/package/CodeGen
- */
-
-/**
- * includes
- */
-require_once "CodeGen/Command.php";
-
-require_once "CodeGen/PECL/Extension.php";
-require_once "CodeGen/PECL/ExtensionParser.php";
-
-
-/**
- * Command wrapper class
- *
- * This class wraps up the functionality needed for the
- * command line script.
- *
- * @category Tools and Utilities
- * @package CodeGen
- * @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version Release: @package_version@
- * @link http://pear.php.net/package/CodeGen
- */
-class CodeGen_PECL_Command
- extends CodeGen_Command
-{
- /**
- * Command constructor
- *
- * @param object Extension to work on
- */
- function __construct(CodeGen_Extension $extension)
- {
- parent::__construct($extension);
-
- if ($this->options->have("linespecs")) {
- $this->extension->setLinespecs(true);
- }
- }
-
- /**
- * Add pecl-gen specific command line options
- *
- * @return array extended options
- */
- function commandOptions()
- {
- list($shortOptions, $longOptions) = parent::commandOptions();
-
- $longOptions= array_merge($longOptions, array("extname=",
- "full-xml",
- "function=",
- "linespecs",
- "no-help",
- "proto=",
- "skel=",
- "stubs=",
- "xml=="));
-
- return array($shortOptions, $longOptions);
- }
-
- /**
- * Show usage/help information
- *
- * @param string otpional additional message
- */
- function showUsage($message = false)
- {
- $fp = fopen("php://stderr", "w");
-
- if ($message) fputs($fp, "$message\n\n");
-
- fputs($fp, "Usage:
-
-pecl-gen [-h] [--force] [--experimental] [--version]
- [--extname=name] [--proto=file] [--skel=dir] [--stubs=file]
- [--no-help] [--xml[=file]] [--full-xml] [--function=proto] [specfile.xml]
-
- -h|--help this message
- -f|--force overwrite existing directories
- -d|--dir output directory (defaults to extension name)
- -l|--lint check syntax only, don't create output
- --linespecs generate #line specs
- -x|--experimental deprecated
- --function create a function skeleton from a proto right away
- --version show version info
-
- the following options are inherited from ext_skel:
- --extname=module module is the name of your extension
- --proto=file file contains prototypes of functions to create
- --xml generate xml documentation to be added to phpdoc-cvs
-
- these wait for functionality to be implemented and are ignored for now ...
- --stubs=file generate only function stubs in file
- --no-help don't try to be nice and create comments in the code
- and helper functions to test if the module compiled
-
- these are accepted for backwards compatibility reasons but not used ...
- --full-xml generate xml documentation for a self-contained extension
- (this was also a no-op in ext_skel)
- --skel=dir path to the skeleton directory
- (skeleton stuff is now self-contained)
-");
-
- fclose($fp);
- }
-
-
- /**
- * Generate just a single function stub file
- *
- */
- function singleFunction()
- {
- $func = new CodeGen_PECL_Element_Function;
-
- $func->setRole("public");
-
- $err = $func->setProto(trim($this->options->value("function")), $this->extension);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- $err = $this->extension->addFunction($func);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- echo $this->extension->publicFunctionsC();
-
- echo "\n\n/*----------------------------------------------------------------------*/\n\n";
-
- foreach ($this->extension->getFunctions() as $name => $function) {
- echo sprintf("\tPHP_FE(%-20s, NULL)\n", $name);
- }
-
- echo "\n\n/*----------------------------------------------------------------------*/\n\n";
-
- foreach ($this->extension->getFunctions() as $name => $function) {
- echo "PHP_FUNCTION($name);\n";
- }
- }
-
- /**
- * ext-skel compatibility mode
- *
- */
- function extSkelCompat()
- {
- $extname = $this->options->value("extname");
-
- $err = $this->extension->setName($extname);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- if ($this->options->have("proto")) {
- $proto_file = $this->options->value("proto");
-
- if (!file_exists($proto_file) || !is_readable($proto_file)) {
- $this->terminate("cannot open proto file");
- }
-
- foreach (file($proto_file) as $line) {
- $func = new CodeGen_PECL_Element_Function;
- $func->setRole("public");
- $err = $func->setProto(trim($line));
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- $err = $this->extension->addFunction($func);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
- }
- }
-
- if ($this->options->have("stubs")) {
- $stubname = $this->options->value("stubs");
-
- if (file_exists("$stubname") && !$this->options->have("f", "force")) {
- $this->terminate("'$stubname' already exists (use '--force' to overwrite)");
- }
-
- $fp = fopen($stubname, "w");
- fputs($fp, $this->extension->publicFunctionsC());
-
- fputs($fp, "\n\n/*----------------------------------------------------------------------*/\n\n");
-
- foreach ($this->extension->functions as $name => $function) {
- fputs($fp, sprintf("\tPHP_FE(%-20s, NULL)\n", $name));
- }
-
- fputs($fp, "\n\n/*----------------------------------------------------------------------*/\n\n");
-
- foreach ($this->extension->functions as $name => $function) {
- fputs($fp, "PHP_FUNCTION($name);\n");
- }
-
- fclose($fp);
-
- echo "$stubname successfully written\n";
- } else {
- if (file_exists("./$extname") && !$this->options->have("f", "force")) {
- $this->terminate("'$extname' already exists, can't create directory (use '--force' to override)");
- }
-
- $err = System::mkdir($extname);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- $this->extension->dirpath = realpath("./$extname");
-
- $err = $this->extension->generateSource("./$extname");
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- if ($this->options->have("xml")) {
- $manpath = "$extname/manual/". str_replace('_', '-', $extname);
-
- $err = System::mkdir("-p $manpath");
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
-
- $err = $this->extension->generateDocumentation($manpath);
- if (PEAR::isError($err)) {
- $this->terminate($err->getMessage());
- }
- }
-
- $this->extension->writeReadme("./$extname");
-
- if (!$this->options->have("quiet")) {
- echo $this->extension->successMsg();
- }
- }
-
- }
-}
Oops, something went wrong.

0 comments on commit 3579cec

Please sign in to comment.