svn: /phd/trunk/ package_ide.xml phpdotnet/phd/Package/IDE/API/Function.php phpdotnet/phd/Package/IDE/demo.php

From: Date: Sun, 15 May 2011 14:29:33 +0000
Subject: svn: /phd/trunk/ package_ide.xml phpdotnet/phd/Package/IDE/API/Function.php phpdotnet/phd/Package/IDE/demo.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-8102@lists.php.net to get a copy of this message
philip Sun, 15 May 2011 14:29:33 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=311052 Log: Added changelog information to PhD_IDE Changed paths: U phd/trunk/package_ide.xml U phd/trunk/phpdotnet/phd/Package/IDE/API/Function.php U phd/trunk/phpdotnet/phd/Package/IDE/demo.php Modified: phd/trunk/package_ide.xml =================================================================== --- phd/trunk/package_ide.xml 2011-05-15 10:43:29 UTC (rev 311051) +++ phd/trunk/package_ide.xml 2011-05-15 14:29:33 UTC (rev 311052) @@ -34,6 +34,7 @@ <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> <notes> - Added first version of PHPStub package format + - Added changelog information (philip) </notes> <contents> Modified: phd/trunk/phpdotnet/phd/Package/IDE/API/Function.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/IDE/API/Function.php 2011-05-15 10:43:29 UTC (rev 311051) +++ phd/trunk/phpdotnet/phd/Package/IDE/API/Function.php 2011-05-15 14:29:33 UTC (rev 311052) @@ -89,6 +89,16 @@ private $seeAlsoEntries = array(); /** + * Array with the changelog entries of the function. + * Indexes: + * 'version': PHP version of change + * 'change': The change + * + * @var array + */ + private $changeLogEntries = array(); + + /** * Creates a new instance of Package_IDE_API_Function. * * @param SimpleXMLElement $xmlElement A new SimpleXMLElement @@ -116,6 +126,13 @@ $this->seeAlsoEntries[] = $entryArray; } } + if (isset($xmlElement->changelog->entry)) { + foreach ($xmlElement->changelog->entry as $entry) { + $entryArray['version'] = $entry->version; + $entryArray['change'] = $entry->change; + $this->changeLogEntries[] = $entryArray; + } + } } /** @@ -225,6 +242,16 @@ { return $this->seeAlsoEntries; } + + /** + * Array with the changelog entries of the function. + * + * @return array Array with the changelog entries. + */ + public function getchangeLogEntries() + { + return $this->changeLogEntries; + } } /* Modified: phd/trunk/phpdotnet/phd/Package/IDE/demo.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/IDE/demo.php 2011-05-15 10:43:29 UTC (rev 311051) +++ phd/trunk/phpdotnet/phd/Package/IDE/demo.php 2011-05-15 14:29:33 UTC (rev 311052) @@ -14,7 +14,7 @@ { echo <<<USAGE Usage: - phd-ide -d <phd output dir> -f <function> [-a|-p|-s|-S] + phd-ide -d <phd output dir> -f <function> [-a|-p|-l|-s|-S] phd-ide -d <phd output dir> -c <class> Options: @@ -23,6 +23,7 @@ -c, --class List the methods of a class. -a, --all Show all information about a function (require -f). -p, --params Show the params of a function (require -f). + -l, --changelog Show the changelog of a function (require -f). -s, --seealso Show the see also links of a function (require -f). -S, --signature Show the signature of a function and exit (require -f). -h, --help Show this info and exit. @@ -34,6 +35,7 @@ $OPTION['all'] = NULL; $OPTION['function'] = NULL; $OPTION['params'] = NULL; +$OPTION['changelog'] = NULL; $OPTION['seealso'] = NULL; $OPTION['signature'] = NULL; $OPTION['class'] = NULL; @@ -45,6 +47,7 @@ 'function:' => 'f:', 'all' => 'a', 'params' => 'p', + 'changelog' => 'l', 'seealso' => 's', 'signature' => 'S', 'help' => 'h', @@ -83,6 +86,10 @@ case 'params': $OPTION['params'] = true; break; + case 'l': + case 'changelog': + $OPTION['changelog'] = true; + break; case 's': case 'seealso': $OPTION['seealso'] = true; @@ -156,6 +163,15 @@ } } +if ($OPTION['all'] === true || $OPTION['changelog'] === true) { + echo 'Changelog: '; + foreach ($function->getChangelogEntries() as $entry) { + echo PHP_EOL; + echo "\tVersion: " . $entry['version'] . PHP_EOL; + echo "\tChange: " . $entry['change'] . PHP_EOL; + } +} + if ($OPTION['all'] === true || $OPTION['seealso'] === true) { echo 'See Also: '; foreach ($function->getSeeAlsoEntries() as $entry) {

« previous php.doc.cvs (#8102) next »