Permalink
Browse files

Update with 1.1.3 released code

  • Loading branch information...
1 parent 6a3bb2d commit 0acb8e1e7e0ba641509e0e1d69c19b18ee1a2310 @CloCkWeRX CloCkWeRX committed Dec 10, 2011
Showing with 4,880 additions and 890 deletions.
  1. +44 −0 CodeGen/PECL/Cli.php
  2. +3 −3 CodeGen/PECL/Command.php
  3. +3 −3 CodeGen/PECL/Dependency/Extension.php
  4. +3 −3 CodeGen/PECL/Dependency/Header.php
  5. +3 −3 CodeGen/PECL/Dependency/Lib.php
  6. +3 −3 CodeGen/PECL/Dependency/Platform.php
  7. +12 −10 CodeGen/PECL/Dependency/With.php
  8. +3 −3 CodeGen/PECL/Element.php
  9. +4 −4 CodeGen/PECL/Element/Class.php
  10. +11 −19 CodeGen/PECL/Element/ClassConstant.php
  11. +20 −30 CodeGen/PECL/Element/Constant.php
  12. +198 −52 CodeGen/PECL/Element/Function.php
  13. +1,660 −0 CodeGen/PECL/Element/Function.php.orig
  14. +12 −0 CodeGen/PECL/Element/Function.php.rej
  15. +3 −3 CodeGen/PECL/Element/Global.php
  16. +11 −9 CodeGen/PECL/Element/Ini.php
  17. +3 −3 CodeGen/PECL/Element/Interface.php
  18. +3 −3 CodeGen/PECL/Element/Logo.php
  19. +21 −6 CodeGen/PECL/Element/Method.php
  20. +3 −3 CodeGen/PECL/Element/Property.php
  21. +4 −4 CodeGen/PECL/Element/Resource.php
  22. +3 −3 CodeGen/PECL/Element/Stream.php
  23. +3 −3 CodeGen/PECL/Element/Test.php
  24. +190 −60 CodeGen/PECL/Extension.php
  25. +180 −45 CodeGen/PECL/ExtensionParser.php
  26. +4 −4 CodeGen/PECL/Maintainer.php
  27. +16 −8 CodeGen/PECL/Release.php
  28. +51 −26 CodeGen/PECL/Tools/ProtoLexer.php
  29. +215 −143 CodeGen/PECL/Tools/ProtoParser.php
  30. +13 −0 docs/examples/api_functions.xml
  31. +34 −6 docs/examples/class_extends.xml
  32. +20 −0 docs/examples/conditional_compile.xml
  33. +26 −0 docs/examples/deps_with.xml
  34. +17 −34 docs/examples/function_by_ref.xml
  35. +36 −0 docs/examples/groups.xml
  36. +16 −0 docs/examples/interface_class.xml
  37. +82 −0 docs/examples/interface_internal.xml
  38. +19 −0 docs/examples/lineno.xml
  39. +83 −0 docs/examples/optional_args.xml
  40. +8 −1 docs/examples/phpini.xml
  41. +57 −0 docs/examples/release_tags.xml
  42. +173 −0 docs/examples/return_array.xml
  43. +4 −0 docs/examples/syck.xml
  44. +170 −0 docs/examples/varargs.xml
  45. +1,433 −393 docs/manual.html
