protected function handleRequiredDependencies($moduleNamespace, $dependencies, $activateDependencies)
    {
        foreach ($dependencies as $dependencyModuleNamespace => $version) {
            $dependencyModuleNamespace = Framework::prepareNamespace($dependencyModuleNamespace);
            
            $module = $this->getModule($dependencyModuleNamespace);
            if ($module === false) {
                if ($activateDependencies) {
                    $this->activateModule($dependencyModuleNamespace, $activateDependencies);
                } else {
                    throw new Exception('Can not activate the module "' . $moduleNamespace . '". The module requires the module "' . $dependencyModuleNamespace . '" which isn\'t activated.');
                }
            }
        }
    }