cvs: php-gtk-doc /updater classdoc.tpl createClassDoc.php
[email protected] ("Christian Weiske")
| Newsgroups | php.gtk.doc |
|---|---|
| Message-ID | <cvscweiske1160580068@cvsserver> |
cweiske Wed Oct 11 15:21:08 2006 UTC
Added files:
/php-gtk-doc/updater classdoc.tpl createClassDoc.php
Log:
Simple script to create a classdoc from a template
http://cvs.php.net/viewvc.cgi/php-gtk-doc/updater/classdoc.tpl?view=markup&rev=1.1
Index: php-gtk-doc/updater/classdoc.tpl
+++ php-gtk-doc/updater/classdoc.tpl
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<classentry id="{CLASSID}">
<classmeta>
<classtitle>{CLASSNAME}</classtitle>
<classparent>{CLASSPARENT}</classparent>
<shortdesc>
</shortdesc>
<desc>
</desc>
</classmeta>
</classentry>
http://cvs.php.net/viewvc.cgi/php-gtk-doc/updater/createClassDoc.php?view=markup&rev=1.1
Index: php-gtk-doc/updater/createClassDoc.php
+++ php-gtk-doc/updater/createClassDoc.php
<?php
/**
for line in `cat missing`; do line2=`echo $line | tr [A-Z] [a-z]`; php createMissingClassDocs.php $line > $line2.xml; done
*/
if ($argc != 2) {
die('Please specify the classname to create the doc for.' . "\n");
}
$strClass = $argv[1];
preg_match_all('/^([A-Z][a-z]{2,5})[A-Z]/', $strClass, $matches);
if (isset($matches[1][0])) {
$strPrefix = strtolower($matches[1][0]);
} else {
$strPrefix = strtolower(substr($strClass, 0, 3));
echo 'Could not determine prefix for class "' . $strClass . '". Using "' . $strPrefix . "\"\n";
}
try {
$rClass = new ReflectionClass($strClass);
$rParent = $rClass->getParentClass();
} catch (Exception $e) {
die('Class "' . $strClass . '" does not exist.' . "\n");
}
if ($rParent == null) {
$strParent = '<!-- REMOVE THIS LINE -->';
} else {
$strParent = $rParent->getName();
}
echo str_replace(array(
'{CLASSID}',
'{CLASSNAME}',
'{CLASSPARENT}'
),array(
strtolower($strPrefix . '.' . $strClass),
$strClass,
$strParent
), file_get_contents(dirname(__FILE__) . '/classdoc.tpl'));
?>