public function TestApplication($ApplicationName, &$Validation) { // Add the application to the $EnabledApplications array in conf/applications.php $ApplicationInfo = ArrayValueI($ApplicationName, $this->AvailableApplications(), array()); $ApplicationName = $ApplicationInfo['Index']; $ApplicationFolder = ArrayValue('Folder', $ApplicationInfo, ''); if ($ApplicationFolder == '') { throw new Exception(T('The application folder was not properly defined.')); } // Hook directly into the autoloader and force it to load the newly tested application Gdn_Autoloader::AttachApplication($ApplicationFolder); // Redefine the locale manager's settings $Locale->Set($CurrentLocale, $EnabledApps, $EnabledPlugins, TRUE); $Locale = Gdn::Locale(); $Locale->Set($Locale->Current(), $this->EnabledApplicationFolders(), Gdn::PluginManager()->EnabledPluginFolders(), TRUE); // Call the application's setup method $Hooks = $ApplicationName . 'Hooks'; if (!class_exists($Hooks)) { $HooksFile = PATH_APPLICATIONS . DS . $ApplicationFolder . '/settings/class.hooks.php'; if (file_exists($HooksFile)) { include $HooksFile; } } if (class_exists($Hooks)) { $Hooks = new $Hooks(); $Hooks->Setup(); } return TRUE; }