composer does not autoload

你说的曾经没有我的故事 提交于 2019-12-04 06:10:37

问题


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

My folder structure:

vendor/
composer.json
composer.lock
myfile.php

composer.json:

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

myfile.php:

require 'vendor/autoload.php';
$client = new Tumblr\API\Client(CONSUMER_KEY, CONSUMER_SECRET);

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

Fatal error: Class 'Tumblr\API\Client' not found in [..]/htdocs/tumblr/myfile.php on line 9


回答1:


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



来源:https://stackoverflow.com/questions/15451371/composer-does-not-autoload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!