Re: Where to put my class files

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

 



On Tue, Feb 28, 2006 at 12:55:18PM +0700, Peter Lauri wrote:
> Best group member,
> 
> I want to run the backend of the system under HTTPS for security reasons.
> The pages in HTTP and HTTPS are both using the same classfiles.
> 
> Right now I have the class files in httpdocs/classes/
> 
> In the httpsdocs/admin I have a variable
> $class_path='http://www.mydomain.com/classes/'; to describe where the class
> files can be found. I do this that does not generate an error:
> 
> require_once($class_path.'orderadmin.class.php');
> 
> When I then do below it gives be an error.
> echo OrderAdmin::getNewOrderList();
> 
> Fatal error: Undefined class name 'orderadmin' in
> /home/httpd/vhosts/mydomain.com/httpsdocs/admin/order.php on line 46

It looks like you have a dir structure like:

  mydomain.com/httpsdocs/  #https docs
  mydomain.com/httpdocs/   #http docs

What I would do is make a directory:

  mydomain.com/include/

And set my include_path to include that directory, and since it
appears you have open_basedir in effect, include the path in
open_basedir as well.

Then put your classes in:
  mydomain.com/include/classes/

Then both sets of scripts can use:

$class_path = 'classes/';
require_once($class_path.'orderadmin.class.php');

That is how I would do it.

Curt.
-- 
cat .signature: No such file or directory

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