On Nov 22, 2010, at 4:24 PM, Daniel P. Brown wrote:

On Mon, Nov 22, 2010 at 15:37, Jason Pruim <li...@pruimphotography.com> wrote:
Hey Everyone!

Fresh off my problem with functions and arrays I come across something that I can't seem to find currently... The autoloader function that is in PHP 5+ works on classes... But I'm not finding anything that would do the same thing on the procedural end... Such as I have a folder typically called includes in my projects where I place all my function files... I would LOVE to use the autoloader to be able to just load them on demand... But in my quick searching/thinking I haven't found away too... So I thought I would see if anyone had invented that wheel yet before I go and try and do it my
self :)

I may also have a misunderstanding of how it is supposed to work since I
don't truly understand OOP I've always done procedural...

Any help on this one would be greatly appreciated it! :)

   There's no such thing, Prune.  Autoloaders are for classes, and
the only way you could have it work for functions would be to catch
the error in the core and handle it at a lower level than your scripts
(modified core or extension), because the error generated for an
undefined function isn't a catchable fatal.  Alternatively, you
*could* write a function wrapper that utilizes function_exists() and
the like, then rewrite all of your code to use that wrapper.... but
how much sense does that make?  ;-P

How much sense do I ever make? :P

Maybe it's time to get a book on OOP and start learning the concept.. Or find a better way to load my functions so I don't have to have 1 huge functions file or tons of includes if I have them all separate...

Or maybe I can just bastardize classes enough to make something work :P

I think most of my functions border on classes anyway... Off to google to see if I'm right! :)



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to