summarylogtreecommitdiffstats
path: root/mes_options.php
blob: db72597a4d5e2cea6335e217563c10adbac2b8b2 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php // /!\ Important: There must be no blank space before &lt;?php or after ?&gt;
// This file was inspired from the spip contrib website
// http://www.spip.net/fr_article3811.html

if ( preg_match(',^/([\.a-zA-Z0-9_-]+)/,', $_SERVER['REQUEST_URI'], $r)
                                       AND !is_dir(_DIR_RACINE . $r[1]) ) {
      $site = $_SERVER['HTTP_HOST'] . '__' . $r[1];
} else {
      $site = $_SERVER['HTTP_HOST'];
}

// This is a symlink to /srv/spip/
// Sites are of the form <host> or <host>__<folder> (cf. above)
$rep = 'sites/';
$path = _DIR_RACINE . $rep . $site . '/';
 
// This will create automatically the folder structure. Disable it and create
// them manually if you wish
if(!is_dir($path)) {
      mkdir($path,0750);
      mkdir($path.'tmp',0750);
      mkdir($path.'local',0750);
      mkdir($path.'IMG',0750);
      mkdir( '/etc/webapps/spip/' . $site,0750);
      symlink( '/etc/webapps/spip/' . $site, $path . 'config');
}

// The default path for the database is in the config dir. We don't want that
// in /etc
define('_DIR_DB', $path . 'bases/');

// ajout du dossier squelette
if (is_dir($path . 'squelettes'))
      $GLOBALS['dossier_squelettes'] = $rep . $site . '/squelettes';

// spip paths
define('_SPIP_PATH',
        $path . ':' .
        _DIR_RACINE .':' .
        _DIR_RACINE .'squelettes-dist/:' .
        _DIR_RACINE .'prive/:' .
        _DIR_RESTREINT);
 

// TODO logfiles
//define('_FILE_LOG_SUFFIX', '_' . $site . '.log');
//define('_DIR_LOG',  _DIR_RACINE . 'log/');
 
// prefixes des cookie et des tables :
$cookie_prefix = str_replace('.', '_', $site);
$table_prefix = 'spip';
 
// config file (like this one) specific to the site. Note that it can override
// anything you did there, so be careful befor letting anyone modify it.
/*
if (is_readable($f = $path . _NOM_PERMANENTS_INACCESSIBLES . _NOM_CONFIG . '.php'))
        include($f);
*/
 
// start
spip_initialisation(
        ($path . _NOM_PERMANENTS_INACCESSIBLES),
        ($path . _NOM_PERMANENTS_ACCESSIBLES),
        ($path . _NOM_TEMPORAIRES_INACCESSIBLES),
        ($path . _NOM_TEMPORAIRES_ACCESSIBLES)
);
?>