Overview
Comment:Corrige création des dossiers à la mise à jour aussi
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 4ba838b75e9ccb750c86a2c61390e1b5e3354991
User & Date: bohwaz on 2017-10-12 11:16:18
Other Links: branch diff | manifest | tags
Context
2017-10-12
11:29
Typo check-in: 5bb0340c89 user: bohwaz tags: dev
11:16
Corrige création des dossiers à la mise à jour aussi check-in: 4ba838b75e user: bohwaz tags: dev
10:58
Ajout modif projet à la modif d'écriture check-in: cda68df623 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Install.php from [58d1fb53d9] to [1fe98d6e7d].

118
119
120
121
122
123
124



























125
126
127
128
129
130
131
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
149
150
151
152
153
154
155
156
157
158







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







			'libelle'   =>  'Premier exercice',
			'debut'     =>  date('Y-01-01'),
			'fin'       =>  date('Y-12-31')
		]);

		return $config->save();
	}

	static public function checkAndCreateDirectories()
	{
		// Vérifier que les répertoires vides existent, sinon les créer
		$paths = [DATA_ROOT, PLUGINS_ROOT, CACHE_ROOT, CACHE_ROOT . '/static', CACHE_ROOT . '/compiled'];

		foreach ($paths as $path)
		{
		    if (!file_exists($path))
		    {
		        mkdir($path);
		    }

		    if (!is_dir($path))
		    {
		    	throw new UserException('Le répertoire '.$path.' n\'existe pas ou n\'est pas un répertoire.');
		    }

		    // On en profite pour vérifier qu'on peut y lire et écrire
		    if (!is_writable($path) || !s_readable($path))
		    {
		    	throw new UserException('Le répertoire '.$path.' n\'est pas accessible en lecture/écriture.');
		    }
		}

		return true;
	}

	static public function setLocalConfig($key, $value)
	{
		$path = ROOT . DIRECTORY_SEPARATOR . 'config.local.php';
		$new_line = sprintf('const %s = %s;', $key, var_export($value, true));

		if (file_exists($path))

Modified src/www/admin/install.php from [5a0a032cc4] to [a663d967b6].

61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
61
62
63
64
65
66
67



68
















69
70
71
72
73
74
75







-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-







    'Librairie KD2 non disponible.'
);

const INSTALL_PROCESS = true;

require_once __DIR__ . '/../../include/init.php';

// Vérifier que les répertoires vides existent, sinon les créer
$paths = [DATA_ROOT, PLUGINS_ROOT, CACHE_ROOT, CACHE_ROOT . '/static', CACHE_ROOT . '/compiled'];

Install::checkAndCreateDirectories();
foreach ($paths as $path)
{
    if (!file_exists($path))
        mkdir($path);

    test_requis(
        file_exists($path) && is_dir($path),
        'Le répertoire '.$path.' n\'existe pas ou n\'est pas un répertoire.'
    );

    // On en profite pour vérifier qu'on peut y lire et écrire
    test_requis(
        is_writable($path) && is_readable($path),
        'Le répertoire '.$path.' n\'est pas accessible en lecture/écriture.'
    );
}

if (!file_exists(DB_FILE))
{
    // Renommage du fichier sqlite à la version 0.5.0
    $old_file = str_replace('.sqlite', '.db', DB_FILE);

    if (file_exists($old_file))

Modified src/www/admin/upgrade.php from [b498d02b73] to [8f7b8df203].

1
2
3
4
5
6


7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15






+
+







<?php
namespace Garradin;

const UPGRADE_PROCESS = true;

require_once __DIR__ . '/../../include/init.php';

Install::checkAndCreateDirectories();

$config = Config::getInstance();

$v = $config->getVersion();

if (version_compare($v, garradin_version(), '>='))
{