Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Merge pull request coral-erm#641 from jeffnm/2020.02_installer
Browse files Browse the repository at this point in the history
2020.02 installer components
  • Loading branch information
xsong9 authored Mar 25, 2020
2 parents e9315b8 + 6811f67 commit dea1c6a
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 3 deletions.
10 changes: 10 additions & 0 deletions auth/install/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,16 @@ function register_auth_provider()
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Auth Module");
return $return;
}
];


/**
Expand Down
4 changes: 2 additions & 2 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
*
* NOTE: It is assumed that version strings can be understood by php's version_compare function
*/
$INSTALLATION_VERSION = "3.0.1";
$INSTALLATION_VERSIONS = ["1.9.0", "2.0.0", "3.0.0", "3.0.1"];
$INSTALLATION_VERSION = "2020.02";
$INSTALLATION_VERSIONS = ["1.9.0", "2.0.0", "3.0.0", "3.0.1", "2020.02"];

function make_sure_template_is_drawn()
{
Expand Down
10 changes: 10 additions & 0 deletions licensing/install/licensing.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ function register_licensing_provider()
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Licensing Module");
return $return;
}
];
/**
* This code is for when the upgrade requires no changes to the
* database or conf files etc.
Expand Down
11 changes: 11 additions & 0 deletions management/install/management.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ function register_management_provider()
}
];
case "3.0.1":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Management Module");
return $return;
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
Expand Down
34 changes: 34 additions & 0 deletions organizations/install/organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,40 @@ function register_organizations_provider()
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Organizations Module");
return $return;
}
];

case "2020.02":
$conf_data = parse_ini_file($protected_module_data["config_file_path"], true);
return [
"dependencies_array" => [ "db_tools", "have_read_write_access_to_config" ],
"sharedInfo" => [
"config_file" => [
"path" => $protected_module_data["config_file_path"],
],
"database_name" => $conf_data["database"]["name"]
],
"function" => function($shared_module_info) use ($MODULE_VARS, $protected_module_data, $version) {
$return = new stdClass();
$return->success = true;
$return->yield = new stdClass();
$return->yield->title = _("Organizations Module");
$return->yield->messages = [];

$conf_data = parse_ini_file($protected_module_data["config_file_path"], true);

// Process sql files
$db_name = $conf_data["database"]["name"];
$dbconnection = $shared_module_info["provided"]["get_db_connection"]( $db_name );
$ret = $shared_module_info["provided"]["process_sql_files"]( $dbconnection, $version, $MODULE_VARS["uid"] );
if (!$ret["success"])
{
$return->success = false;
$return->yield->messages = array_merge($return->yield->messages, $ret["messages"]);
return $return;
}

return $return;
}
];
Expand Down
12 changes: 11 additions & 1 deletion reports/install/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,18 @@ function register_reports_provider()
$return->yield->title = _("Reports Module");
return $return;
}
];
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Reports Module");
return $return;
}
];
default:
return null;
}
Expand Down
12 changes: 12 additions & 0 deletions resources/install/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@ function register_resources_provider()
return $return;
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Resources Module");
return $return;
}
];

default:
return null;
}
Expand Down
13 changes: 13 additions & 0 deletions usage/install/usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function register_usage_provider()
return $return;
}
];

case "3.0.1":
return [
"function" => function($shared_module_info) {
Expand All @@ -135,6 +136,18 @@ function register_usage_provider()
return $return;
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Usage Module");
return $return;
}
];

default:
return null;
}
Expand Down

0 comments on commit dea1c6a

Please sign in to comment.