cvs: pear /CodeGen_PECL/PECL/Element Constant.php /CodeGen_PECL/docs/examples constants.xml
| From: | Hartmut Holzgraefe | Date: | Thu, 09 Feb 2006 21:59:22 +0000 |
| Subject: | cvs: pear /CodeGen_PECL/PECL/Element Constant.php /CodeGen_PECL/docs/examples constants.xml | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38088@lists.php.net to get a copy of this message | ||
hholzgra Thu Feb 9 21:59:22 2006 UTC
Added files:
/pear/CodeGen_PECL/docs/examples constants.xml
Modified files:
/pear/CodeGen_PECL/PECL/Element Constant.php
Log:
fixed a bug in string constant generation
and added a testcase for constants
(thx johann for spotting this)
http://cvs.php.net/viewcvs.cgi/pear/CodeGen_PECL/PECL/Element/Constant.php?r1=1.3&r2=1.4&diff_format=u
Index: pear/CodeGen_PECL/PECL/Element/Constant.php
diff -u pear/CodeGen_PECL/PECL/Element/Constant.php:1.3
pear/CodeGen_PECL/PECL/Element/Constant.php:1.4
--- pear/CodeGen_PECL/PECL/Element/Constant.php:1.3 Tue Sep 13 22:16:46 2005
+++ pear/CodeGen_PECL/PECL/Element/Constant.php Thu Feb 9 21:59:22 2006
@@ -15,7 +15,7 @@
* @author Hartmut Holzgraefe <hartmut@php.net>
* @copyright 2005 Hartmut Holzgraefe
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Constant.php,v 1.3 2005/09/13 22:16:46 hholzgra Exp $
+ * @version CVS: $Id: Constant.php,v 1.4 2006/02/09 21:59:22 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -213,7 +213,7 @@
return "REGISTER_DOUBLE_CONSTANT(\"{$this->name}\",
{$this->value}, CONST_PERSISTENT | CONST_CS);\n";
case "string":
- return "REGISTER_STRING_CONSTANT(\"{$this->name}\",
\"$value\", ".strlen($this->value).", CONST_PERSISTENT | CONST_CS);\n";
+ return "REGISTER_STRINGL_CONSTANT(\"{$this->name}\",
\"{$this->value}\", ".strlen($this->value).", CONST_PERSISTENT |
CONST_CS);\n";
}
}
http://cvs.php.net/viewcvs.cgi/pear/CodeGen_PECL/docs/examples/constants.xml?view=markup&rev=1.1
Index: pear/CodeGen_PECL/docs/examples/constants.xml
+++ pear/CodeGen_PECL/docs/examples/constants.xml
<?xml version="1.0" ?>
<extension name="constants" version="0.9.0">
<constant name="C_INT" type="int" value="23"/>
<test>
<code>echo C_INT;</code>
<result>23</result>
</test>
<constant name="C_FLOAT" type="float" value="3.14"/>
<test>
<code>echo C_FLOAT;</code>
<result>3.14</result>
</test>
<constant name="C_STRING" type="string" value="hello world!"/>
<test>
<code>echo C_STRING;</code>
<result>hello world!</result>
</test>
</extension>