Overview
Comment: | Mise à jour de la BDD automatique |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
83c7888c7a601462f932e8b7bcca9e41 |
User & Date: | bohwaz on 2012-05-21 13:39:40 |
Other Links: | manifest | tags |
Context
2012-05-21
| ||
13:44 | Ignorer les données utilisateur check-in: 25af328579 user: bohwaz tags: trunk | |
13:39 | Mise à jour de la BDD automatique check-in: 83c7888c7a user: bohwaz tags: trunk | |
13:17 | Gestion d'une lettre d'infos check-in: 90c5975d8a user: bohwaz tags: trunk | |
Changes
Modified include/class.config.php from [03055f7739] to [76b9e0bc38].
︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 'categorie_dons' => $int, 'categorie_cotisations' => $int, 'champs_modifiables_membre' => $array, 'accueil_wiki' => $string, ); $db = Garradin_DB::getInstance(); $this->config = $db->simpleStatementFetchAssoc('SELECT cle, valeur FROM config ORDER BY cle;'); foreach ($this->config as $key=>&$value) | > > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | 'categorie_dons' => $int, 'categorie_cotisations' => $int, 'champs_modifiables_membre' => $array, 'accueil_wiki' => $string, 'version' => $string, ); $db = Garradin_DB::getInstance(); $this->config = $db->simpleStatementFetchAssoc('SELECT cle, valeur FROM config ORDER BY cle;'); foreach ($this->config as $key=>&$value) |
︙ | ︙ | |||
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | if (!array_key_exists($key, $this->config)) { throw new OutOfBoundsException('Ce champ est inconnu.'); } return $this->config[$key]; } public function set($key, $value) { if (!array_key_exists($key, $this->fields_types)) { throw new OutOfBoundsException('Ce champ est inconnu.'); } | > > > > > > > > > > > > > > > > > > > > > | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | if (!array_key_exists($key, $this->config)) { throw new OutOfBoundsException('Ce champ est inconnu.'); } return $this->config[$key]; } public function getVersion() { if (!array_key_exists('version', $this->config)) { return '0'; } return $this->config['version']; } public function setVersion($version) { $this->config['version'] = $version; $db = Garradin_DB::getInstance(); $db->simpleExec('INSERT OR REPLACE INTO config (cle, valeur) VALUES (?, ?);', 'version', $version); return true; } public function set($key, $value) { if (!array_key_exists($key, $this->fields_types)) { throw new OutOfBoundsException('Ce champ est inconnu.'); } |
︙ | ︙ |
Modified include/init.php from [0f58078d4e] to [357f7103f8].
︙ | ︙ | |||
126 127 128 129 130 131 132 | /* * Inclusion des fichiers de base */ require_once GARRADIN_ROOT . '/include/lib.utils.php'; | | > > > > > | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | /* * Inclusion des fichiers de base */ require_once GARRADIN_ROOT . '/include/lib.utils.php'; if (!defined('GARRADIN_INSTALL_PROCESS') && !defined('GARRADIN_UPGRADE_PROCESS')) { if (!file_exists(GARRADIN_DB_FILE)) { utils::redirect('/admin/install.php'); } require_once GARRADIN_ROOT . '/include/class.db.php'; require_once GARRADIN_ROOT . '/include/class.config.php'; $config = Garradin_Config::getInstance(); if (version_compare($config->getVersion(), garradin_version(), '<')) { utils::redirect('/admin/upgrade.php'); } } ?> |
Added www/admin/upgrade.php version [dfc5ee2f8f].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <?php define('GARRADIN_UPGRADE_PROCESS', true); require_once __DIR__ . '/../../include/init.php'; if (!file_exists(GARRADIN_DB_FILE)) { utils::redirect('/admin/install.php'); } require_once GARRADIN_ROOT . '/include/class.db.php'; require_once GARRADIN_ROOT . '/include/class.config.php'; $config = Garradin_Config::getInstance(); if (version_compare($config->getVersion(), garradin_version(), '>=')) { throw new UserException("Pas de mise à jour à faire."); } $db = Garradin_DB::getInstance(); switch ($config->getVersion()) { case 0: $db->exec('ALTER TABLE membres ADD COLUMN lettre_infos INTEGER DEFAULT 0;'); $config->setVersion(garradin_version()); break; default: throw new UserException("Version inconnue."); } utils::redirect('/admin/'); ?> |