~yoboy-leguesh/ubuntu-fr-doc/maj20150810a

« back to all changes in this revision

Viewing changes to inc/infoutils.php

  • Committer: YoBoY
  • Date: 2012-10-24 19:05:18 UTC
  • mfrom: (114.1.3 maj-AdoraBelle)
  • Revision ID: yoboy.leguesh@gmail.com-20121024190518-bgtic5m3dt8gnzfn
Mise à jour de Dokuwiki 2012-10-13 "Adora Belle"
Application des patch ubuntu-fr d'optimisation
Ajout des thèmes ubuntu-fr
Ajout des plugins
Mise à jour des plugins box, orphanswanted, pageredirect, tag, cloud, forcepreview, pagelist
Désactivation de la nouvelle option d'envoie de notifications mail en html
Application des derniers patchs correctifs de Dokuwiki.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
    // check if new messages needs to be fetched
27
27
    if($lm < time()-(60*60*24) || $lm < @filemtime(DOKU_INC.DOKU_SCRIPT)){
 
28
        dbglog("checkUpdatesMessages(): downloading messages.txt");
28
29
        $http = new DokuHTTPClient();
29
30
        $http->timeout = 8;
30
31
        $data = $http->get(DOKU_MESSAGEURL.$updateVersion);
31
32
        io_saveFile($cf,$data);
 
33
        @touch($cf);
32
34
    }else{
 
35
        dbglog("checkUpdatesMessages(): messages.txt up to date");
33
36
        $data = io_readFile($cf);
34
37
    }
35
38
 
145
148
        }
146
149
    }
147
150
 
148
 
    if(is_writable($conf['datadir'])){
149
 
        msg('Datadir is writable',1);
150
 
    }else{
151
 
        msg('Datadir is not writable',-1);
152
 
    }
153
 
 
154
 
    if(is_writable($conf['olddir'])){
155
 
        msg('Attic is writable',1);
156
 
    }else{
157
 
        msg('Attic is not writable',-1);
158
 
    }
159
 
 
160
 
    if(is_writable($conf['mediadir'])){
161
 
        msg('Mediadir is writable',1);
162
 
    }else{
163
 
        msg('Mediadir is not writable',-1);
164
 
    }
165
 
 
166
 
    if(is_writable($conf['cachedir'])){
167
 
        msg('Cachedir is writable',1);
168
 
    }else{
169
 
        msg('Cachedir is not writable',-1);
170
 
    }
171
 
 
172
 
    if(is_writable($conf['lockdir'])){
173
 
        msg('Lockdir is writable',1);
174
 
    }else{
175
 
        msg('Lockdir is not writable',-1);
176
 
    }
177
 
 
178
151
    if(is_writable(DOKU_CONF)){
179
152
        msg('conf directory is writable',1);
180
153
    }else{
203
176
        msg('mb_string extension not available - PHP only replacements will be used',0);
204
177
    }
205
178
 
 
179
    $loc = setlocale(LC_ALL, 0);
 
180
    if(!$loc){
 
181
        msg('No valid locale is set for your PHP setup. You should fix this',-1);
 
182
    }elseif(stripos($loc,'utf') === false){
 
183
        msg('Your locale <code>'.hsc($loc).'</code> seems not to be a UTF-8 locale, you should fix this if you encounter problems.',0);
 
184
    }else{
 
185
        msg('Valid locale '.hsc($loc).' found.', 1);
 
186
    }
 
187
 
 
188
 
206
189
    if($conf['allowdebug']){
207
190
        msg('Debugging support is enabled. If you don\'t need it you should set $conf[\'allowdebug\'] = 0',-1);
208
191
    }else{
230
213
        msg('The current page is not writable by you',0);
231
214
    }
232
215
 
233
 
    $check = wl('','',true).'data/_dummy';
234
 
    $http = new DokuHTTPClient();
235
 
    $http->timeout = 6;
236
 
    $res = $http->get($check);
237
 
    if(strpos($res,'data directory') !== false){
238
 
        msg('It seems like the data directory is accessible from the web.
239
 
                Make sure this directory is properly protected
240
 
                (See <a href="http://www.dokuwiki.org/security">security</a>)',-1);
241
 
    }elseif($http->status == 404 || $http->status == 403){
242
 
        msg('The data directory seems to be properly protected',1);
243
 
    }else{
244
 
        msg('Failed to check if the data directory is accessible from the web.
245
 
                Make sure this directory is properly protected
246
 
                (See <a href="http://www.dokuwiki.org/security">security</a>)',-1);
247
 
    }
248
 
 
249
216
    // Check for corrupted search index
250
217
    $lengths = idx_listIndexLengths();
251
218
    $index_corrupted = false;
301
268
    $errors[1]  = 'success';
302
269
    $errors[2]  = 'notify';
303
270
 
304
 
    if($line || $file) $message.=' ['.basename($file).':'.$line.']';
 
271
    if($line || $file) $message.=' ['.utf8_basename($file).':'.$line.']';
305
272
 
306
273
    if(!isset($MSG)) $MSG = array();
307
274
    $MSG[]=array('lvl' => $errors[$lvl], 'msg' => $message);