2010-09-03 18:26:59 +00:00
|
|
|
#!/usr/bin/env php
|
2009-10-28 13:49:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include("config.php");
|
|
|
|
include("includes/functions.php");
|
|
|
|
|
2011-12-15 16:34:13 +00:00
|
|
|
if ($fd = @fopen($argv[1],'r'))
|
2011-03-16 22:04:29 +00:00
|
|
|
{
|
2011-12-15 16:34:13 +00:00
|
|
|
$data = fread($fd,4096);
|
|
|
|
while (!feof($fd))
|
|
|
|
{
|
|
|
|
$data .= fread($fd,4096);
|
|
|
|
}
|
2009-10-28 13:49:37 +00:00
|
|
|
|
2011-12-15 16:34:13 +00:00
|
|
|
foreach (explode("\n", $data) as $line)
|
|
|
|
{
|
|
|
|
$update = mysql_query($line);
|
2012-05-25 12:24:34 +00:00
|
|
|
// FIXME check query success?
|
2011-12-15 16:34:13 +00:00
|
|
|
echo("$line \n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2011-03-16 22:04:29 +00:00
|
|
|
{
|
2011-12-15 16:34:13 +00:00
|
|
|
echo("ERROR: Could not open file \"$argv[1]\".\n");
|
2009-10-28 13:49:37 +00:00
|
|
|
}
|
2011-03-16 22:04:29 +00:00
|
|
|
|
|
|
|
?>
|