从http-get-request启动wget-process

时间:2014-04-23 18:37:19

标签: php laravel wget http-get get-request

我需要从http-get-request启动一个wget-process。 当我从.php文件启动wget-process简单时,它正在工作。 但是,当我调用我的http-get-request并且http-get-request启动wget-process时,没有任何事情发生。我正在使用Laravel来获取请求。 有帮助吗?

在http-get:

上调用的函数
public function store()
{
    $url = Input::get('url');
    $filename = Input::get('filename');
    if (isset($url) && isset($filename))
    {
    do {
        $newVerificationNumber = Boxx::genVerificationKey();
    } while (Website::verify($newVerificationNumber));
    echo "Executing...<br/>";
    $progress = 0;
    $state = "wget --no-clobber --convert-links --random-wait -S –header=”Accept-Encoding: gzip, deflate” -O -p -P wget '$url'";
    exec($state, $output, $return);
    if ($return) {
        echo "<br/>Download Complete!<br/>";
        $website = new Website;
        $website->web_url = $url;
        $website->web_complete = '0';
        $website->verification_number = $newVerificationNumber;
        $website->save();
        echo json_encode($website->toArray()) . '<br/>';
        $progress = 1;
    } else {
        echo "<br/>Error!<br/>";
    }
    if ($progress == 1) {
        $statezip = exec("zip -r wget/'$filename' wget/google.de");
        exec($statezip, $output, $return);
        if ($return) {
            echo "<br/>Zipping Complete!<br/>";
            $realpath = realpath(dirname(__FILE__));
            $filepath = '/' . 'wget/' . $filename;
            $completepath = $realpath . $filepath;
            echo 'Downloadpfad: ' . $completepath . '.zip' . '<br/><br/>';
            $website = Website::where('verification_number', $newVerificationNumber)->first();
            if ($website instanceof Website) {
                $website->web_complete = 1;
                $website->save();
            }
            return $completepath;
        } else {
            echo "<br/>Error Zipping!<br/>";
        }
    }
    }
    else
    {
        echo 'Error, nicht alle Parameter gesetzt';
    }
}

0 个答案:

没有答案