diff --git a/extras/ConfigSchema/StringHashReverseAdapter.php b/extras/ConfigSchema/StringHashReverseAdapter.php index c2549337..b953e9a9 100644 --- a/extras/ConfigSchema/StringHashReverseAdapter.php +++ b/extras/ConfigSchema/StringHashReverseAdapter.php @@ -48,11 +48,14 @@ class ConfigSchema_StringHashReverseAdapter $ret['ID'] = "$ns.$directive"; $ret['TYPE'] = $def->type; - $ret['DEFAULT'] = $this->export($this->schema->defaults[$ns][$directive]); // Attempt to extract version information from description. + $description = $this->normalize($def->description); + list($description, $version) = $this->extractVersion($description); - $ret['DESCRIPTION'] = wordwrap($this->normalize($def->description), 75, "\n"); + if ($version) $ret['VERSION'] = $version; + $ret['DEFAULT'] = $this->export($this->schema->defaults[$ns][$directive]); + $ret['DESCRIPTION'] = wordwrap($description, 75, "\n"); if ($def->allowed !== true) { $ret['ALLOWED'] = $this->exportLookup($def->allowed); @@ -108,4 +111,8 @@ class ConfigSchema_StringHashReverseAdapter return str_replace(array("\r\n", "\r"), "\n", $string); } + public function extractVersion($description) { + return array($description, false); + } + } diff --git a/tests/ConfigSchema/StringHashReverseAdapterTest.php b/tests/ConfigSchema/StringHashReverseAdapterTest.php index 4da69f90..4f156966 100644 --- a/tests/ConfigSchema/StringHashReverseAdapterTest.php +++ b/tests/ConfigSchema/StringHashReverseAdapterTest.php @@ -83,4 +83,8 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase $this->assertMethod('exportLookup', array('key' => true, 'key2' => true, 3 => true), "'key', 'key2', 3"); } + function assertExtraction($desc, $expect_desc, $expect_version) { + + } + }