cvs: php4 /scripts/ext_skel_ng extension_parser.php
| From: | Hartmut Holzgraefe | Date: | Thu, 24 Apr 2003 18:03:12 +0000 |
| Subject: | cvs: php4 /scripts/ext_skel_ng extension_parser.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20470@lists.php.net to get a copy of this message | ||
hholzgra Thu Apr 24 14:03:12 2003 EDT
Modified files:
/php4/scripts/ext_skel_ng extension_parser.php
Log:
<![CDATA[ generates additional linefeeds?
-> trim these ...
Index: php4/scripts/ext_skel_ng/extension_parser.php
diff -u php4/scripts/ext_skel_ng/extension_parser.php:1.19
php4/scripts/ext_skel_ng/extension_parser.php:1.20
--- php4/scripts/ext_skel_ng/extension_parser.php:1.19 Wed Apr 23 12:40:52 2003
+++ php4/scripts/ext_skel_ng/extension_parser.php Thu Apr 24 14:03:12 2003
@@ -68,7 +68,7 @@
}
function handle_extension_description($attr) {
- $this->description = $this->cdata;
+ $this->description = $this->_trimdata();
}
function handle_extension_logo($attr) {
@@ -168,11 +168,11 @@
// {{{ resources
function handle_resources_resource_destruct($attr) {
- $this->resource_destruct = $this->cdata;
+ $this->resource_destruct = $this->_trimdata();
}
function handle_resources_resource_description($attr) {
- $this->resource_description = $this->cdata;
+ $this->resource_description = $this->_trimdata();
}
function handle_resources_resource($attr) {
@@ -197,20 +197,26 @@
$this->func_summary = trim($this->cdata);
}
+ function _trimdata() {
+ $text = preg_replace('|^\s*\n|m','', $this->cdata);
+ $text = preg_replace('|\n\s*$|m',"\n", $text);
+ return $text;
+ }
+
function handle_functions_function_proto($attr) {
$this->func_proto = trim($this->cdata);
}
function handle_functions_function_description($attr) {
- $this->func_desc = trim($this->cdata);
+ $this->func_desc = $this->_trimdata();
}
function handle_functions_function_code($attr) {
- $this->func_code = $this->cdata;
+ $this->func_code = $this->_trimdata();
}
function handle_code($attr) {
- $this->code[$attr["role"]][] = $this->cdata;
+ $this->code[$attr["role"]][] = $this->_trimdata();
}
function handle_functions_function($attr) {
@@ -306,7 +312,6 @@
function generate_documentation() {
$id_name = str_replace('_', '-', $this->name);
- system("rm -rf {$this->name}/manual");
mkdir("{$this->name}/manual");
$docdir = "{$this->name}/manual/$id_name";