/** * Returns the CDF manager. * * @return Opt_Cdf_Manager */ public function getCdfManager() { if ($this->_cdfManager === null) { $this->_cdfManager = new Opt_Cdf_Manager($this->_tpl, $this->_tpl->_getList('_formats')); } return $this->_cdfManager; }
/** * Sets the compiler instance. * * @param Opt_Compiler_Class $compiler The compiler object */ public function setCompiler(Opt_Compiler_Class $compiler) { $this->_compiler = $compiler; $this->_tpl = Opl_Registry::get('opt'); if ($this->_tpl->unicodeNames) { // Register unicode name regular expressions $this->_rOpeningChar = '(\\p{Lu}|\\p{Ll}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Nl}|\\_|\\:)'; $this->_rNameChar = '(\\p{Lu}|\\p{Ll}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Nl}|\\p{Mc}|\\p{Me}|\\p{Mn}|\\p{Lm}|\\p{Nd}|\\_|\\:|\\.|\\-)'; $this->_rModifiers = 'msiu'; } // Register the rest of the expressions $this->_rNameExpression = '/(' . $this->_rOpeningChar . '?' . $this->_rNameChar . '*)/' . $this->_rModifiers; $this->_rXmlTagExpression = '/(\\<((\\/)?(' . $this->_rOpeningChar . '?' . $this->_rNameChar . '*)( [^\\<\\>]*)?(\\/)?)\\>)/' . $this->_rModifiers; $this->_rTagExpandExpression = '/^(\\/)?(' . $this->_rOpeningChar . '?' . $this->_rNameChar . '*)( [^\\<\\>]*)?(\\/)?$/' . $this->_rModifiers; $this->_rQuirksTagExpression = '/(\\<((\\/)?((' . implode('|', $this->_tpl->_getList('_namespaces')) . ')\\:' . $this->_rNameChar . '*)( [^\\<\\>]+)?(\\/)?)\\>)/' . $this->_rModifiers; }
/** * @covers Opt_Class::register */ public function testRegisterInstruction() { $this->_tpl->register(Opt_Class::OPT_INSTRUCTION, 'Foo'); $this->_tpl->register(Opt_Class::OPT_INSTRUCTION, 'Bar', 'Bar_Joe'); $out = $this->_tpl->_getList('_instructions'); $this->assertArrayHasKey('Foo', $out); $this->assertContains('Opt_Instruction_Foo', $out); $this->assertArrayHasKey('Bar', $out); $this->assertContains('Bar_Joe', $out); return true; }