Forum


Replies: 3   Views: 1847
Ns version, private respository: class not found errors
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Mikevg  · 28-04-2021 - 21:09

Thank you. I still seem to be having issues with this.

This is the composer.json in the project that I am trying to include Phpdocx into:

"require": {
        "<company>/phpdocx": "^11.0"
    },

    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:<company>/phpdocx.git"
        }
    ],

And this is the composer.json in the private repo I've setup for Phpdocx.

{
        "name": "<company>/phpdocx",
        "description": "A private library for PhpDocx",
            "autoload": {
                "psr-4": {
                        "Phpdocx\\": "Classes/Phpdocx"
                }
        },
        "minimum-stability": "dev",
        "prefer-stable": true
}

Without this autoload section, I get "class not found" errors when trying to instantiate a Phpdocx instance.

This is the code where I'm calling Phpdocx

use Phpdocx\Create\CreateDocx;

$docx = new CreateDocx();
$pdfName = self:: getPdfName($inputFileName);
$docx->transformDocument($inputFileName, $pdfName);

Everything seems to be working, but when I run `composer update` I get the lots of warnings similar to:

Class Phpdocx\Libs\TCPDI located in C:/xampp/htdocs/<project>/vendor/<company>/phpdocx/Classes/Phpdocx\Libs\TCPDF_lib.php does not comply with psr-4 autoloading standard. Skipping.

What do I need to do to get rid of these warnings?