Beispiel #1
0
                        break;
                        //Property NameShould be the last One
                    } else {
                        $this->navigation->args[] = $part;
                    }
            }
        }
        MemPool::instance()->set('bong.mvc.controller', $this->navigation->controllerName);
        MemPool::instance()->set('bong.mvc.method', $this->navigation->methodName);
    }
    public function prepareEngine()
    {
        switch ($this->navigation->controllerExtension) {
            case 'json':
                $this->_engine = EngineFactory::produce('AppJSONServiceEngine');
                break;
            case 'xml':
                $this->_engine = EngineFactory::produce('AppXMLServiceEngine');
                break;
            case 'prop':
                $this->_engine = EngineFactory::produce('AppPropertyServiceEngine');
                break;
            case 'res':
                $this->_engine = EngineFactory::produce('AppResponseServiceEngine');
                break;
        }
        parent::prepareEngine();
    }
}
RouterFactory::register('AppServiceRouter');
Beispiel #2
0
<?php

final class StaticContentRouter extends AbstractContentRouter
{
    public function buildNavigation($path)
    {
    }
}
RouterFactory::register('StaticContentRouter');
Beispiel #3
0
        $extParts = explode('.', array_pop($path));
        $ext = count($extParts) >= 2 ? end($extParts) : null;
        $this->navigation->extension = $ext;
        $preferedExtension = null;
        switch ($this->navigation->resourceType) {
            case 'sys':
            case 'scrap':
                $preferedExtension = null;
                break;
            case 'img':
                $preferedExtension = 'png';
                break;
            case 'js':
                $preferedExtension = 'js';
                break;
            case 'css':
                $preferedExtension = 'css';
                break;
            case 'xslt':
                $preferedExtension = 'xsl';
                break;
            default:
        }
        $this->navigation->preferedExtension = $preferedExtension;
        $this->navigation->followSpecifiedExtension = $this->navigation->resourceType == 'img' ? !(!$ext && $preferedExtension) : is_null($preferedExtension) || $ext == $preferedExtension;
        $this->navigation->estimatedContentName = !$this->navigation->followSpecifiedExtension ? rtrim($this->navigation->contentName, '.') . '.' . $preferedExtension : $this->navigation->contentName;
        //print_r($this->navigation);
    }
}
RouterFactory::register('ResourceRouter');
Beispiel #4
0
                    $this->navigation->args[] = $rack[$i];
                }
            } else {
                if (count($rack) > 1) {
                    //Ignore if no MethodName is provided
                    $spirit = new stdClass();
                    $spirit->spiritName = substr($rack[0], 1);
                    //remove the + sign
                    $spirit->methodName = $rack[1];
                    $spirit->args = array();
                    for ($i = 2; $i < count($rack); ++$i) {
                        $spirit->args[] = $rack[$i];
                    }
                    $this->navigation->spirits[] = $spirit;
                }
            }
        }
        if (is_null($this->navigation->controllerName)) {
            $this->navigation->controllerName = 'default';
        }
        if (is_null($this->navigation->methodName)) {
            $this->navigation->methodName = 'main';
        }
        MemPool::instance()->set('bong.mvc.controller', $this->navigation->controllerName);
        MemPool::instance()->set('bong.mvc.method', $this->navigation->methodName);
        Runtime::loadModule('mvc');
        //print_r($this->navigation);
    }
}
RouterFactory::register('MVCRouter');
Beispiel #5
0
        $this->navigation->spiritName = substr($spiritName, 1);
        $this->navigation->methodName = $spiritMethodName;
        $this->navigation->args = $spiritMethodArgs;
        $this->navigation->spiritExtension = substr($spiritExtension, 1);
        $this->navigation->spiritInstanceId = $spiritInstanceId;
        $this->navigation->propertyName = $propertyPos == -1 ? null : substr($propParts[0], 1);
        Mempool::instance()->set('bong.mvc.controller', $this->navigation->controllerName);
        MemPool::instance()->set('bong.mvc.method', $this->navigation->controllerMethodName);
        //print_r($this->navigation);
    }
    public function prepareEngine()
    {
        switch ($this->navigation->spiritExtension) {
            case 'json':
                $this->_engine = EngineFactory::produce('SpiritJSONServiceEngine');
                break;
            case 'xml':
                $this->_engine = EngineFactory::produce('SpiritXMLServiceEngine');
                break;
            case 'prop':
                $this->_engine = EngineFactory::produce('SpiritPropertyServiceEngine');
                break;
            case 'res':
                $this->_engine = EngineFactory::produce('SpiritResponseServiceEngine');
                break;
        }
        parent::prepareEngine();
    }
}
RouterFactory::register('SpiritServiceRouter');
Beispiel #6
0
<?php

class FSMRouter extends AbstractContentRouter
{
    public function __construct()
    {
        parent::__construct("FSMEngine");
    }
    public function buildNavigation($path)
    {
    }
}
RouterFactory::register('FSMRouter');