Coder Social home page Coder Social logo

Comments (4)

gabi77 avatar gabi77 commented on September 26, 2024
protected function getPdfParserInstance(StreamReader $streamReader)
{
    /** @noinspection PhpUndefinedClassInspection */
    **if (\class_exists(FpdiPdfParser::class, false)) {**
        /** @noinspection PhpUndefinedClassInspection */
        return new FpdiPdfParser($streamReader);
    }

    return new PdfParser($streamReader);
}

property class_exists.

class_name
The class name. The name is matched in a case-insensitive manner.
autoload
Whether or not to call __autoload by default.

from fpdi.

JanSlabon avatar JanSlabon commented on September 26, 2024

This error is raised because your autoload implementation tries to load ANY class that is requested without checking if the file exists. The error message should also tell you that this exception is not raised in FPDI but in your own code. An autoload implementation shall never load anything without validating it. This way it is impossible to check for existance of classes nor be able to use several autoload methods in the chain.

from fpdi.

MaximilianKresse avatar MaximilianKresse commented on September 26, 2024

Additionally:
You are probably using an invalid autoloader. Like specified in PSR4 "Autoloader implementations MUST NOT throw exceptions, MUST NOT raise errors of any level, and SHOULD NOT return a value.".

There are some autoloaders in the wild that throw errors if a class cannot be found (like the Zend Framework 1 Autoloader). But this complety destroys the ability to check whether a class exists that is allowed to be missing. You have to disable this behaviour in your autoloader (For Zend Framework v1 its $autoloader->suppressNotFoundWarnings(true);).

from fpdi.

gabi77 avatar gabi77 commented on September 26, 2024

Thanks.
yes, I use zend framework 1 by magento 1.9

from fpdi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.