-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from windqyoung/master
添加composer的说明文件, 以及一个使用示例, 只是把原本的几个include, 改成一个include 'path/to/auto…
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.settings/* | ||
/.buildpath | ||
/.classpath | ||
/.project | ||
/.project | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "ares333/curlmulti", | ||
"description": "Undoubtedly the best php curl library.It's power beyond imagination.", | ||
"authors": [ | ||
{ | ||
"name": "Ares", | ||
"email": "admin@phpdr.net" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.1.0", | ||
"ext-curl": "*" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"CurlMulti_": ["."] | ||
}, | ||
"classmap": ["phpQuery.php"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* 在composer.json文件所在的目录下面, 执行 php composer.phar dumpautoload | ||
* composer.phar 请在https://getcomposer.org/download/ 下载 | ||
* 放到哪里都可以. | ||
*/ | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
|
||
|
||
$url = array ( | ||
'http://www.laruence.com/manual' => array ( | ||
'/' => null | ||
) | ||
); | ||
$dir = __DIR__ . '/static'; | ||
$cacheDir = __DIR__ . '/cache'; | ||
if (! file_exists ( $dir )) { | ||
mkdir ( $dir ); | ||
} | ||
if (! file_exists ( $cacheDir )) { | ||
mkdir ( $cacheDir ); | ||
} | ||
$clone = new CurlMulti_Base_Clone ( $url, $dir ); | ||
$clone->overwrite = true; | ||
$clone->getCurl ()->maxThread = 3; | ||
$clone->getCurl ()->cache ['enable'] = true; | ||
$clone->getCurl ()->cache ['enableDownload'] = true; | ||
$clone->getCurl ()->cache ['dir'] = $cacheDir; | ||
$clone->getCurl ()->cache ['compress'] = true; | ||
$clone->start (); |