Re: Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)

From: Date: Wed, 03 Jul 2024 15:04:51 +0000
Subject: Re: Iteration III: Packages (was Re: [PHP-DEV] [Initial Feedback] PHP User Modules - An Adaptation of ES6 from JavaScript)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

>> To come back to spl_autoload: That function pre-dates namespaces and is highly opinionated
>> on how to organise code. All lower-case filenames, class per-file, files in include_path, full
>> namespace in path, you name it. If that is what projects wanted at the time, or even now, PSR-0 and
>> the PHP-FIG would possibly not even exist.
>> 
> 
> It's less highly opinionated than either PSR, but that's my whole point: it's
> *someone else's opinion*, hence it's opposed by FIG.
> 
> 
> 
> Neither of which is the point I was making - someone claimed that autoloaders are implicitly
> userland code. The point is they don't *have* to be, and there is a perfectly useable one built
> in to the SPL extension; if it's "too opinionated" (or the opinions are ones you
> don't like), it's hardly the most in-depth of functions, and it already *has* configurable
> parts, so adding in more control shouldn't exactly require a rocket scientist to add, for
> example, the ability to use the original case of the class name.

To be fair, I didn't know this was a thing (you learn something new every day) and I'd
rather have all-lower-case filenames, so I may actually look into this. I wonder if composer exposes
this as an option?

— Rob


Thread (128 messages)

« previous php.internals (#124201) next »