示例#1
0
                $v = pq($v);
                echo "cb2:\t" . $v->text() . "\n";
            }
            $imgUrl = $html['div.sidebar dl.singerInfo img']->attr('src');
            $imgFile = $this->imgDir . '/' . $param['artistName'] . '.' . pathinfo($imgUrl, PATHINFO_EXTENSION);
            $this->getCurl()->add(array('url' => $imgUrl, 'file' => $imgFile, 'ctl' => array('type' => 'img'), 'args' => array_merge($param, array('imgFile' => $imgFile))), array($this, 'cb3'));
            phpQuery::unloadDocuments();
        }
    }
    /**
     * image download finished callback and echo the argument seted in $this->start()
     *
     * @param unknown $r        	
     * @param unknown $param        	
     */
    function cb3($r, $param)
    {
        if (!$this->hasHttpError($r['info'])) {
            echo "{$param['imgFile']} download finished. test1=" . $param['test1'] . "\n";
        }
    }
    function cbCurlInfo($info)
    {
        echo "\n";
        parent::cbCurlInfo($info);
        echo "\n";
    }
}
$demo = new Demo(new CurlMulti_Core());
$demo->f**k();