1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 
<?php
namespace Omeka\Service;

use Omeka\Stdlib\HtmlPurifier;
use Zend\ServiceManager\Factory\FactoryInterface;
use Interop\Container\ContainerInterface;

class HtmlPurifierFactory implements FactoryInterface
{
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
    {
        $settings = $serviceLocator->get('Omeka\Settings');
        return new HtmlPurifier($settings->get('use_htmlpurifier'));
    }
}