source: trunk/wtorrent/install.php @ 93

Revision 93, 1.5 KB checked in by royger, 2 years ago (diff)
  • Migrated database from sqlite 2 to sqlite 3.
  • From now on, you will need php to be compiled with PDO and sqlite to run wTorrent.
  • Applied patch from tn123 to migrate to PDO and use prepared statements (ticket #188).
  • Created new install script.
  • To apply this update you will need to run sqlite_migration.sh to migrate your old database to sqlite3. This script assumes you have your database in db/database.db, if that's not the case edit the script and change the path.
Line 
1<?php
2/*
3This file is part of wTorrent.
4
5wTorrent is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 3 of the License, or
8(at your option) any later version.
9
10wTorrent is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18Modified version of class done by David Marco Martinez
19*/
20require_once("lib/cls/Web.cls.php");
21require_once("cls/install.cls.php");
22error_reporting(E_ALL);
23// Record the start time of execution
24$mtime = microtime( true );
25// Start php session BEFORE ANY output
26session_start();
27// Load conf
28//require_once( 'conf/user.conf.php' );
29install::setDefines();
30require_once( 'conf/system.conf.php' );
31// Build the base of the app
32$web = Web::getClass( 'install' );
33// Page specific operations and display
34$web->display( 'install/index' );
35
36// Record end time
37$ftime = microtime( true );
38$total = $ftime -$mtime;
39//echo "total: " . $total . 's<br />';
40// If end time is shorter than 0.5 segons sleep untill then
41if($total < MIN_TIME) {
42        usleep(floor((MIN_TIME - $total)*1000000));
43        //echo 'lost time: ' . (MIN_TIME - $total) . 's<br />';
44}
45// REAL end time (Should be about MIN_TIME + 0.1s)
46$fftime = microtime( true );
47$total = $fftime - $mtime;
48?>
Note: See TracBrowser for help on using the repository browser.