Source for file version_linker.php
Documentation is available at version_linker.php
// This file is part of the Sloodle project (www.sloodle.org)
* Version linker script, to allow in-world tools to check the Sloodle version information
* @copyright Copyright (c) 2007-8 Sloodle (various contributors)
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
* @contributor Peter R. Bloomfield
// If called without any parameters, this script will return version info.
// If successful in checking version information, this script will return
// with status code 1, and the data line will contain 2 fields.
// The first data field will be the Sloodle version (e.g. 0.2), and the
// second will be the module verison (e.g. 2008020501).
// If an error occurs, then an appropriate standard status code will be given
// and a message should be given in the status line.
// FUTURE WORK: the ability to query compatibility with a particular tool
// version may implemented at some point. This will require a request
// parameter, and will likely return "true" or "false" on the data line.
/** Sloodle/Moodle configuration information. */
require_once('config.php');
/** Sloodle debugging. */
require_once(SLOODLE_DIRROOT.
'/sl_debug.php');
/** Sloodle LSL handling library. */
require_once(SLOODLE_DIRROOT.
'/lib/sl_lsllib.php');
$lsl->request->process_request_data();
// Check the installed Sloodle version
$moduleinfo =
get_record('modules', 'name', 'sloodle');
$lsl->response->set_status_code(-
106);
$lsl->response->set_status_descriptor('SYSTEM');
$lsl->response->add_data_line('The Sloodle module is not installed on this Moodle site.');
$lsl->response->render_to_output();
// Extract the module version number
$moduleversion = (string)
$moduleinfo->version;
// Construct and render the response
$lsl->response->set_status_code(1);
$lsl->response->set_status_descriptor('OK');
$lsl->response->add_data_line(array((string)
SLOODLE_VERSION, $moduleversion));
$lsl->response->render_to_output();
Documentation generated on Tue, 04 Mar 2008 15:08:59 +0000 by phpDocumentor 1.4.0