-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathimport.php
More file actions
executable file
·38 lines (29 loc) · 841 Bytes
/
Copy pathimport.php
File metadata and controls
executable file
·38 lines (29 loc) · 841 Bytes
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
<?php
include_once('importfuncs.php');
//print_r($_SERVER);
if(isset($_SERVER['TERM']))
{
CallFuncByMessage(Message::SCRIPT_START,Null);
//Allow no time limit for large imports
set_time_limit(0);
$nukeDatabase = 1;
$lockDatabase = 1;
global $PROG_ARG_LONG;
$options = getopt(PROG_ARG_STRING,$PROG_ARG_LONG);
//var_dump($options);
if(!isset($options["i"]))
{
print "Usage: php ".$argv[0]." -i data.osm [--dontnuke] [--dontlock]\n";
exit(0);
}
$filename = $options["i"];
if(isset($options["dontnuke"]))
$nukeDatabase = 0;
if(isset($options["dontlock"]))
$lockDatabase = 0;
//echo $filename,$nukeDatabase,$lockDatabase;
Import($filename,$nukeDatabase,$lockDatabase);
//Trigger destructors acts better, rather than letting database handle going out of scope
CallFuncByMessage(Message::SCRIPT_END,Null);
}
?>