Re: Procedural Autoloader?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 22, 2010 at 16:31, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
>
> Shrug, if you want to really be dirty about it, you could just put a 'class'
> atop each file of functions.
> <?php
> class IWishTheseFunctionsWereOOInstead {} // :P
> function firstProceeduralFunc() {
>  // ..
> }
> ?>

    That's not going to be economical or allow him to autoload,
though, because the autoloader is called when the class is
instantiated.  Prune could instantiate it thusly:

<?php

$foo = new IWishTheseFunctionsWereOOInstead();

firstProceeduralFunc(); // [sic]

?>

    .... but it would be just as simple to do:

<?php

require dirname(__FILE__).'/includes/function.php';

firstProceeduralFunc(); // [sic, again]

?>



-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux