protected function flushCache(Module $current = null)
    {
        $message = '';
        if ($current === null) {
            $current = Yii::$app;
        }
        $modules = $current->getModules();
        foreach ($modules as $moduleName => $module) {
            if (is_array($module)) {
                $module = $current->getModule($moduleName, true);
            }
            if ($module instanceof Module) {
                $message .= $this->flushCache($module);
            }
        }
        $components = $current->getComponents();
        foreach ($components as $componentName => $component) {
            if (is_array($component) && $componentName != 'user') {
                $component = $current->get($componentName);
            }
            if ($component instanceof Cache) {
                $message .= $component->flush() ?
                    '<p>' . Yii::t(
                        'wocenter/app', '{currentModuleName}: {componentName} is flushed.', [
                            'currentModuleName' => $current->className(),
                            'componentName' => $component->className(),
                        ]
                    ) . '</p>' :
                    '';
            }
        }
        
        return $message;
    }