Hi,

yesterday evening I started to port my ymcGitWiki[1] to MvcTools. I
found the following code in MvcTools/src/router.php:

    public function getRoutingInformation()
    {
        $routes = $this->createRoutes();

        if ( ezcBase::inDevMode() && ( !is_array( $routes ) || !count( 
$routes ) ) )
        {
            throw new ezcMvcNoRoutesException();
        }

        foreach ( $routes as $route )
        {
            if ( ezcBase::inDevMode() && !$route instanceof ezcMvcRoute )

ezcBase::inDevMode() is called several times in this method so it would
be better to save the mode once in a method local variable 
$inDevMode = ezcBase::inDevMode();

Another thing I thought about only now unfortunately:
Wouldn't it be faster to use a combination of 

define( 'EZC_PROD_MODE', TRUE ); // in ezcBase::setRunMode()
and 
if( !defined( 'EZC_PROD_MODE' ) ... {slow devmode code here} ?
  
[1] https://www.ohloh.net/projects/ymcgitwiki
-- 
Thomas Koch, Software Developer
http://www.koch.ro

Young Media Concepts GmbH
Sonnenstr. 4
CH-8280 Kreuzlingen
Switzerland

Tel    +41 (0)71 / 508 24 86
Fax    +41 (0)71 / 560 53 89
Mobile +49 (0)170 / 753 89 16
Web    www.ymc.ch
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to