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

Class 'EasyWechat\Foundation\Application' not found #769

Closed
IanGely opened this issue Jun 28, 2017 · 1 comment
Closed

Class 'EasyWechat\Foundation\Application' not found #769

IanGely opened this issue Jun 28, 2017 · 1 comment

Comments

@IanGely
Copy link
Contributor

IanGely commented Jun 28, 2017

我用的环境

PHP 版本:PHP 5.6.30
overtrue/wechat 版本:3.1

问题及现象

初始化Application的时候提示找不到这个类

目录结构

.
├── composer.json
├── composer.lock
├── vendor
│   ├── autoload.php
│   ├── composer
│   ├── doctrine
│   ├── guzzlehttp
│   ├── monolog
│   ├── overtrue
│   ├── pimple
│   ├── psr
│   ├── sunra
│   └── symfony
└── wx.php

wx.php

<?php
    error_reporting(-1);
    ini_set('display_errors', 'on');

    include  __DIR__ . '/vendor/autoload.php'; //引入 composer 入口文件

    use EasyWechat\Foundation\Application;

    $options = [
        'debug' => true,
        'app_id' => 'xxx',
        'secret' => 'xxx',
        'token' => 'xxx',
        'aes_key' => 'xxx',
        'log' => [
            'level' => 'debug',
            'file' => '/tmp/easywechat.log',
        ],
    ];
    $app = new Application($options);
    $response = $app->server->serve();
    // 将响应输出
    $response->send(); // Laravel 里请使用:return $response;

composer.json

{
    "require": {
        "overtrue/wechat": "~3.1",
        "symfony/var-dumper": "^3.3",
        "sunra/php-simple-html-dom-parser": "^1.5"
    }
}

引用路径都没错,最后还用别的包测试了一下,没问题

@overtrue
Copy link
Collaborator

哎,细心一些哪有这个问题存在哦:

- use EasyWechat\Foundation\Application;
+ use EasyWeChat\Foundation\Application;

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

2 participants