Re: storing application functionality
You can put them anywhere. The library is about that flexible,
Typically, I put classes in ../app/lib/classes and function libraries
get put in ../app/lib/scripts.
The trick is to 'fix-up' your include path variable, i.e. build the
include path.
function build_include_path($new_path)
{ ini_set('include_path',ini_get('include_path').':'. $new_path); }
//$version = "ZendFramework-1.0";
$version = "ZendFramework-1.0.3";
build_include_path(make_private_path("/lib/$version/library"));
build_include_path(make_private_path('/app/lib/classes'));
build_include_path(make_private_path('/app/lib/scripts'));
build_include_path(make_private_path('/app/data'));
Now you can do a
require_once 'my_class.php';
And it should find your class.
Note that there are two lib directories above, one for external libs ZF,
Tidy etc.
and one for my own classes and function libraries. /lib and /app/lib.
cheers,
pat
photo312 wrote:
I would like to find a common area where I put "include" files that contain
functions and arrays that are used throughout the application...where do I
put them?