RE: [PHP] Including Functions; one file or many?
| From: | George Pitcher | Date: | Fri, 26 May 2006 08:12:06 +0000 |
| Subject: | RE: [PHP] Including Functions; one file or many? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236930@lists.php.net to get a copy of this message | ||
Mark,
I use one functions file per site, then I know that if I include it, and all
of my functions are available.
George
> -----Original Message-----
> From: Mark Kelly [mailto:php@wastedtimes.net]
> Sent: 26 May 2006 9:02 am
> To: php-general@lists.php.net
> Subject: [PHP] Including Functions; one file or many?
>
>
> Hi
>
> I'm writing a set of db abstraction functions for an internal app
> which will
> give us a set of simple function calls for dealing with the db, like
>
> $result = db_AddEmployee($EmployeeData);
> $EmployeeData = db_GetEmployee($EmployeeID);
>
> etc.
>
> There will be quite a few functions needed to deal with all the different
> ways the app touches the db, so my question is:
>
> Am I better off putting all these functions into one big include
> file (which
> could get pretty big) or using a seperate 'include' file for each
> function?
>
> I'm thinking about the tradeoff between simplifying code by only having a
> single include file (parsing a lot of functions that aren't used,
> but less
> disk access) and having several include files (no extra funcs but
> lots more
> disk access).
>
> I realise there probably isn't a 'correct' way to do this, I'm
> curious about
> which methods folk here use in situations like this.
>
> TIA in advance for any advice,
>
> Mark
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>