public function checkModuleDepends($moduleName, Version $curVersion, Version $newVersion = null)
    {
        $modules = $this->getListAllModules();
        $clean = true;
        $i = 0;

        foreach ($modules as $module)
        {
            $depends = $this->def($module['name'], 'require', false, array());
            if (!is_array($depends))
            {
                $this->errors->add($this->configFile, $this->configFile.' is corrupted.');
                return false;
            }

            if (array_key_exists($moduleName, $depends))
            {
                if (!is_null($newVersion)) //Check for update a module
                {
                    $dependVersion = new Version($depends[$moduleName]);
                    if (!$newVersion->isPartOf($dependVersion))
                    {
                        $clean = false;
                        $this->errors->add("module_depend_$i", "Can not update $moduleName, ".$module['name'].' Depend to version '.$dependVersion->getOriginalVersion().' of '.$moduleName);
                    }
                }
                else //Check for delete a module
                {
                    $clean = false;
                    $this->errors->add("module_depend_$i", "Can not uninstall $moduleName, ".$module['name'].' Depend this module.');
                }
            }
            $i++;
        }

        if (!$clean)
            return true;
        return false;
    }