Skip to content

Commit 060440a

Browse files
gfrnMark Williams
andauthored
Remove references to summary pages/DB (#860)
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent 3684b32 commit 060440a

File tree

15 files changed

+2
-2281
lines changed

15 files changed

+2
-2281
lines changed

api/config_sample.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
$isb = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
1414
$dbtype = 'mysql';
1515

16-
# Summary Database credentials
17-
######### DELETE if not using connection.
18-
$summarydbconfig = array('user' => 'user', 'pass' => 'pass', 'db' => 'localhost/ispyb');
19-
$ifsummary = true;
20-
2116
# Encoded JWT key, used to sign and check validaty of jwt tokens
2217
# - Create one of these using /api/authenticate/key
2318
# This can be changed to invalidate all currently active tokens

api/index.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function setupApplication($mode): Slim
7070
global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
7171
$facility_courier_countries, $facility_courier_countries_nde, $facility_courier_countries_link,
7272
$dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
73-
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version, $redirects,
73+
$valid_components, $enabled_container_types, $synchweb_version, $redirects,
7474
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments,
7575
$dials_rest_url_rings;
7676
$app->contentType('application/json');
@@ -92,7 +92,6 @@ function setupApplication($mode): Slim
9292
'timezone' => $timezone,
9393
'valid_components' => $valid_components,
9494
'enabled_container_types' => $enabled_container_types,
95-
'ifsummary' => $ifsummary,
9695
'synchweb_version' => $synchweb_version,
9796
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
9897
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
@@ -112,13 +111,6 @@ function setupDependencyInjectionContainer($app)
112111
return $db;
113112
});
114113

115-
$app->container->singleton('dbsummary', function () use ($app): DatabaseParent {
116-
$dbFactory = new DatabaseFactory(new DatabaseConnectionFactory());
117-
$db = $dbFactory->get("summary");
118-
$db->set_app($app);
119-
return $db;
120-
});
121-
122114
$app->container->singleton('authData', function () use ($app) {
123115
return new AuthenticationData($app->container['db']);
124116
});

api/src/Database/DatabaseConnectionFactory.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class DatabaseConnectionFactory
99
public function get($databaseType)
1010
{
1111
global $isb;
12-
global $summarydbconfig;
1312

1413
if (!$databaseType) {
1514
error_log('Database type variable, dbtype, is not specified in config.php - defaulting to MySql.');
@@ -25,16 +24,6 @@ public function get($databaseType)
2524
$conn = new \mysqli($host, $isb['user'], $isb['pass'], $dbn, $port);
2625
$conn->set_charset("utf8mb4");
2726
}
28-
elseif ($databaseType == 'PureMySQL') {
29-
$port = array_key_exists('port', $summarydbconfig) ? $summarydbconfig['port'] : null;
30-
if (!$port) {
31-
$port = ini_get("mysqli.default_port");
32-
}
33-
list($host, $dbn) = explode('/', $summarydbconfig['db']);
34-
$conn = new \mysqli($host, $summarydbconfig['user'], $summarydbconfig['pass'], $dbn, $port);
35-
$conn->set_charset("utf8mb4");
36-
}
37-
3827

3928
if ($conn == null) {
4029
Utils::returnError("Database Configuration Error", "Database connection for type '$databaseType' does not exist.");

api/src/Database/DatabaseFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class DatabaseFactory
1010
// Key is lower case representation of class name.
1111
public $database_types = array(
1212
'mysql' => ["dbClassName" =>'MySQL', "dataConnectionName" => 'MySQL'],
13-
'summary' => ["dbClassName" =>'PureMySQL', "dataConnectionName" => 'PureMySQL']
1413
);
1514

1615
function __construct($databaseConnectionFactory)

0 commit comments

Comments
 (0)