/** * Create a Maxima connection. * @return stack_cas_connection the connection. */ public static function make() { self::ensure_config_loaded(); $debuglog = stack_utils::make_debug_log(self::$config->casdebugging); switch (self::$config->platform) { case 'win': require_once __DIR__ . '/connector.windows.class.php'; $connection = new stack_cas_connection_windows(self::$config, $debuglog); break; case 'unix': case 'unix-optimised': require_once __DIR__ . '/connector.unix.class.php'; $connection = new stack_cas_connection_unix(self::$config, $debuglog); break; case 'server': require_once __DIR__ . '/connector.server.class.php'; $connection = new stack_cas_connection_server(self::$config, $debuglog); break; case 'tomcat': case 'tomcat-optimised': throw new stack_exception('stack_connection_helper: ' . '"tomcat" and "tomcat-optimised" settings are obsolete. ' . ' Please choose "server" setting instead.'); break; default: throw new stack_exception('stack_cas_connection: Unknown platform ' . self::$config->platform); } switch (self::$config->casresultscache) { case 'db': global $DB; $connection = new stack_cas_connection_db_cache($connection, $debuglog, $DB); break; case 'otherdb': $connection = new stack_cas_connection_db_cache($connection, $debuglog, self::get_other_db()); break; default: // Just use the raw $connection. } return $connection; }