Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加composer的说明文件, 以及一个使用示例, 只是把原本的几个include, 改成一个include 'path/to/auto… #3

Merged
merged 1 commit into from
Nov 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ();