Skip to content

Commit

Permalink
Merge pull request #3 from windqyoung/master
Browse files Browse the repository at this point in the history
添加composer的说明文件, 以及一个使用示例, 只是把原本的几个include, 改成一个include 'path/to/auto…
  • Loading branch information
ares333 committed Nov 9, 2015
2 parents d2354eb + 1609508 commit 3a81385
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.settings/*
/.buildpath
/.classpath
/.project
/.project
/vendor/
20 changes: 20 additions & 0 deletions composer.json
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"]
}
}
34 changes: 34 additions & 0 deletions demo/base/site_clone1_use_composer_autoload.php
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 ();

0 comments on commit 3a81385

Please sign in to comment.