/**
  * Overridden to extract the charset from the params array and check if the
  * passed charset is supported or listed in the translation table in
  * CharsetStreamFilter::translatedCharsets.
  * 
  * Unfortunately __construct doesn't seem to be called for this class, so
  * setting up 'availableCharsets' in the constructor doesn't work out.
  */
 public function onCreate()
 {
     $charset = 'ISO-8859-1';
     if (!empty($this->params['charset'])) {
         $charset = $this->params['charset'];
     }
     $di = SimpleDi::singleton();
     $this->converter = $di->newCharsetConverter($charset, 'UTF-8');
 }
Ejemplo n.º 2
0
 /**
  * Constructs a PartStream.
  */
 public function __construct()
 {
     $di = SimpleDi::singleton();
     $this->registry = $di->getPartStreamRegistry();
 }
Ejemplo n.º 3
0
 protected function setUp()
 {
     $this->di = SimpleDi::singleton();
     $this->registry = $this->di->getPartStreamRegistry();
 }