Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1540: Remove references to summary pages/DB #860

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
$isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
$dbtype = 'mysql';

# Summary Database credentials
######### DELETE if not using connection.
$summarydbconfig = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
$ifsummary = true;

# Encoded JWT key, used to sign and check validaty of jwt tokens
# - Create one of these using /api/authenticate/key
# This can be changed to invalidate all currently active tokens
Expand Down
10 changes: 1 addition & 9 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function setupApplication($mode): Slim
global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
$facility_courier_countries, $facility_courier_countries_nde, $facility_courier_countries_link,
$dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version, $redirects,
$valid_components, $enabled_container_types, $synchweb_version, $redirects,
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments;
$app->contentType('application/json');
$options = $app->container['options'];
Expand All @@ -91,7 +91,6 @@ function setupApplication($mode): Slim
'timezone' => $timezone,
'valid_components' => $valid_components,
'enabled_container_types' => $enabled_container_types,
'ifsummary' => $ifsummary,
'synchweb_version' => $synchweb_version,
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
Expand All @@ -110,13 +109,6 @@ function setupDependencyInjectionContainer($app)
return $db;
});

$app->container->singleton('dbsummary', function () use ($app): DatabaseParent {
$dbFactory = new DatabaseFactory(new DatabaseConnectionFactory());
$db = $dbFactory->get("summary");
$db->set_app($app);
return $db;
});

$app->container->singleton('authData', function () use ($app) {
return new AuthenticationData($app->container['db']);
});
Expand Down
11 changes: 0 additions & 11 deletions api/src/Database/DatabaseConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class DatabaseConnectionFactory
public function get($databaseType)
{
global $isb;
global $summarydbconfig;

if (!$databaseType) {
error_log('Database type variable, dbtype, is not specified in config.php - defaulting to MySql.');
Expand All @@ -25,16 +24,6 @@ public function get($databaseType)
$conn = new \mysqli($host, $isb['user'], $isb['pass'], $dbn, $port);
$conn->set_charset("utf8mb4");
}
elseif ($databaseType == 'PureMySQL') {
$port = array_key_exists('port', $summarydbconfig) ? $summarydbconfig['port'] : null;
if (!$port) {
$port = ini_get("mysqli.default_port");
}
list($host, $dbn) = explode('/', $summarydbconfig['db']);
$conn = new \mysqli($host, $summarydbconfig['user'], $summarydbconfig['pass'], $dbn, $port);
$conn->set_charset("utf8mb4");
}


if ($conn == null) {
Utils::returnError("Database Configuration Error", "Database connection for type '$databaseType' does not exist.");
Expand Down
1 change: 0 additions & 1 deletion api/src/Database/DatabaseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class DatabaseFactory
// Key is lower case representation of class name.
public $database_types = array(
'mysql' => ["dbClassName" =>'MySQL', "dataConnectionName" => 'MySQL'],
'summary' => ["dbClassName" =>'PureMySQL', "dataConnectionName" => 'PureMySQL']
);

function __construct($databaseConnectionFactory)
Expand Down
Loading
Loading