View
@@ -0,0 +1,44 @@
+<?php
+/**
+* Console script to generate PECL extensions from command line
+*
+* @author Hartmut Holzgraefe <hartmut@php.net>
+* @version $Id: pecl-gen,v 1.4 2006/06/25 11:35:22 hholzgra Exp $
+*/
+
+require_once "CodeGen/PECL/Command.php";
+
+// create extension object
+$extension = new CodeGen_PECL_Extension;
+
+$command = new CodeGen_PECL_Command($extension, "pecl-gen");
+
+if ($command->options->have("experimental", "x")) {
+ echo "the --experimental (-x) option has been deprecated
+
+please use the 'version' attribute of the <extension> tag
+to select version-specific features
+";
+
+ exit(3);
+}
+
+
+if ($command->options->have("function"))
+{
+ $command->singleFunction();
+ exit(0);
+}
+
+// ext_skel compatibility?
+if ($command->options->have("extname")) {
+ $command->extSkelCompat();
+ exit(0);
+}
+
+
+$parser = new CodeGen_PECL_ExtensionParser($extension);
+
+$command->execute($parser);
+
+?>
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Command.php,v 1.8 2007/03/19 18:15:08 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -37,7 +37,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Extension.php,v 1.9 2006/10/09 21:27:04 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Header.php,v 1.9 2006/10/09 21:27:04 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_PECL
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Lib.php,v 1.9 2006/09/05 08:31:54 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -31,7 +31,7 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Platform.php,v 1.7 2006/08/21 14:12:41 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_PECL
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen_PECL
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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_PECL
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: With.php,v 1.15 2006/10/10 07:18:46 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -332,6 +332,8 @@ function configm4(CodeGen_PECL_Extension $extension)
switch ($this->mode) {
case "pkg-config":
+ $pkgName = $this->getName();
+
$code.= "
if test -z \"\$PKG_CONFIG\"
then
@@ -342,25 +344,25 @@ function configm4(CodeGen_PECL_Extension $extension)
AC_MSG_ERROR([required utility 'pkg-config' not found])
fi
- if ! \$PKG_CONFIG --exists $withName
+ if ! \$PKG_CONFIG --exists $pkgName
then
- AC_MSG_ERROR(['$withName' not known to pkg-config])
+ AC_MSG_ERROR(['$pkgName' not known to pkg-config])
fi
";
if ($this->version) {
$code .= "
- if ! \$PKG_CONFIG --atleast-version {$this->version} $withName
+ if ! \$PKG_CONFIG --atleast-version {$this->version} $pkgName
then
- PKG_VERSION=`\$PKG_CONFIG --modversion $withName`
- AC_MSG_ERROR(['$withName'\ is version \$PKG_VERSION, {$this->version} required])
+ PKG_VERSION=`\$PKG_CONFIG --modversion $pkgName`
+ AC_MSG_ERROR(['$pkgName'\ is version \$PKG_VERSION, {$this->version} required])
fi
";
}
$code .= "
- PHP_EVAL_INCLINE(`\$PKG_CONFIG --cflags-only-I $withName`)
- PHP_EVAL_LIBLINE(`\$PKG_CONFIG --libs $withName`, {$extUpname}_SHARED_LIBADD)
+ PHP_EVAL_INCLINE(`\$PKG_CONFIG --cflags-only-I $pkgName`)
+ PHP_EVAL_LIBLINE(`\$PKG_CONFIG --libs $pkgName`, {$extUpname}_SHARED_LIBADD)
";
break;
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Element.php,v 1.4 2006/08/21 14:12:41 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: Class.php,v 1.31 2006/10/09 21:27:04 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -34,7 +34,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -542,7 +542,7 @@ function globalCode($extension)
}
if ($this->extends) {
- echo " {$this->name}_ce_ptr = zend_register_internal_class_ex(&ce, NULL, \"{$this->extends}\" TSRMLS_CC);\n";
+ echo " {$this->name}_ce_ptr = zend_register_internal_class_ex(&ce, {$this->extends}_ce_ptr, NULL TSRMLS_CC);\n";
} else {
echo " {$this->name}_ce_ptr = zend_register_internal_class(&ce);\n";
}
@@ -13,9 +13,9 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id$
+ * @version CVS: $Id: ClassConstant.php,v 1.6 2006/10/09 21:27:04 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -30,7 +30,7 @@
* @category Tools and Utilities
* @package CodeGen
* @author Hartmut Holzgraefe <hartmut@php.net>
- * @copyright 2005, 2006 Hartmut Holzgraefe
+ * @copyright 2005-2008 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
@@ -165,33 +165,25 @@ function setDesc($desc)
*/
function minitCode($classptr)
{
+ $key = '"'.$this->name.'"';
+ $key_len = strlen($this->name);
+
+ $code = $this->ifConditionStart();
+
switch ($this->type) {
case "string":
- $value = 'ZVAL_STRING(tmp, "'.$this->value.'", 1);';
+ $code.= " zend_declare_class_constant_stringl($classptr, $key, $key_len, \"{$this->value}\", ".strlen($this->value)." TSRMLS_CC );\n";
break;
case "int":
- $value = 'ZVAL_LONG(tmp, '.$this->value.');';
+ $code.= " zend_declare_class_constant_long($classptr, $key, $key_len, {$this->value} TSRMLS_CC );\n";
break;
case "float":
- $value = 'ZVAL_DOUBLE(tmp, '.$this->value.');';
+ $code.= " zend_declare_class_constant_double($classptr, $key, $key_len, {$this->value} TSRMLS_CC );\n";
break;
default:
return "";
}
- $key = '"'.$this->name.'"';
- $key_len = strlen($this->name) + 1;
-
-
- $code = $this->ifConditionStart();
-
- $code.= "
- tmp = (zval *) malloc(sizeof(zval));
- INIT_PZVAL(tmp);
- $value
- zend_symtable_update(&({$classptr}->constants_table), $key, $key_len, (void *) &tmp, sizeof(zval *), NULL);
-";
-
$code.= $this->ifConditionEnd();
return $code;
Oops, something went wrong.

0 comments on commit 0acb8e1

Please sign in to comment.