Re: storing functions
| From: | Steve | Date: | Wed, 04 Apr 2007 17:57:23 +0000 |
| Subject: | Re: storing functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252062@lists.php.net to get a copy of this message | ||
The way I organize my stuff is that I have all of my object code, functions,
and what not in a specific folder within their own separate files. If there
is enough of a certain category of files to flood the directory, I will
place those in their own subdirectory. I have separate grouping files that
will join together specific combinations of them to create a single line
include for the top of my files.
So for instance, I might have a main include that ties in the standard
functions I want to use. If I need additional features, I can include
another "grouping file" that adds more functionality to the page. If
constants are needed, they are all placed in a separate config file.
The reason I do things this way is foremost to keep things organized. By
having a constant file/directory structure, I don't have to search through 6
files to determine where I put a certain function. With the separate include
file groupings, I avoid meaninglessly adding 3x the amount of code to a page
when it will only utilize a small subset of it.
The downside of it is that you tend to accumulate a LOT of php files if your
site gains significant scope. However since they are all organized with a
common naming scheme, it's fairly easy to keep track of them.
""Ross"" <ross@aztechost.com> wrote in message
news:B1.72.18035.046A3164@pb1.pair.com...
>I am wondering how you store and recall your functions.
>
> I have an external file - functions.php, this includes all the functions
> for the site. It is included in the pages head and then I just use the
> functions when I need them.
>
> Does anyone have a better way to store/recall functions?
>
>
>
>
> R.