public function CompileFrom($sSourceEnv, $bUseSymLinks = false)
 {
     $oSourceConfig = new Config(utils::GetConfigFilePath($sSourceEnv));
     $sSourceDir = $oSourceConfig->Get('source_dir');
     $sSourceDirFull = APPROOT . $sSourceDir;
     // Do load the required modules
     //
     $oFactory = new ModelFactory($sSourceDirFull);
     foreach ($this->GetMFModulesToCompile($sSourceEnv, $sSourceDir) as $oModule) {
         $sModule = $oModule->GetName();
         $oFactory->LoadModule($oModule);
         if ($oFactory->HasLoadErrors()) {
             break;
         }
     }
     if ($oFactory->HasLoadErrors()) {
         foreach ($oFactory->GetLoadErrors() as $sModuleId => $aErrors) {
             echo "<h3>Module: " . $sModuleId . "</h3>\n";
             foreach ($aErrors as $oXmlError) {
                 echo "<p>File: " . $oXmlError->file . " Line:" . $oXmlError->line . " Message:" . $oXmlError->message . "</p>\n";
             }
         }
     } else {
         $oFactory->ApplyChanges();
         //$oFactory->Dump();
         $sTargetDir = APPROOT . 'env-' . $this->sTargetEnv;
         self::MakeDirSafe($sTargetDir);
         $oMFCompiler = new MFCompiler($oFactory);
         $oMFCompiler->Compile($sTargetDir, null, $bUseSymLinks);
         require_once APPROOT . '/core/dict.class.inc.php';
         MetaModel::ResetCache(md5(APPROOT) . '-' . $this->sTargetEnv);
     }
 }