src/ministruts/FrontController.php
public static function me() {
        if (CLI) throw new IllegalStateException('Can not use '.static::class.' in this context.');

        $cache = Cache::me();

        // cache hit?
        $controller = $cache->get(static::class);
        if (!$controller) {
            // synchronize parsing of the struts-config.xml                 // TODO: Don't lock on the config file because it can block
            // $lock = new FileLock($configFile);                           //       concurrent reads, see Todo-File at locking.
            //                                                              //
            // $controller = $cache->get($class);                           // re-check after the lock is aquired

                if (!$controller) {
                    $controller = self::getInstance(static::class);
                    $configDir  = self::di('config')['app.dir.config'];
                    $configFile = str_replace('\\', '/', $configDir.'/struts-config.xml');
                    $dependency = FileDependency::create($configFile);
                    if (!WINDOWS && !LOCALHOST)                             // distinction dev/production?  TODO: non-sense
                        $dependency->setMinValidity(1 * MINUTE);

                    // ...and cache it with a FileDependency
                    $cache->set(static::class, $controller, Cache::EXPIRES_NEVER, $dependency);
                }

            //$lock->release();
        }
        return $controller;
    }
public static function me() {
        if (CLI) throw new IllegalStateException('Can not use '.static::class.' in this context.');

        $cache = Cache::me();

        // cache hit?
        $controller = $cache->get(static::class);
        if (!$controller) {
            // synchronize parsing of the struts-config.xml                 // TODO: Don't lock on the config file because it can block
            // $lock = new FileLock($configFile);                           //       concurrent reads, see Todo-File at locking.
            //                                                              //
            // $controller = $cache->get($class);                           // re-check after the lock is aquired

                if (!$controller) {
                    $controller = self::getInstance(static::class);
                    $configDir  = self::di('config')['app.dir.config'];
                    $configFile = str_replace('\\', '/', $configDir.'/struts-config.xml');
                    $dependency = FileDependency::create($configFile);
                    if (!WINDOWS && !LOCALHOST)                             // distinction dev/production?  TODO: non-sense
                        $dependency->setMinValidity(1 * MINUTE);

                    // ...and cache it with a FileDependency
                    $cache->set(static::class, $controller, Cache::EXPIRES_NEVER, $dependency);
                }

            //$lock->release();
        }
        return $controller;
    }
public static function me ( ) { if ( CLI ) throw new IllegalStateException ( 'Can not use ' . static :: class . ' in this context.' ) ; $ cache = Cache :: me ( ) ; // cache hit? $ controller = $ cache -> get ( static :: class ) ; if ( ! $ controller ) { // synchronize parsing of the struts-config.xml                 // TODO: Don't lock on the config file because it can block // $lock = new FileLock($configFile);                           //       concurrent reads, see Todo-File at locking. //                                                              // // $controller = $cache->get($class);                           // re-check after the lock is aquired if ( ! $ controller ) { $ controller = self :: getInstance ( static :: class ) ; $ configDir = self :: di ( 'config' ) [ 'app.dir.config' ] ; $ configFile = str_replace ( '\\' , '/' , $ configDir . '/struts-config.xml' ) ; $ dependency = FileDependency :: create ( $ configFile ) ; if ( ! WINDOWS && ! LOCALHOST ) // distinction dev/production?  TODO: non-sense $ dependency -> setMinValidity ( 1 * MINUTE ) ; // ...and cache it with a FileDependency $ cache -> set ( static :: class , $ controller , Cache :: EXPIRES_NEVER , $ dependency ) ; } //$lock->release(); } return $ controller ; }
Return the singleton instance of this class. The instance might be loaded from a cache.

@return static
Return the singleton instance of this class . The instance might be loaded from a cache .