Changeset 253 for trunk/install
- Timestamp:
- Mar 12, 2018, 8:53:21 PM (7 years ago)
- Location:
- trunk/install
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/install/index.php
r230 r253 96 96 <tr> 97 97 <td> 98 - supporto MySQL 99 </td> 100 <td align="left"> 101 <?php echo function_exists( 'mysql_connect' ) ? '<b><font color="green">Disponibile</font></b>' : '<b><font color="red">Non Disponibile</font></b>';?> 98 - supporto PDO MySQL 99 </td> 100 <td align="left"> 101 102 <?php echo (extension_loaded('Pdo_mysql')) ? '<b><font color="green">Disponibile</font></b>' : '<b><font color="red">Non Disponibile</font></b>';?> 102 103 </td> 103 104 </tr> … … 163 164 <?php 164 165 $php_recommended_settings = array( 165 array ('Magic Quotes GPC','magic_quotes_gpc','O N'),166 array ('Magic Quotes GPC','magic_quotes_gpc','OFF'), 166 167 array ('Register Globals','register_globals','OFF'), 167 168 array ('Session auto start','session.auto_start','OFF'), -
trunk/install/install2.php
r248 r253 26 26 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', '' ); 27 27 $Lingua = mosGetParam( $_POST, 'Lingua', '' ); 28 $Multicomune = mosGetParam( $_POST, 'Multicomune', ' ' );28 $Multicomune = mosGetParam( $_POST, 'Multicomune', '0' ); 29 29 $Replica = mosGetParam( $_POST, 'Replica', '' ); 30 30 //tema … … 54 54 db_err ('stepBack','Non avete indicato il prefisso tabelle database.'); 55 55 } 56 57 $database = new database( $DBhostname, $DBuserName, $DBpassword, '', '', false ); 58 $test = $database->getErrorMsg(); 59 60 if (!$database->_resource) { 61 db_err ('stepBack2','password ed username inseriti non sono corretti.'); 62 } 63 64 // Does this code actually do anything??? 65 $configArray['DBhostname'] = $DBhostname; 66 $configArray['DBuserName'] = $DBuserName; 67 $configArray['DBpassword'] = $DBpassword; 68 $configArray['DBname'] = $DBname; 69 $configArray['DBPrefix']= $DBPrefix; 70 71 $sql = "CREATE DATABASE `$DBname`"; 72 $database->setQuery( $sql ); 73 $database->query(); 74 $test = $database->getErrorNum(); 75 76 if ($test != 0 && $test != 1007) { 77 db_err( 'stepBack', 'Avvenuto un errore database: ' . $database->getErrorMsg() ); 78 } 79 80 // db is now new or existing, create the db object connector to do the serious work 81 $database = new database( $DBhostname, $DBuserName, $DBpassword, $DBname, $DBPrefix ); 82 83 // delete existing mos table if exists 84 $query = "SHOW TABLES FROM `$DBname`"; 85 $database->setQuery( $query ); 86 $errors = array(); 87 if ($tables = $database->loadResultArray()) { 88 foreach ($tables as $table) { 89 $query = "DROP TABLE IF EXISTS `$table`"; 90 $database->setQuery( $query ); 91 $database->query(); 92 if ($database->getErrorNum()) { 93 $errors[$database->getQuery()] = $database->getErrorMsg(); 94 } 95 } 96 } 97 98 populate_db( $database, 'eleonline.sql' ); 56 try{ 57 $database = new PDO("mysql:host=$DBhostname;charset=latin1", $DBuserName, $DBpassword, array(PDO::ATTR_EMULATE_PREPARES => false, 58 PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 59 $sql = "CREATE DATABASE IF NOT EXISTS $DBname; 60 CREATE USER `$DBuserName`@'$DBhostname' IDENTIFIED BY '$DBpassword'; 61 GRANT ALL ON `$DBname`.* TO `$DBuserName`@'$DBhostname'; 62 FLUSH PRIVILEGES;"; 63 $database->exec($sql); 64 $sql = "use $DBname"; 65 $database->exec($sql); 66 $sql = file_get_contents('sql/eleonline.sql'); 67 $qr = $database->exec($sql); 99 68 $DBcreated = 1; 69 } 70 catch(PDOException $e) 71 { 72 echo $sql . "<br>" . $e->getMessage();die(); 73 } 100 74 } 101 75 -
trunk/install/install3.php
r2 r253 19 19 $nomecomune = mosGetParam( $_POST, 'nomecomune', '' ) ; 20 20 $istat = mosGetParam( $_POST, 'istat', '' ) ; 21 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', ' ' );21 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', '0' ); 22 22 $Lingua = mosGetParam( $_POST, 'Lingua', '' ); 23 $Multicomune = mosGetParam( $_POST, 'Multicomune', ' ' );23 $Multicomune = mosGetParam( $_POST, 'Multicomune', '0' ); 24 24 $Replica = mosGetParam( $_POST, 'Replica', '' ); 25 25 -
trunk/install/install4.php
r17 r253 25 25 $nomecomune = mosGetParam( $_POST, 'nomecomune', '' ) ; 26 26 $istat = mosGetParam( $_POST, 'istat', '' ) ; 27 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', ' ' );27 $Capoluogo = mosGetParam( $_POST, 'Capoluogo', '0' ); 28 28 $Lingua = mosGetParam( $_POST, 'Lingua', '' ); 29 $Multicomune = mosGetParam( $_POST, 'Multicomune', ' ' );29 $Multicomune = mosGetParam( $_POST, 'Multicomune', '0' ); 30 30 $Replica = mosGetParam( $_POST, 'Replica', '' ); 31 31 … … 295 295 296 296 297 298 $database = new database( $DBhostname, $DBuserName, $DBpassword, $DBname ); 299 $nullDate = $database->getNullDate(); 297 $database = new PDO("mysql:host=$DBhostname;charset=latin1", $DBuserName, $DBpassword, array(PDO::ATTR_EMULATE_PREPARES => false, 298 PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION)); 299 $sql = "use $DBname"; 300 $database->exec($sql); 300 301 301 302 // create the admin user … … 303 304 //$query = "INSERT INTO {$configArray['DBPrefix']}_authors VALUES ('$adminName', '$adminName', '0', '$adminEmail', '$cryptpass','1','0','0','1','it')"; 304 305 $query = "UPDATE {$configArray['DBPrefix']}_authors SET aid='$adminName', name='$adminName', email='$adminEmail', pwd= '$cryptpass' WHERE aid='suser'"; 305 $database->setQuery( $query ); 306 $database->query(); 306 $database->exec( $query ); 307 307 308 308 // create Comune 309 try{ 310 $query = "INSERT INTO {$configArray['DBPrefix']}_ele_comuni VALUES ('$istat', '$nomecomune', '','','','','$Limite','$Capoluogo','','','0','')"; 311 $database->exec( $query ); 312 } catch(PDOException $e) {} 313 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', adminmail='$adminEmail', tema='$tema', foot='',language='$Lingua',blocco='$blocco',fileout='$Replica',Versione='3', siteistat='$istat',multicomune='$Multicomune',flash='$flash', tema_on='$sceltatema' WHERE sitename=''"; 309 314 310 $query = "INSERT INTO {$configArray['DBPrefix']}_ele_comuni VALUES ('$istat', '$nomecomune', '','','','','$Limite','$Capoluogo','','','')"; 311 312 $database->setQuery( $query ); 313 $database->query(); 314 315 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', adminmail='$adminEmail', tema='$tema', foot='',language='$Lingua',blocco='$blocco',fileout='$Replica',Versione='2.0 beta', siteistat='$istat',multicomune='$Multicomune',flash='$flash', tema_on='$sceltatema' WHERE sitename=''"; 316 317 318 $database->setQuery( $query ); 319 $database->query(); 315 $database->exec( $query ); 320 316 321 317 322 318 // touch config table 323 319 $date = date("F Y"); 324 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', nukeurl='$siteUrl', startdate='$date', adminmail='$adminEmail', backend_title='$sitename', notify_email='$adminEmail'"; 325 $database->setQuery( $query ); 326 $database->query(); 320 $query = "UPDATE {$configArray['DBPrefix']}_config SET sitename='$sitename', siteurl='$siteUrl', startdate='$date', adminmail='$adminEmail'"; 321 $database->exec( $query ); 327 322 328 323 } else { … … 407 402 da quella di amministrazione (admin)<br/> 408 403 od anche l'utenza del database pubblico in sola lettura<br/> 409 e altri accorgimenti che riterrai necessari e<br/>404 e altri accorgimenti che riterrai necessari<br/> 410 405 411 406 -
trunk/install/sql/eleonline.sql
r247 r253 100 100 /*!40000 ALTER TABLE `soraldo_config` DISABLE KEYS */; 101 101 LOCK TABLES `soraldo_config` WRITE; 102 INSERT INTO `soraldo_config` VALUES ('','http://www.fonte-nuova.it','','Sito istituzionale','Maggio 2009','admin@localhost','facebook','<b>Comune di Menfi</b><br>\r\nvia - 84023 Menfi (Ag)\r\nTel: Fax: \r\n<hr>','it','1','','','','Gpl v3',2,0,84023,'1','1',' ','','0','1','1','Admin');102 INSERT INTO `soraldo_config` VALUES ('','http://www.fonte-nuova.it','','Sito istituzionale','Maggio 2009','admin@localhost','facebook','<b>Comune di Menfi</b><br>\r\nvia - 84023 Menfi (Ag)\r\nTel: Fax: \r\n<hr>','it','1','','','','Gpl v3',2,0,84023,'1','1','0','','0','1','1','Admin'); 103 103 UNLOCK TABLES; 104 104 /*!40000 ALTER TABLE `soraldo_config` ENABLE KEYS */; … … 747 747 `id_cons_gen` int(11) NOT NULL default '0', 748 748 `orario` time NOT NULL default '00:00:00', 749 `data` date NOT NULL default '0000-00-00',749 `data` date NOT NULL, 750 750 KEY `id_cons_gen` (`id_cons_gen`) 751 751 ) ENGINE=MyISAM DEFAULT CHARSET=latin1; … … 989 989 `id_parz` int(11) NOT NULL auto_increment, 990 990 `orario` time NOT NULL default '00:00:00', 991 `data` date NOT NULL default '0000-00-00',991 `data` date NOT NULL, 992 992 `voti_uomini` int(7) NOT NULL default '0', 993 993 `voti_donne` int(7) NOT NULL default '0',
Note:
See TracChangeset
for help on using the changeset viewer.