php - 从作曲家包中找不到php类
问题描述
我安装了这个包composer require konekt/pdf-invoice
,但标准use
在调用它时找不到该类。
然后在我的脚本中我正在使用:
<?php
include "includes/basics.php" ;
use Konekt\PdfInvoice\InvoicePrinter;
function genPDF($id) {
$invoice = new InvoicePrinter();
...
...
}
?>
并产生错误:
PHP Fatal Error: Uncaught Error: Class 'Konekt\PdfInvoice\InvoicePrinter' not found in wBilling.php:511
在我的/home/userID/php/vendor/konekt/pdf-invoice
存在中,据我所知,composer.json 文件已正确定义
{
"name": "konekt/pdf-invoice",
"description": "Library to generate PDF invoices",
"type": "library",
"license": "GPL-2.0-or-later",
"keywords": ["invoice", "pdf", "konekt", "artkonekt"],
"support": {
"source": "https://github.com/artkonekt/pdf-invoice"
},
"authors": [
{
"name": "Attila Fulop",
"homepage": "https://github.com/fulopattila122"
}
],
"require": {
"php": ">=5.6",
"ext-iconv": "*",
"ext-mbstring": "*",
"setasign/fpdf": "~1.8.1"
},
"require-dev": {
"phpunit/phpunit": "~5.0"
},
"autoload": {
"psr-4": { "Konekt\\PdfInvoice\\": "src/" }
},
"autoload-dev": {
"psr-4": {
"Konekt\\PdfInvoice\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
}
}
解决方案
推荐阅读
- python - Pandas 数据框 .dropna() 没有丢弃 NaN 值
- vue.js - 从子组件调用方法
- javascript - array.push 似乎替换了以前的对象而不是追加
- javascript - 使用过滤器功能从另一个对象创建对象
- angular - 如何防止 Angular 服务人员缓存 PDF 文件?
- php - Wordpress Index.php 博客文章
- java - jaxb2-maven-plugin:无法从 WSDL 生成源
- node.js - 第一个alexa技能
- java - 在两个 ActiveMQ 队列之间配置 Apache Camel 路由,以使用特定目标队列的生产者而不是身份不明的生产者
- android - 使用 BaseAdapter 和 ViewHolder 的空指针异常