|
From: Jimmy H. <ji...@ha...> - 2001-07-17 16:44:25
|
Alby,
> I've been trying to learn more about BC2, and I'm stuck on
> how some of the php scripts communicate with each other.
I've been there too :) In fact I am still there :)
> Take for instance Auth.php, in there is a line that says
> $PACKAGE='binarycloud.core'; does this mean that this file is
> part of binarycloud.core, or that it should include all other
> stuff that's in binarycloud.core?
That line is specifically for the Make file to grep in and find that it
should include the file in the build directory.
> Also, later on in Auth.php it reads 'include_once
> DBOBJECTS."bc_logged_in.inc";' - and I imagine
> 'bc_logged_in.inc' is a file, but why is that DBOJECTS. in
> front of it?
DBOBJECTS is a define()'d constant it is basically pointing to the
directory where bc_logged_in.inc is located.
> Then even later, in Init.php, there is a line that reads
> "import('binarycloud.core.Lang');" Can anyone explain this
> structure to me? I'm guessing that this references a package
> (binarycloud.core), and then a class within that package? (Lang)
see prepend.inc for the definition of import
They are trying to mimic the Java import statement using . instead of /
so they created a function called import() and it replaces the . into /
to include the file. Once you understand this construct you'll now how
to import() whatever file in BC that you want.
It's a shortcut of include_once really with a bit of help to translate
the correct path.
Cheers,
Jimmy
|