cvs: phpdoc /scripts/docgen docgen.php
| From: | Philip Olson | Date: | Sun, 16 Nov 2008 00:29:46 +0000 |
| Subject: | cvs: phpdoc /scripts/docgen docgen.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2569@lists.php.net to get a copy of this message | ||
philip Sun Nov 16 00:29:46 2008 UTC
Modified files:
/phpdoc/scripts/docgen docgen.php
Log:
format _ to - in all filenames
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/docgen.php?r1=1.6&r2=1.7&diff_format=u
Index: phpdoc/scripts/docgen/docgen.php
diff -u phpdoc/scripts/docgen/docgen.php:1.6 phpdoc/scripts/docgen/docgen.php:1.7
--- phpdoc/scripts/docgen/docgen.php:1.6 Fri Nov 14 18:00:47 2008
+++ phpdoc/scripts/docgen/docgen.php Sun Nov 16 00:29:45 2008
@@ -16,7 +16,7 @@
| Authors: Felipe Pena <felipe@php.net> |
+----------------------------------------------------------------------+
- $Id: docgen.php,v 1.6 2008/11/14 18:00:47 bjori Exp $
+ $Id: docgen.php,v 1.7 2008/11/16 00:29:45 philip Exp $
*/
if (!(extension_loaded('reflection') & extension_loaded('pcre'))) {
@@ -110,7 +110,10 @@
/* }}} */
function format_filename($name) { /* {{{ */
- return preg_replace('/^_+/', '', strtolower($name));
+ $name = strtolower(trim($name));
+ $name = ltrim($name, '_');
+ $name = str_replace('_', '-', $name);
+ return $name;
}
/* }}} */
@@ -573,7 +576,7 @@
switch ($type) {
case DOC_EXTENSION:
foreach ($DOC_EXT as $xml_file => $tpl_file) {
- $filename = $OPTION['output'] .'/'. $xml_file;
+ $filename = $OPTION['output'] .'/'. format_filename($xml_file);
$INFO['actual_file'] = $filename;
$content = file_get_contents(dirname(__FILE__) .'/'. $tpl_file);
@@ -606,7 +609,7 @@
/* Classes */
case DOC_CLASS:
$path = $OPTION['output'];
- $filename = $path .'/'. strtolower($obj->getName()) .'.xml';
+ $filename = $path .'/'. format_filename($obj->getName()) .'.xml';
$INFO['actual_file'] = $filename;
$content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]);
@@ -618,7 +621,7 @@
case DOC_FUNCTION:
$path = $OPTION['output'] .'/functions';
- $filename = $path .'/'. $obj->getName() .'.xml';
+ $filename = $path .'/'. format_filename($obj->getName()) .'.xml';
$INFO['actual_file'] = $filename;
create_dir($path);
@@ -752,7 +755,7 @@
switch ($opt) {
case 'v':
case 'version':
- printf("%s\n", '$Revision: 1.6 $');
+ printf("%s\n", '$Revision: 1.7 $');
break;
case 'V':
case 'verbose':