Re: storing functions

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

 



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@xxxxxxxxxxxxx> wrote in message 
news:B1.72.18035.046A3164@xxxxxxxxxxxxxxx
>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. 

-- 
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