"Ryan Pallas" wrote in message news:caobuzdtmhxq285hwmc3x9th2rj9d7ty3vnhnpcbzdceppch...@mail.gmail.com...

On Wed, Sep 13, 2017 at 2:59 AM, Tony Marston <tonymars...@hotmail.com>
wrote:



You seem to forget that autoloading is an option, not a requirement. I
don't use autoloading in my 14 year old framework for several reasons:
- An autoloader did not exist when I created my framework.
- I built an alternative mechanism into my framework, so I don't need an
autoloader.
- I don't like the way autoloaders work - all my class names are in snake
case (lowercase with underscore separators) and the autoloader converts '_'
into '/' thus producing a file path which does not exist.


I must be missing something, there is no autoloader shipped with PHP. You
have to define your own and register it. You can choose to change _ into /
within your autoloader, but that is entirely preference and not
specifically part of autoloading. For example, here's my autoloader which
does no such symbol replacement https://pastebin.com/rQRrXzCa



Then it must have been the project I was working on which used a combination of Codeigniter, Composer and PHPUnit. There was definitely something which translated a class name from "foo_bar_snafu" into "foo/bar/snafu". It's no wonder that I stopped using it.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to