Re: include vendor/autoload.php automatically

From: Date: Sat, 27 Mar 2021 17:57:32 +0000
Subject: Re: include vendor/autoload.php automatically
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-113817@lists.php.net to get a copy of this message
On 27/03/2021 16:52, Abdul Haq Sheikh wrote:
- On Index.php, php will automatically include 'vendor/autoload.php' because the vendor directory exists. - On Test.php, php will automatically include 'vendor/autoload.php' because the vendor directory exists. - On Classes/test2.php, since file is in sub directory and here vendor directory doesn't exist, so php will not include 'vendor/autoload.php'
Just an observation, but if you're doing vendor/autoload.php from your index.php page, and are not already doing custom include paths, then chances are you have your vendor directory publicly accessible and that is considered unwise.

« previous php.internals (#113817) next »