cvs: pear /CodeGen_MySQL/MySQL Extension.php ExtensionParser.php /CodeGen_MySQL/MySQL/Element Test.php
| From: | Hartmut Holzgraefe | Date: | Tue, 10 Oct 2006 12:15:48 +0000 |
| Subject: | cvs: pear /CodeGen_MySQL/MySQL Extension.php ExtensionParser.php /CodeGen_MySQL/MySQL/Element Test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42480@lists.php.net to get a copy of this message | ||
hholzgra Tue Oct 10 12:15:48 2006 UTC
Modified files:
/pear/CodeGen_MySQL/MySQL Extension.php ExtensionParser.php
/pear/CodeGen_MySQL/MySQL/Element Test.php
Log:
CS/WS fixes
http://cvs.php.net/viewvc.cgi/pear/CodeGen_MySQL/MySQL/Extension.php?r1=1.11&r2=1.12&diff_format=u
Index: pear/CodeGen_MySQL/MySQL/Extension.php
diff -u pear/CodeGen_MySQL/MySQL/Extension.php:1.11 pear/CodeGen_MySQL/MySQL/Extension.php:1.12
--- pear/CodeGen_MySQL/MySQL/Extension.php:1.11 Thu Jun 15 20:48:56 2006
+++ pear/CodeGen_MySQL/MySQL/Extension.php Tue Oct 10 12:15:47 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: Extension.php,v 1.11 2006/06/15 20:48:56 hholzgra Exp $
+ * @version CVS: $Id: Extension.php,v 1.12 2006/10/10 12:15:47 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_MySQL_UDF
*/
@@ -68,6 +68,13 @@
*/
protected $libdir = "";
+ /**
+ * Is the full source needed to compile this?
+ *
+ * @var bool
+ */
+ protected $needSource = false;
+
// {{{ constructor
/**
@@ -82,11 +89,21 @@
// }}}
// {{{ member adding functions
+
+ /**
+ * Do we need the full source to compile?
+ *
+ * @param bool
+ */
+ function setNeedSource($flag)
+ {
+ $this->needSource = (bool)$flag;
+ }
// }}}
// {{{ output generation
-
+
// {{{ license and authoers
/**
@@ -134,7 +151,7 @@
$this->addPackageFile("doc", "AUTHORS");
echo "{$this->name}\n";
$names = array();
- foreach($this->authors as $author) {
+ foreach ($this->authors as $author) {
$names[] = $author->getName();
}
echo join(", ", $names) . "\n";
@@ -364,6 +381,12 @@
echo "AC_LANG([C++])\n";
}
+ if ($this->needSource) {
+ echo "WITH_MYSQL_SRC()\n";
+ } else {
+ echo "WITH_MYSQL()\n";
+ }
+
foreach ($this->configfragments['bottom'] as $fragment) {
echo "$fragment\n";
}
@@ -409,7 +432,8 @@
* @access public
* @param object a Test object
*/
- function addTest(CodeGen_MySQL_Element_Test $test) {
+ function addTest(CodeGen_MySQL_Element_Test $test)
+ {
$name = $test->getName();
if (isset($this->testcases[$name])) {
@@ -455,4 +479,3 @@
* indent-tabs-mode:nil
* End:
*/
-?>
http://cvs.php.net/viewvc.cgi/pear/CodeGen_MySQL/MySQL/ExtensionParser.php?r1=1.3&r2=1.4&diff_format=u
Index: pear/CodeGen_MySQL/MySQL/ExtensionParser.php
diff -u pear/CodeGen_MySQL/MySQL/ExtensionParser.php:1.3
pear/CodeGen_MySQL/MySQL/ExtensionParser.php:1.4
--- pear/CodeGen_MySQL/MySQL/ExtensionParser.php:1.3 Sun Mar 12 14:07:02 2006
+++ pear/CodeGen_MySQL/MySQL/ExtensionParser.php Tue Oct 10 12:15:47 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: ExtensionParser.php,v 1.3 2006/03/12 14:07:02 hholzgra Exp $
+ * @version CVS: $Id: ExtensionParser.php,v 1.4 2006/10/10 12:15:47 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen_MySQL
*/
@@ -41,7 +41,8 @@
abstract class CodeGen_MySQL_ExtensionParser
extends CodeGen_ExtensionParser
{
- function tagstart_test($attr) {
+ function tagstart_test($attr)
+ {
static $testCount = 0;
$test = $this->extension->testFactory();
@@ -59,7 +60,8 @@
$this->pushHelper($test);
}
- function tagend_test_description($attr, $data) {
+ function tagend_test_description($attr, $data)
+ {
$this->helper->setDescription(CodeGen_Tools_Indent::linetrim($data));
}
@@ -83,22 +85,30 @@
}
}
- function tagend_test_result($attr, $data) {
+ function tagend_test_result($attr, $data)
+ {
$err = $this->helper->setResult(CodeGen_Tools_Indent::linetrim($data));
return $err;
}
- function tagend_test($attr, $data) {
+ function tagend_test($attr, $data)
+ {
$test = $this->popHelper();
$err = $this->extension->addTest($test);
return $err;
}
- function tagend_tests($attr, $data) {
+ function tagend_tests($attr, $data)
+ {
return true;
}
+
+ function tagend_deps_src($attr, $data)
+ {
+ $this->extension->setNeedSource(true);
+ }
}
http://cvs.php.net/viewvc.cgi/pear/CodeGen_MySQL/MySQL/Element/Test.php?r1=1.1&r2=1.2&diff_format=u
Index: pear/CodeGen_MySQL/MySQL/Element/Test.php
diff -u pear/CodeGen_MySQL/MySQL/Element/Test.php:1.1 pear/CodeGen_MySQL/MySQL/Element/Test.php:1.2
--- pear/CodeGen_MySQL/MySQL/Element/Test.php:1.1 Fri Jun 2 21:15:12 2006
+++ pear/CodeGen_MySQL/MySQL/Element/Test.php Tue Oct 10 12:15:47 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: Test.php,v 1.1 2006/06/02 21:15:12 hholzgra Exp $
+ * @version CVS: $Id: Test.php,v 1.2 2006/10/10 12:15:47 hholzgra Exp $
* @link http://pear.php.net/package/CodeGen
*/
@@ -59,7 +59,8 @@
*
* @access public
* @return string value of
- */ function setName($name)
+ */
+ function setName($name)
{
if (! preg_match('|^[\w-]+$|i', $name)) {
return PEAR::raiseError("'$name' is not a valid test case
basename");
@@ -192,20 +193,20 @@
{
$extName = $extension->getName();
- $testName = "tests/t/{$this->name}.test";
+ $testName = "tests/t/{$this->name}.test";
$extension->addPackageFile("test", $testName);
- $file = new CodeGen_Tools_Outbuf($extension->dirpath."/".$testName);
- echo "# Package: $extName Test: {$this->name}\n#\n";
- echo preg_replace("/^/", "# ", $this->description);
- echo $this->code;
+ $file = new CodeGen_Tools_Outbuf($extension->dirpath."/".$testName);
+ echo "# Package: $extName Test: {$this->name}\n#\n";
+ echo preg_replace("/^/", "# ", $this->description);
+ echo $this->code;
$file->write();
$resultName = "tests/r/{$this->name}.result";
$extension->addPackageFile("test", $resultName);
- $file = new CodeGen_Tools_Outbuf($extension->dirpath."/".$resultName);
- echo $this->result;
+ $file = new CodeGen_Tools_Outbuf($extension->dirpath."/".$resultName);
+ echo $this->result;
$file->write();
}
}