Permalink
Browse files

Revert "This project is no longer maintained within PEAR CVS,"

This reverts commit 3579cec.
  • Loading branch information...
1 parent 3579cec commit d1498dac431edfb234af2629cc563bc3d353de46 @CloCkWeRX CloCkWeRX committed Dec 10, 2011
Showing with 22,292 additions and 4 deletions.
  1. +68 −0 LICENSE
  2. +265 −0 PECL/Command.php
  3. +267 −0 PECL/Dependency/Extension.php
  4. +73 −0 PECL/Dependency/Header.php
  5. +123 −0 PECL/Dependency/Lib.php
  6. +84 −0 PECL/Dependency/Platform.php
  7. +425 −0 PECL/Dependency/With.php
  8. +158 −0 PECL/Element.php
  9. +669 −0 PECL/Element/Class.php
  10. +244 −0 PECL/Element/ClassConstant.php
  11. +353 −0 PECL/Element/Constant.php
  12. +1,660 −0 PECL/Element/Function.php
  13. +294 −0 PECL/Element/Global.php
  14. +451 −0 PECL/Element/Ini.php
  15. +307 −0 PECL/Element/Interface.php
  16. +261 −0 PECL/Element/Logo.php
  17. +466 −0 PECL/Element/Method.php
  18. +9 −0 PECL/Element/ObjectInterface.php
  19. +232 −0 PECL/Element/Property.php
  20. +356 −0 PECL/Element/Resource.php
  21. +241 −0 PECL/Element/Stream.php
  22. +464 −0 PECL/Element/Test.php
  23. +2,566 −0 PECL/Extension.php
  24. +1,369 −0 PECL/ExtensionParser.php
  25. +125 −0 PECL/Maintainer.php
  26. +127 −0 PECL/Release.php
  27. +279 −0 PECL/Tools/ProtoLexer.php
  28. +139 −0 PECL/Tools/ProtoLexer.plex
  29. +1,292 −0 PECL/Tools/ProtoParser.php
  30. +105 −0 PECL/Tools/ProtoParser.y
  31. +8 −4 README
  32. +90 −0 TODO
  33. +8 −0 docs/Makefile
  34. +44 −0 docs/RFC_proto.txt
  35. +4 −0 docs/examples/Makefile
  36. +73 −0 docs/examples/README
  37. +45 −0 docs/examples/api_functions.xml
  38. +275 −0 docs/examples/cairo.xml
  39. +24 −0 docs/examples/class_abstract.xml
  40. +25 −0 docs/examples/class_constant.xml
  41. +18 −0 docs/examples/class_extends.xml
  42. +80 −0 docs/examples/class_methods.xml
  43. +69 −0 docs/examples/class_methods_abstract.xml
  44. +26 −0 docs/examples/class_methods_final.xml
  45. +9 −0 docs/examples/class_minimal.xml
  46. +77 −0 docs/examples/class_payload.xml
  47. +232 −0 docs/examples/class_properties.xml
  48. +47 −0 docs/examples/class_type_hints.xml
  49. +9 −0 docs/examples/code_pi.xml
  50. +21 −0 docs/examples/constants.xml
  51. +11 −0 docs/examples/crossext.xml
  52. +70 −0 docs/examples/function_by_ref.xml
  53. +41 −0 docs/examples/function_type_hints.xml
  54. +31 −0 docs/examples/globals.xml
  55. +82 −0 docs/examples/interface.xml
  56. +53 −0 docs/examples/interface_simple.xml
  57. +5 −0 docs/examples/license.xml
  58. +3 −0 docs/examples/minimal.xml
  59. +20 −0 docs/examples/parsing.xml
  60. +1 −0 docs/examples/parsing_1.inc
  61. +3 −0 docs/examples/parsing_2.inc
  62. +17 −0 docs/examples/phpini.xml
  63. +57 −0 docs/examples/release.xml
  64. +56 −0 docs/examples/resource.xml
  65. +48 −0 docs/examples/resource_cpp.xml
  66. +56 −0 docs/examples/resource_old.xml
  67. +3 −0 docs/examples/snippet.c
  68. +3 −0 docs/examples/snippet1.c
  69. +3 −0 docs/examples/snippet2.c
  70. +29 −0 docs/examples/test.sh
  71. +37 −0 docs/examples/testcase.xml
  72. +8 −0 docs/examples/with_1.xml
  73. +194 −0 docs/extension.dtd
  74. +4,331 −0 docs/manual.html
  75. BIN docs/manual.pdf
  76. +1,922 −0 docs/manual.xml
  77. +504 −0 package2.xml
  78. +48 −0 pecl-gen
View
68 LICENSE
@@ -0,0 +1,68 @@
+--------------------------------------------------------------------
+ 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
@@ -0,0 +1,265 @@
+<?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 d1498da

Please sign in to comment.