File: abstract_mutu.php

package info (click to toggle)
spip 3.0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 30,776 kB
  • sloc: php: 200,550; xml: 4,367; sh: 272; makefile: 39
file content (33 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (3)
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
<?php

/*
 * Sauvegarder la connexion apres le spip_connect_db
 */ 
function mutu_connect_db($host, $port, $login, $pass, $db='', $type='mysql', $prefixe='', $ldap=''){
	$args = func_get_args();
	
	// sinon plantages 1.9.3 
	// le fichier SERVEUR_out dans spip_connect_db
	// empeche une nouvelle connexion ?
	define('_ECRIRE_INSTALL', true);
	
	$link = call_user_func_array('spip_connect_db', $args);
	if($link){
		$GLOBALS['connexions'][_INSTALL_SERVER_DB] = $link;
		$GLOBALS['connexions'][_INSTALL_SERVER_DB][$GLOBALS['spip_sql_version']] 
			= $GLOBALS['spip_' . _INSTALL_SERVER_DB .'_functions_' . $GLOBALS['spip_sql_version']];
	}
	return $link;	
}


// 1 occurrence (lorsque creer_user_base = true)
// utile reellement ?
function mutu_close(){
	$f = _INSTALL_SERVER_DB . '_close';
	$f($GLOBALS['connexions'][_INSTALL_SERVER_DB]['link']);
}



?>