Changeset 9984 in spip-zone
- Timestamp:
- Feb 28, 2007, 9:30:13 PM (13 years ago)
- Location:
- _plugins_/_stable_/phpmyvisites
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_stable_/phpmyvisites/exec/phpmv.php
r9971 r9984 26 26 } 27 27 28 function verif_install(){29 // gestion de l'install et repertoires, selon les versions30 if (defined('_DIR_TMP')){31 define('_PHPMV_DIR_DATA',realpath(_DIR_TMP . "phpmvdatas"));32 if (!is_dir(_DIR_TMP."phpmvdatas"))33 sous_repertoire(_DIR_TMP, "phpmvdatas");34 }35 else {36 define('_PHPMV_DIR_DATA',realpath(_DIR_SESSIONS . "phpmvdatas"));37 if (!is_dir(_DIR_SESSIONS."phpmvdatas"))38 sous_repertoire(_DIR_SESSIONS, "phpmvdatas");39 }40 if (defined('_DIR_ETC')){41 if (!is_dir(_DIR_ETC."phpmvconfig"))42 sous_repertoire(_DIR_ETC, "phpmvconfig");43 if (is_dir(_DIR_ETC."phpmvconfig"))44 define('_PHPMV_DIR_CONFIG',realpath(_DIR_ETC . "phpmvconfig"));45 }46 if (!defined('_PHPMV_DIR_CONFIG')){47 define('_PHPMV_DIR_CONFIG',realpath(_DIR_SESSIONS . "phpmvconfig"));48 if (!is_dir(_DIR_SESSIONS."phpmvconfig"))49 sous_repertoire(_DIR_SESSIONS, "phpmvconfig");50 }51 52 if (@file_exists(_PHPMV_DIR_CONFIG."config.php"))53 return;54 55 if (!defined('_FILE_CONNECT')){56 define('_FILE_CONNECT',57 (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f58 : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php3') ? $f59 : false)));60 }61 if (lire_fichier(_FILE_CONNECT,$connect) && preg_match(',spip_connect_db\(([^\)]*)\),i',$connect,$r)){62 $pars = explode(',',$r[1]);63 $host = substr($pars[0],1,strlen($pars[0])-2);64 $port = substr($pars[1],1,strlen($pars[1])-2);65 $login = substr($pars[2],1,strlen($pars[2])-2);66 $pass = substr($pars[3],1,strlen($pars[3])-2);67 $db = substr($pars[4],1,strlen($pars[4])-2);68 $url = url_de_base()._DIR_PLUGIN_PHPMV;69 70 define('DB_LOGIN',$login);71 define('DB_PASSWORD',$pass);72 define('DB_HOST',$host);73 define('DB_NAME',$db);74 75 $conf = '<'.'?php76 $siteInfo = array ('."77 1 =>78 array (79 'idsite' => '1',80 'name' => '".$GLOBALS['meta']['nom_site']."',81 'logo' => 'pixel.gif',82 'params_choice' => 'all',83 'params_names' => '',84 ),85 );86 ?".'>';87 ecrire_fichier(_PHPMV_DIR_CONFIG."/site_info.php",$conf);88 $conf = '<'.'?php89 $siteUrls = array ('."90 1 =>91 array (92 0 => '".$GLOBALS['meta']['adresse_site']."',93 ),94 );95 ?".'>';96 ecrire_fichier(_PHPMV_DIR_CONFIG."/site_urls.php",$conf);97 98 return;99 100 /*define('_PHPMV_DIR_CONFIG',realpath(_DIR_SESSIONS . "phpmvconfig"));101 define('_PHPMV_DIR_DATA',realpath(_DIR_SESSIONS . "phpmvdatas"));102 chdir(_DIR_PLUGIN_PHPMV);103 require_once INCLUDE_PATH . '/core/include/PmvConfig.class.php';104 require_once INCLUDE_PATH . '/core/include/ApplicationController.php';105 require_once INCLUDE_PATH . '/core/include/Request.class.php';106 require_once INCLUDE_PATH . '/core/include/Module.class.php';107 require_once INCLUDE_PATH . '/core/include/global.php';108 require_once INCLUDE_PATH . '/core/include/Lang.class.php';109 require_once INCLUDE_PATH . '/core/include/User.class.php';110 111 $configPhpFileContent = array(112 'db_login' => $login,113 'db_password' => $pass,114 'db_host' => $host,115 'db_name' => $db,116 'db_tables_prefix' => 'phpmv_',117 );118 119 $db =& Db::getInstance();120 121 // try to connect with new values122 $db->host = $configPhpFileContent['db_host'];123 $db->login = $configPhpFileContent['db_login'];124 $db->password = $configPhpFileContent['db_password'];125 $db->name = $configPhpFileContent['db_name'];126 $db->init();127 128 if($db->isReady())129 {130 $c =& PmvConfig::getInstance();131 $c->update( $configPhpFileContent );132 133 $c->write();134 $c->defineAsConstant( $c->content );135 $c->defineTables();136 $db->createAllTables();137 }*/138 139 //$db->connect();140 //$db->createAllTables();141 }142 143 }144 145 146 28 function exec_phpmv(){ 147 29 global $connect_statut; … … 170 52 171 53 define('INCLUDE_PATH', '.'); 54 if (!isset($GLOBALS['meta']['_DIR_PLUGIN_PHPMV']) 55 OR $GLOBALS['meta']['_DIR_PLUGIN_PHPMV']!=_DIR_PLUGIN_PHPMV 56 OR !file_exists(_PHPMV_DIR_CONFIG."config.php") ){ 57 include_spip("inc/phpmv_install"); 58 phpmv_verif_install(); 59 } 60 61 @define('_PHPMV_DIR_CONFIG',$GLOBALS['meta']['phpmv_dir_config']); 62 @define('_PHPMV_DIR_DATA',$GLOBALS['meta']['phpmv_dir_data']); 172 63 173 verif_install();174 175 if (!isset($GLOBALS['meta']['PHPMyVisites_no_admin_stat'])){176 ecrire_meta('PHPMyVisites_no_admin_stat','non');177 ecrire_metas();178 }179 64 $PHPMyVisites_no_admin_stat = $GLOBALS['meta']['PHPMyVisites_no_admin_stat']; 180 65 -
_plugins_/_stable_/phpmyvisites/phpmv_fonctions.php
r9970 r9984 1 1 <?php 2 2 3 if (!isset($GLOBALS['meta']['_PHPMV_DIR_CONFIG']) || !strlen($GLOBALS['meta']['_PHPMV_DIR_CONFIG'])){4 include_spip("inc/meta");5 ecrire_meta('_PHPMV_DIR_CONFIG',realpath(_DIR_SESSIONS . "phpmvconfig"));6 ecrire_meta('_PHPMV_DIR_DATA',realpath(_DIR_SESSIONS . "phpmvdatas"));7 ecrire_metas();8 }9 3 if (!defined('_DIR_PLUGIN_PHPMV')){ 10 4 $p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__)))); … … 12 6 } 13 7 if (!isset($GLOBALS['meta']['_DIR_PLUGIN_PHPMV']) OR $GLOBALS['meta']['_DIR_PLUGIN_PHPMV']!=_DIR_PLUGIN_PHPMV){ 14 include_spip("inc/meta"); 15 ecrire_meta('_DIR_PLUGIN_PHPMV',_DIR_PLUGIN_PHPMV); 16 ecrire_metas(); 8 include_spip("inc/phpmv_install"); 9 phpmv_verif_install(); 17 10 } 11 define('_PHPMV_DIR_CONFIG',$GLOBALS['meta']['phpmv_dir_config']); 12 define('_PHPMV_DIR_DATA',$GLOBALS['meta']['phpmv_dir_data']); 13 define('_DIR_PLUGIN_PHPMV',$GLOBALS['meta']['_DIR_PLUGIN_PHPMV']); 18 14 19 15 function phpmv_get_code(){ -
_plugins_/_stable_/phpmyvisites/plugin.xml
r8642 r9984 3 3 PHPMyVisites 4 4 </nom> 5 <icon>img_pack/phpmv-logo.png</icon> 5 6 <auteur> <!-- Auteur du plugin --> 6 7 [www.phpmyvisites.net->http://www.phpmyvisites.net] … … 8 9 _ © 2006 - GPL 9 10 </auteur> 10 <version> 11 0.1 12 </version> 11 <version>0.1</version> 12 <version_base>2.1</version_base> 13 13 <etat> 14 14 stable 15 15 </etat> 16 <install>inc/phpmv_install.php</install> 16 17 <description> 17 18 Outil de Statisitique [PHPmyVisites->http://www.phpmyvisites.net]
Note: See TracChangeset
for help on using the changeset viewer.