Example #1
0
            } else {
                $dir = $v[0];
                $v[1] = str_replace('item.', 'image.', $v[2] . '/' . $v[1]);
            }
            $dir = str_replace('/', DIRECTORY_SEPARATOR, dirname(dirname(__FILE__)) . $dir);
            $md5 = md5($v[3]);
            $url = $v[1];
            $file = $v[3];
            if (!file_exists($dir . $file) || abs(filesize($dir . $file)) < 1024) {
                $url = str_replace('s/?', '', $url);
                $url = preg_replace('/(.+)http:\\/\\//', 'http://', $url);
                $curl->add(array($url, $dir . $file), array('getok'));
            }
        }
    }
    $curl->go();
    exit($msg);
}
function readData($filename)
{
    $data = array();
    if (!file_exists($filename)) {
        return $data;
    }
    $i = -1;
    $tmp = array();
    $fp = fopen($filename, 'rb');
    while (!feof($fp)) {
        $line = fgets($fp);
        $line = trim($line, "\r\n");
        $tmp = explode(',', $line);