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

Beanbun整合到yii2框架时,无法运行 #19

Open
aaronlei opened this issue Jan 5, 2018 · 0 comments
Open

Beanbun整合到yii2框架时,无法运行 #19

aaronlei opened this issue Jan 5, 2018 · 0 comments

Comments

@aaronlei
Copy link

aaronlei commented Jan 5, 2018

use yii\console\Controller;
use Beanbun\Beanbun;

class DemoController extends Controller
{

    public function actionBeanbun()
    {
        $beanbun = new Beanbun();
        $beanbun->seed = [
            'http://www.950d.com/',
            'http://www.950d.com/list-1.html',
            'http://www.950d.com/list-2.html',
        ];
        $beanbun->afterDownloadPage = function ($beanbun) {
            file_put_contents(__DIR__ . '/' . md5($beanbun->url), $beanbun->page);
        };
        $beanbun->start();
    }
}

问题一

PHP Notice 'yii\base\ErrorException' with message 'Undefined property: Beanbun\Beanbun::$count'
in /xxx/vendor/kiddyu/beanbun/src/Beanbun.php:136

问题二
在Beanbun加上count属性后,发现依然不能工作

会一直提示

Usage: php yourfile.php {start|stop|restart|reload|status|connections} [-d]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant