Commit f86a3442 authored by Donal McMullan's avatar Donal McMullan
Browse files

Record the config values requires_config and requires_parent to the db

parent 693c3475
......@@ -29,5 +29,7 @@ defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007050100;
$config->release = '0.1';
$config->requires_config = 1;
$config->requires_parent = 0;
?>
\ No newline at end of file
......@@ -29,5 +29,7 @@ defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2006101800;
$config->release = '0.1';
$config->requires_config = 0;
$config->requires_parent = 0;
?>
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage auth-internal
* @author Donal McMullan <donal@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2007041000;
$config->release = '0.1';
$config->requires_config = 1;
$config->requires_parent = 1;
?>
......@@ -40,7 +40,7 @@ class InstallationException extends SystemException {}
* @return array of objects
*/
function check_upgrades($name=null) {
$pluginstocheck = plugin_types();
$toupgrade = array();
......@@ -152,6 +152,12 @@ function check_upgrades($name=null) {
$plugininfo->install = true;
$plugininfo->to = $config->version;
$plugininfo->torelease = $config->release;
if (property_exists($config, 'requires_config')) {
$plugininfo->requires_config = $config->requires_config;
}
if (property_exists($config, 'requires_parent')) {
$plugininfo->requires_parent = $config->requires_parent;
}
$toupgrade[$pluginkey] = $plugininfo;
}
else if ($config->version > $pluginversion) {
......@@ -167,6 +173,12 @@ function check_upgrades($name=null) {
$plugininfo->fromrelease = $pluginrelease;
$plugininfo->to = $config->version;
$plugininfo->torelease = $config->release;
if (property_exists($config, 'requires_config')) {
$plugininfo->requires_config = $config->requires_config;
}
if (property_exists($config, 'requires_parent')) {
$plugininfo->requires_parent = $config->requires_parent;
}
$toupgrade[$pluginkey] = $plugininfo;
}
}
......@@ -268,6 +280,12 @@ function upgrade_plugin($upgrade) {
$installed->name = $pluginname;
$installed->version = $upgrade->to;
$installed->release = $upgrade->torelease;
if (property_exists($upgrade, 'requires_config')) {
$installed->requires_config = $upgrade->requires_config;
}
if (property_exists($upgrade, 'requires_parent')) {
$installed->requires_parent = $upgrade->requires_parent;
}
$installtable = $plugintype . '_installed';
if (!empty($upgrade->install)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment