Is it possible to 'package' php classes the same as in Java - then reference them from the calling script all at one time?
packaging php files?
If there was away I havent seen it yet. And you are talking about packaging them as like jars ?
Yes, I was thinking like Java packages.
Thanks for your help.
Well, you wouldn't really need to: .jar packages are so that all the .class files are downloaded to the client together, rather than having them dribbling in if and when they're needed. Since PHP is running on the server, the scripts are already there, and packaging them would only incur the extra cost of unpackaging them again to use.
No doubt there are accelerators that cache in core the bytecode for all the scripts that are being used, in order to avoid the time required to both read the files and parse them. Or at least, they preparse the scripts and the OS is smart enough to cache the bytecode in core.
I guess I was not thinking so much as performance, but rather good structuring and coding.
I think I might have come to a little bit of a workaround.
I'll simply create a php file called 'classes.php'. Then, within classes.php I'll have the following:
include('user_class.php');
include('contact_class.php');
include('project_class.php');
etc.
Kind of like 'packages' but only in an organizational sense.