作曲家不自动加载 [英] composer does not autoload

查看:30
本文介绍了作曲家不自动加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照作曲家的说明成功安装了作曲家.我想使用 tumblr 全新的 php api 客户端.

I followed the composer instructions and installed composer successfully. I want to use tumblr's brand new php api client.

我的文件夹结构:

vendor/
composer.json
composer.lock
myfile.php

composer.json:

{
    "require": {
        "tumblr/tumblr": "0.0.2"
    }
}

myfile.php:

require 'vendor/autoload.php';
$client = new TumblrAPIClient(CONSUMER_KEY, CONSUMER_SECRET);

使用 php composer.phar install 安装也很有效.但是在执行 myfile.php 时找不到该类.

Installing using php composer.phar install works great as well. But when executing myfile.php the class could not be found.

致命错误:在第 9 行的 [..]/htdocs/tumblr/myfile.php 中找不到类TumblrAPIClient"

Fatal error: Class 'TumblrAPIClient' not found in [..]/htdocs/tumblr/myfile.php on line 9

推荐答案

已经发布了一个新版本的 tumblr.php 来解决这个问题.感谢@igorw.

A new version of tumblr.php has been released which fixes the issue. Thanks to @igorw.

这篇关于作曲家不自动加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