/** * Constructor * * @return void * @access public * @since 10/4/07 */ public function __construct() { $this->idMgr = new SimpleTableIdManager(); try { $this->dbc = Services::getService("DBHandler"); } catch (Exception $e) { $context = new OsidContext(); $configuration = new ConfigurationProperties(); Services::startManagerAsService("DatabaseManager", $context, $configuration); $this->dbc = Services::getService("DBHandler"); } }
function execute_update(array $types, array $functions) { if (!array_key_exists($_REQUEST['function'], $functions)) { throw new Exception("Unknown function, '" . $_REQUEST['function'] . "'."); } if (!array_key_exists($_REQUEST['db_type'], $types)) { throw new Exception("Unknown database type, '" . $_REQUEST['db_type'] . "'."); } switch ($_REQUEST['db_type']) { case MYSQL: $utilClass = "MySqlUtils"; break; case POSTGRESQL: $utilClass = "PostgreSQLUtils"; break; default: throw new Exception($types[$_REQUEST['db_type']] . " databases are not currently supported for updates."); } if (!class_exists($utilClass)) { throw new Exception("The selected database utility class, '" . $utilClass . "', does not exist."); } if (!method_exists($utilClass, $_REQUEST['function'])) { throw new Exception("The selected function, " . $_REQUEST['function'] . "(), is not currently supported by this database."); } // Now execute the update. $configuration = new ConfigurationProperties(); $context = new OSIDContext(); Services::startManagerAsService("DatabaseManager", $context, $configuration); $dbc = Services::getService('DBHandler'); $dbIndex = $dbc->createDatabase($_REQUEST['db_type'], $_REQUEST['db_host'], $_REQUEST['db_name'], $_REQUEST['db_user'], $_REQUEST['db_pass']); $dbc->connect($dbIndex); try { eval($utilClass . "::" . $_REQUEST['function'] . '($dbIndex);'); } catch (Exception $e) { // Close our connection $dbc->disconnect($dbIndex); throw $e; } $dbc->disconnect($dbIndex); }
<?php /** * Set up the SetsManager * * USAGE: Copy this file to sets.conf.php to set custom values. * * @package concerto.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id$ */ // :: Set up the Sets Manager :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); Services::startManagerAsService("SetManager", $context, $configuration);
* * * @package harmoni.utilities.tests * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: testList.php,v 1.4 2007/09/04 20:25:56 adamfranco Exp $ **/ if (!defined('HARMONI')) { require_once "../../harmoni.inc.php"; } if (!defined('SIMPLE_TEST')) { define('SIMPLE_TEST', HARMONI . 'simple_test/'); } require_once HARMONI . "errorHandler/ErrorHandler.class.php"; if (!Services::serviceAvailable("ErrorHandler")) { Services::registerService("ErrorHandler", "ErrorHandler"); require_once OKI2 . "osid/OsidContext.php"; $context = new OsidContext(); $context->assignContext('harmoni', $harmoni); require_once HARMONI . "oki2/shared/ConfigurationProperties.class.php"; $configuration = new ConfigurationProperties(); Services::startManagerAsService("ErrorHandler", $context, $configuration); } require_once SIMPLE_TEST . 'simple_unit.php'; require_once SIMPLE_TEST . 'dobo_simple_html_test.php'; $test = new GroupTest('Utilities tests'); $test->addTestFile(HARMONI . 'utilities/tests/OrderedListTestCase.class.php'); $test->attachObserver(new DoboTestHtmlDisplay()); $test->run();
<?php /** * Set up the IdManager as this is required for the ID service * * USAGE: Copy this file to id.conf.php to set custom values. * * @package concerto.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: logging_default.conf.php,v 1.3 2008/02/26 14:08:11 adamfranco Exp $ */ $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); Services::startManagerAsService("LoggingManager", $context, $configuration); /********************************************************* * If you wish to add a list of user agents and their uncaught * exceptions that should not be logged, uncomment the * lines below and add/remove Exception classes as needed. *********************************************************/ // $printer = SegueErrorPrinter::instance(); // $printer->addUserAgentFilter( // "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", // array('UnknownActionException'));
/** * Run the update * * @return boolean * @access public * @since 3/24/08 */ function runUpdate($dbIndex) { $prepStatus = new StatusStars("Preparing Migration"); $prepStatus->initializeStatistics(3); // Configure the original Hierarchy and AZ services $context = new OsidContext(); $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbIndex); $configuration->addProperty('database_name', $_REQUEST['db_name']); $configuration->addProperty('harmoni_db_name', 'migration_db'); Services::startManagerAsService("IdManager", $context, $configuration); Services::startManagerAsService("HierarchyManager", $context, $configuration); Services::startManagerAsService("AuthorizationManager", $context, $configuration); // Agent Manager $configuration = new ConfigurationProperties(); // default agent Flavor is one that can be editted $agentFlavor = "HarmoniEditableAgent"; $agentHierarchyId = "edu.middlebury.authorization.hierarchy"; $configuration->addProperty('hierarchy_id', $agentHierarchyId); $configuration->addProperty('defaultAgentFlavor', $agentFlavor); $configuration->addProperty('database_index', $dbIndex); $configuration->addProperty('database_name', $_REQUEST['db_name']); Services::startManagerAsService("AgentManager", $context, $configuration); // :: Set up PropertyManager :: //the property manager operates in the same context as the AgentManager and is more or less an adjunct to it $configuration->addProperty('database_index', $dbIndex); $configuration->addProperty('database_name', $_REQUEST['db_name']); Services::startManagerAsService("PropertyManager", $context, $configuration); // :: Start the AuthenticationManager OSID Impl. $configuration = new ConfigurationProperties(); $tokenCollectors = array(serialize(new Type("Authentication", "edu.middlebury.harmoni", "Harmoni DB")) => new FormActionNamePassTokenCollector('does not exist')); $configuration->addProperty('token_collectors', $tokenCollectors); Services::startManagerAsService("AuthenticationManager", $context, $configuration); // :: Start and configure the AuthenticationMethodManager $configuration = new ConfigurationProperties(); // set up a Database Authentication Method require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseAuthNMethod.class.php"; require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseMD5UsernamePasswordAuthNTokens.class.php"; $dbAuthType = new Type("Authentication", "edu.middlebury.harmoni", "Harmoni DB"); $dbMethodConfiguration = new ConfigurationProperties(); $dbMethodConfiguration->addProperty('tokens_class', 'SQLDatabaseMD5UsernamePasswordAuthNTokens'); $dbMethodConfiguration->addProperty('database_id', $dbIndex); $dbMethodConfiguration->addProperty('authentication_table', 'auth_db_user'); $dbMethodConfiguration->addProperty('username_field', 'username'); $dbMethodConfiguration->addProperty('password_field', 'password'); $propertiesFields = array('username' => 'username'); $dbMethodConfiguration->addProperty('properties_fields', $propertiesFields); $dbAuthNMethod = new SQLDatabaseAuthNMethod(); $dbAuthNMethod->assignConfiguration($dbMethodConfiguration); $configuration->addProperty($dbAuthType, $dbAuthNMethod); Services::startManagerAsService("AuthNMethodManager", $context, $configuration); // :: Agent-Token Mapping Manager :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_id', $dbIndex); $configuration->addProperty('harmoni_db_name', 'migration_db'); Services::startManagerAsService("AgentTokenMappingManager", $context, $configuration); $prepStatus->updateStatistics(); $dbc = Services::getService("DatabaseManager"); try { /********************************************************* * Check for the old tables. They must exist for us to run *********************************************************/ $azTables = array('az_authorization', 'az_function', 'hierarchy', 'j_node_node', 'node', 'node_ancestry'); // Check for old tables $tables = $dbc->getTableList($dbIndex); foreach ($azTables as $table) { if (!in_array($table, $tables)) { throw new Exception("Old AZ table, {$table}, is missing. Can not run Update."); } } /********************************************************* * Create the new tables *********************************************************/ $type = $dbc->getDatabaseType($dbIndex); switch ($type) { case MYSQL: SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/MySQL/AuthZ2.sql", $dbIndex); break; case POSTGRESQL: SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/PostgreSQL/AuthZ2.sql", $dbIndex); break; case ORACLE: SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/PostgreSQL/AuthZ2.sql", $dbIndex); break; default: throw new Exception("Database schemas are not defined for specified database type."); } /********************************************************* * Hierarchy *********************************************************/ $hierarchyMgr1 = Services::getService("Hierarchy"); if (get_class($hierarchyMgr1) == "AuthZ2_HierarchyManager") { throw new OperationFailedException("Original HierarchyManager not configured."); } $hierarchyMgr2 = new AuthZ2_HierarchyManager(); $azMgr2 = new AuthZ2_AuthorizationManager(); $azMgr2->setHierarchyManager($hierarchyMgr2); $hierarchyMgr2->assignConfiguration($hierarchyMgr1->_configuration); /********************************************************* * Authorization *********************************************************/ $azMgr1 = Services::getService("AuthZ"); if (get_class($hierarchyMgr1) == "AuthZ2_AuthorizationManager") { throw new OperationFailedException("Original HierarchyManager not configured."); } $azMgr2->assignConfiguration($azMgr1->_configuration); $prepStatus->updateStatistics(); /********************************************************* * Hierarchies *********************************************************/ $hierarchies = $hierarchyMgr1->getHierarchies(); $prepStatus->updateStatistics(); while ($hierarchies->hasNext()) { $hierarchy = $hierarchies->next(); try { $newHierarchy = $hierarchyMgr2->getHierarchy($hierarchy->getId()); } catch (UnknownIdException $e) { $newHierarchy = $hierarchyMgr2->createHierarchy($hierarchy->getDisplayName(), array(), $hierarchy->getDescription(), $hierarchy->allowsMultipleParents(), $hierarchy->allowsRecursion(), $hierarchy->getId()); } $query = new SelectQuery(); $query->addTable("node"); $query->addColumn("COUNT(*)", "num"); $query->addWhereEqual("fk_hierarchy", $hierarchy->getId()->getIdString()); $dbc = Services::getService("DatabaseManager"); $result = $dbc->query($query); $this->nodeStatus = new StatusStars("Migrating nodes in the '" . $hierarchy->getDisplayName() . "' Hierarchy."); $this->nodeStatus->initializeStatistics($result->field("num")); // Add all of the nodes $nodes = $hierarchy->getRootNodes(); while ($nodes->hasNext()) { $this->addNode($newHierarchy, $nodes->next()); } } /********************************************************* * Authorizations *********************************************************/ $azMgr1 = Services::getService("AuthZ"); if (get_class($hierarchyMgr1) == "AuthZ2_AuthorizationManager") { throw new OperationFailedException("Original HierarchyManager not configured."); } // Add all of the Authorization functions $functionTypes = $azMgr1->getFunctionTypes(); while ($functionTypes->hasNext()) { $oldFunctions = $azMgr1->getFunctions($functionTypes->next()); while ($oldFunctions->hasNext()) { $oldFunction = $oldFunctions->next(); // Get or create the function try { $newFunction = $azMgr2->getFunction($oldFunction->getId()); } catch (UnknownIdException $e) { $newFunction = $azMgr2->createFunction($oldFunction->getId(), $oldFunction->getReferenceName(), $oldFunction->getDescription(), $oldFunction->getFunctionType(), $oldFunction->getQualifierHierarchyId()); } // Get all authorizations for this function. $oldAZs = $azMgr1->getExplicitAZs(null, $oldFunction->getId(), null, false); $status = new StatusStars("Migrating '" . $newFunction->getReferenceName() . "' Authorizations (" . $oldAZs->count() . ")"); $status->initializeStatistics($oldAZs->count()); while ($oldAZs->hasNext()) { $oldAZ = $oldAZs->next(); $status->updateStatistics(); try { $oldQualifier = $oldAZ->getQualifier(); } catch (UnknownIdException $e) { // continue if the qualifier no longer exists. continue; } // Add the new authorization try { $newAZ = $azMgr2->createAuthorization($oldAZ->getAgentId(), $oldAZ->getFunction()->getId(), $oldQualifier->getId()); if ($oldAZ->getExpirationDate()) { $newAZ->updateExpirationDate($oldAZ->getExpirationDate()); } if ($oldAZ->getEffectiveDate()) { $newAZ->updateEffectiveDate($oldAZ->getEffectiveDate()); } } catch (OperationFailedException $e) { } } } } } catch (Exception $e) { printpre($e->getMessage()); HarmoniErrorHandler::printDebugBacktrace($e->getTrace()); printpre("An error has occurred. Removing new tables."); try { $query = new GenericSQLQuery('TRUNCATE az2_implicit_az'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_explicit_az'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_node_ancestry'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_j_node_node'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_function'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_function_type'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_node'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_node_type'); } catch (DatabaseException $e) { } try { $query = new GenericSQLQuery('TRUNCATE az2_hierarchy'); } catch (DatabaseException $e) { } $query = new GenericSQLQuery('DROP TABLE az2_implicit_az, az2_explicit_az, az2_function, az2_function_type, az2_node_ancestry, az2_j_node_node, az2_node, az2_node_type, az2_hierarchy;'); $dbc->query($query, $dbIndex); return false; } /********************************************************* * If we have successfully gotten this far, drop the old * hierarchy and AuthZ tables to prevent confusion. *********************************************************/ $query = new GenericSQLQuery('DROP TABLE az_authorization, az_function, hierarchy, j_node_node, node, node_ancestry;'); $dbc->query($query, $dbIndex); print "Success!"; return true; }
<?php /** * Set up the ImageProcessor service for generating thumbnails * * USAGE: Copy this file to imageprocessor.conf.php to set custom values. * * @package segue.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: imageprocessor_default.conf.php,v 1.4 2007/09/25 19:46:17 adamfranco Exp $ */ // :: Set up the ImageProcessor service for generating thumbnails :: $configuration = new ConfigurationProperties(); $configuration->addProperty('thumbnail_format', "image/jpeg"); $configuration->addProperty('use_gd', FALSE); $configuration->addProperty('gd_formats', array()); $configuration->addProperty('use_imagemagick', TRUE); $configuration->addProperty('imagemagick_path', "/usr/local/bin"); $configuration->addProperty('imagemagick_temp_dir', "/tmp"); $configuration->addProperty('imagemagick_formats', array()); Services::startManagerAsService("ImageProcessingManager", $context, $configuration);
* Set up the SchedulingManager * * USAGE: Copy this file to coursemanagament.conf.php to set custom values. * * @package segue.config * * @copyright Copyright © 2006, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: scheduling_default.conf.php,v 1.2 2007/09/04 18:00:43 adamfranco Exp $ */ // :: Set up the SchedulingManager :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); $defaultAuthority = "edu.middlebury.authorization.hierarchy"; $configuration->addProperty('default_authority', $defaultAuthority); /* $courseManagamentHierarchyId = "edu.middlebury.authorization.hierarchy"; $courseManagamentRootId = "edu.middlebury.authorization.root"; $courseManagementId ="edu.middlebury.coursemanagement"; $canonicalCoursesId="edu.middlebury.coursemanagement.canonicalcourses"; $courseGroupsId ="edu.middlebury.coursemanagement.coursegroups"; $configuration->addProperty('hierarchy_id', $courseManagamentHierarchyId); $configuration->addProperty('root_id', $courseManagamentHierarchyId); $configuration->addProperty('course_management_id', $courseManagementId); $configuration->addProperty('canonical_courses_id', $canonicalCoursesId); $configuration->addProperty('course_groups_id', $courseGroupsId); */ Services::startManagerAsService("SchedulingManager", $context, $configuration);
// $ldapConfiguration->addProperty("GroupBaseDN", $arg3 = "ou=groups,dc=middlebury,dc=edu"); // $ldapConfiguration->addProperty("bindDN", $arg4 = "juser"); // $ldapConfiguration->addProperty("bindDNPassword", $arg5 = "password"); // $propertiesFields = array ( // 'username' => 'samaccountname', // 'name' => 'displayname', // 'first name' => 'givenname', // 'last name' => 'sn', // 'department' => 'department', // 'email' => 'mail', // ); // $ldapConfiguration->addProperty('properties_fields', $propertiesFields); // $loginFields = array ( // 'samaccountname', // 'mail', // 'cn', // ); // $ldapConfiguration->addProperty('login_fields', $loginFields); // $ldapConfiguration->addProperty("display_name_property", $arg6 = "name"); // // $ldapAuthNMethod = new LDAPAuthNMethod; // $ldapAuthNMethod->assignConfiguration($ldapConfiguration); // unset($arg0, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $propertiesFields, $loginFields, $ldapConfiguration); // // $configuration->addProperty($ldapAuthType, $ldapAuthNMethod); Services::startManagerAsService("AuthNMethodManager", $context, $configuration); // :: Agent-Token Mapping Manager :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_id', $dbID); Services::startManagerAsService("AgentTokenMappingManager", $context, $configuration);
<?php /** * Set up the AuthorizationManager * * USAGE: Copy this file to authorization.conf.php to set custom values. * * @package segue.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: authorization_default.conf.php,v 1.3 2007/09/04 18:00:42 adamfranco Exp $ */ // :: Set up the Authorization System :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); $configuration->addProperty('database_name', $dbName); $configuration->addProperty('harmoni_db_name', 'segue_db'); try { require_once HARMONI . "/oki2/AuthZ2/authz/AuthorizationManager.class.php"; $azMgr = new AuthZ2_AuthorizationManager(); $azMgr->assignConfiguration($configuration); Services::registerObjectAsService("AuthorizationManager", $azMgr); } catch (ConfigurationErrorException $e) { Services::startManagerAsService("AuthorizationManager", $context, $configuration); print "<div class='config_error'>" . _("Please run the Segue Updates under Admin Tools") . "</div>"; }
<?php /** * Set up the RepositoryManager * * USAGE: Copy this file to repository.conf.php to set custom values. * * @package segue.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id: repository_default.conf.php,v 1.6 2007/09/04 18:00:43 adamfranco Exp $ */ // :: Set up the RepositoryManager :: $repositoryHierarchyId = "edu.middlebury.authorization.hierarchy"; $defaultParentId = "edu.middlebury.repositories_root"; $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); $configuration->addProperty('hierarchy_id', $repositoryHierarchyId); $configuration->addProperty('default_parent_id', $defaultParentId); $configuration->addProperty('version_control_all', $arg2 = TRUE); $configuration->addProperty('use_filesystem_for_files', $arg3 = FALSE); // $configuration->addProperty('file_data_path', $arg4 = MYPATH."/../segue_data"); Services::startManagerAsService("RepositoryManager", $context, $configuration); unset($arg0, $arg1, $arg2, $arg3, $arg4);
$configuration->addProperty('whether_to_add_terms', $CREATE_TERMS); for ($year = 2004; $year < 2010; $year++) { $array = array(); $array['name'] = "Winter " . $year; $array['start'] = Timestamp::fromString($year . "-01-01T00:00:00"); $array['end'] = Timestamp::fromString($year . "-02-01T00:00:00"); $array['type'] = new Type("TermType", "edu.middlebury", "Winter"); $terms[] = $array; $array = array(); $array['name'] = "Spring " . $year; $array['start'] = Timestamp::fromString($year . "-02-01T00:00:00"); $array['end'] = Timestamp::fromString($year . "-06-01T00:00:00"); $array['type'] = new Type("TermType", "edu.middlebury", "Spring"); $terms[] = $array; $array = array(); $array['name'] = "Summer " . $year; $array['start'] = Timestamp::fromString($year . "-06-01T00:00:00"); $array['end'] = Timestamp::fromString($year . "-09-01T00:00:00"); $array['type'] = new Type("TermType", "edu.middlebury", "Summer"); $terms[] = $array; $array = array(); $array['name'] = "Fall " . $year; $array['start'] = Timestamp::fromString($year . "-09-01T00:00:00"); $array['end'] = Timestamp::fromString($year + 1 . "-01-01T00:00:00"); $array['type'] = new Type("TermType", "edu.middlebury", "Fall"); $terms[] = $array; } $configuration->addProperty('terms_to_add', $terms); $configuration->addProperty('authority', $authority = "edu.middlebury"); Services::startManagerAsService("CourseManagementManager", $context, $configuration);
require_once dirname(__FILE__) . "/main/library/ResultPrinter/EmbeddedArrayResultPrinter.class.php"; require_once dirname(__FILE__) . "/main/library/Basket/Basket.class.php"; require_once dirname(__FILE__) . "/main/library/AuthZPrinter.abstract.php"; require_once dirname(__FILE__) . "/main/modules/help/Help.class.php"; require_once dirname(__FILE__) . "/main/modules/auth/PolyphonyLogin.class.php"; require_once dirname(__FILE__) . "/main/library/RepositoryInputOutputModules/RepositoryInputOutputModuleManager.class.php"; Services::registerService("InOutModules", "RepositoryInputOutputModuleManager"); require_once dirname(__FILE__) . "/main/library/RepositorySearchModules/RepositorySearchModuleManager.class.php"; Services::registerService("RepositorySearchModules", "RepositorySearchModuleManager"); require_once OKI2 . "osid/OsidContext.php"; $context = new OsidContext(); $context->assignContext('harmoni', $harmoni); require_once HARMONI . "oki2/shared/ConfigurationProperties.class.php"; $configuration = new ConfigurationProperties(); Services::startManagerAsService("InOutModules", $context, $configuration); Services::startManagerAsService("RepositorySearchModules", $context, $configuration); require_once dirname(__FILE__) . "/main/library/HierarchyPrinter/GroupPrinter.class.php"; require_once dirname(__FILE__) . "/main/library/HierarchyPrinter/HierarchyPrinter.class.php"; // NEW CONFIGS AFTER HERE!!!: if (file_exists(dirname(__FILE__) . "/config/domit.conf.php")) { require_once dirname(__FILE__) . "/config/domit.conf.php"; } else { require_once dirname(__FILE__) . "/config/domit_default.conf.php"; } if (file_exists(dirname(__FILE__) . "/config/exif.conf.php")) { require_once dirname(__FILE__) . "/config/exif.conf.php"; } else { require_once dirname(__FILE__) . "/config/exif_default.conf.php"; } require_once dirname(__FILE__) . "/main/modules/help/browse_help.act.php"; /*********************************************************
<?php /** * Set up the HierarchyManager * * USAGE: Copy this file to hierarchy.conf.php to set custom values. * * @package concerto.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id$ */ // :: Set up the Hierarchy Manager :: $configuration = new ConfigurationProperties(); $configuration->addProperty('database_index', $dbID); $configuration->addProperty('database_name', $dbName); Services::startManagerAsService("HierarchyManager", $context, $configuration);
$harmonyLoadupTimer = new Timer(); $harmonyLoadupTimer->start(); require_once dirname(__FILE__) . "/../../../../harmoni.inc.php"; //require_once(dirname(__FILE__)."/../../../../../concerto/main/include/setup.inc.php"); $harmonyLoadupTimer->end(); require_once SIMPLE_TEST . 'simple_unit.php'; require_once SIMPLE_TEST . 'oki_simple_unit.php'; require_once SIMPLE_TEST . 'dobo_simple_html_test.php'; /* if (!defined('CONCERTODBID')) { */ /* require_once(CONCERTO.'/tests/dbconnect.inc.php'); */ /* } */ require_once HARMONI . "errorHandler/ErrorHandler.class.php"; $errorHandler = Services::getService("ErrorHandler"); $context = new OsidContext(); $configuration = new ConfigurationProperties(); Services::startManagerAsService("DatabaseManager", $context, $configuration); $test = new GroupTest('CourseManagementTest'); $test->addTestFile(dirname(__FILE__) . '/CanonicalCourseTestCase.class.php'); $test->addTestFile(dirname(__FILE__) . '/CourseGroupTestCase.class.php'); $test->addTestFile(dirname(__FILE__) . '/CourseOfferingTestCase.class.php'); $test->addTestFile(dirname(__FILE__) . '/TermTest.class.php'); $test->addTestFile(dirname(__FILE__) . '/CourseSectionTestCase.class.php'); $test->addTestFile(dirname(__FILE__) . '/EnrollmentRecordTestCase.class.php'); $test->addTestFile(dirname(__FILE__) . '/CourseGradeRecordTest.class.php'); $test->attachObserver(new DoboTestHtmlDisplay()); $test->run(); $timer->end(); print "\n<br />Harmoni Load Time: " . $harmonyLoadupTimer->printTime(); print "\n<br />Overall Time: " . $timer->printTime(); $dbhandler = Services::getService("DBHandler"); printpre("NumQueries: " . $dbhandler->getTotalNumberOfQueries());
<?php /** * Set up the AgentManager * * USAGE: Copy this file to agent.conf.php to set custom values. * * @package concerto.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id$ */ // :: Set up the AgentManager :: $configuration = new ConfigurationProperties(); // default agent Flavor is one that can be editted $agentFlavor = "HarmoniEditableAgent"; $agentHierarchyId = "edu.middlebury.authorization.hierarchy"; $configuration->addProperty('hierarchy_id', $agentHierarchyId); $configuration->addProperty('defaultAgentFlavor', $agentFlavor); $configuration->addProperty('database_index', $dbID); $configuration->addProperty('database_name', $dbName); Services::startManagerAsService("AgentManager", $context, $configuration); // :: Set up PropertyManager :: //the property manager operates in the same context as the AgentManager and is more or less an adjunct to it $configuration->addProperty('database_index', $dbID); $configuration->addProperty('database_name', $dbName); Services::startManagerAsService("PropertyManager", $context, $configuration);
<?php /** * Set up the LanguageLocalization system * * USAGE: Copy this file to language.conf.php to set custom values. * * @package concerto.config * * @copyright Copyright © 2005, Middlebury College * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL) * * @version $Id$ */ // :: Set up language directories :: $configuration = new ConfigurationProperties(); $configuration->addProperty('default_language', $arg0 = 'en_US'); $configuration->addProperty('applications', $arg1 = array('concerto' => MYDIR . '/main/languages', 'polyphony' => POLYPHONY . '/main/languages')); unset($arg0, $arg1); Services::startManagerAsService("LanguageManager", $context, $configuration);