mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +00:00
3baf1774b2
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1524 48356398-32a2-884e-a903-53898d9a118a
23 lines
604 B
PHP
23 lines
604 B
PHP
<?php
|
|
|
|
/**
|
|
* Takes an array of keys to strings, probably generated by
|
|
* ConfigSchema_StringHashParser
|
|
*/
|
|
class ConfigSchema_StringHashAdapter
|
|
{
|
|
|
|
/**
|
|
* Takes a string hash and calls the appropriate functions in $schema
|
|
* based on its values.
|
|
*/
|
|
public function adapt($hash, $schema) {
|
|
list($ns, $directive) = explode('.', $hash['ID'], 2);
|
|
$default = eval("return {$hash['DEFAULT']};");
|
|
$type = $hash['TYPE'];
|
|
$description = $hash['DESCRIPTION'];
|
|
$schema->add($ns, $directive, $default, $type, $description);
|
|
}
|
|
|
|
}
|