B
B
Bum19892017-06-15 14:17:35
PHP
Bum1989, 2017-06-15 14:17:35

How is composera libraries loaded in user files at the interpreter level?

Good afternoon! I simulate the situation - we have an application in the root of which composer is deployed. Through compоser, for example, Kint is pulled up for debugging and psr-4 autoload is configured. We also have a custom class with its own namespace. Let it be class \AppDir\clasess\Test.
Let's say I access the Kint library in this class and do it like this new \Kint();. Everything works and I have been using these features for a long time, but what happens at the interpreter level?
In our application, two autoloaders are currently registered (described by us in composer.json and our own Kint library). The interpreter calls both autoloaders in sequence and checks if at least one of them knows where the fully qualified Kint class is located \Kint. And if it finds it, it loads it. All right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitriy, 2017-06-15
@dmitriylanets

connect xdebug and see what works and how it works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question