8 function __construct($context = null, $processor = null, $formatter = null) {
10 $this->processor = $processor;
12 $this->processor = new Processor\Trac();
15 $this->processor->setContext($context);
17 $this->processor->setFormatter($formatter);
18 $storage_class = $this->processor->getContext('storage.class');
19 if (!$storage_class) $storage_class = 'Dummy';
20 $c = new \ReflectionClass("sfjp\\Wiki\\Storage\\{$storage_class}");
21 $storage = $c->newInstance();
22 $this->processor->setContext(array('storage' => $storage));
25 public function parse($text) {
26 $this->processor->reset();
27 return $this->processor->process($text)->getFormattedText();
30 public function getFormattedText() {
31 return $this->processor->getFormattedText();
34 public function isVary() {
35 return $this->processor->isVary();
38 public function setContext($c) {
39 $this->processor->setContext($c);
42 public function getContext($key = null) {
43 return $this->processor->getContext($key);
46 public function removeContext($key) {
47 $this->processor->removeContext($key);
50 public function clearContext() {
51 $this->processor->clearContext();
54 public function reset() {
55 $this->processor->reset();