Re: A general problem

From: Date: Mon, 30 Aug 2004 22:54:10 +0000
Subject: Re: A general problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14340@lists.php.net to get a copy of this message
* Pahlevanzadeh Mohsen <m_pahlevanzadeh@yahoo.com>: > Deras, > My code is : > > include_once('auth/Auth/Auth.php'); > function x(){echo "xxxxxxxxxxxxxxxxxxx";} > > > $parameterforauth=array("dsn"=>"mysql://martin:test@localhost/auth", > "table"=>"usernames", > "usernamecol"=>"user", > "passwordcol"=>"pass"); > $ptr_auth_C=new auth("DB",$parameterforauth,"x"); > $ptr_auth_C->start(); > ?> > My output is : > Warning: _factory(Auth/Container/DB.php): failed to > open stream: No such file or directory in > /var/www/html/forum/auth/Auth/Auth.php on line 218 > > Fatal error: _factory(): Failed opening required > 'Auth/Container/DB.php' > (include_path='.:/usr/share/pear') in > /var/www/html/forum/auth/Auth/Auth.php on line 218 Looks to me like you need to do the following: set_include_path(get_include_path() . ':' . './auth'); include_once('Auth/Auth.php'); That first line appends the directory 'auth' in the current directory to the path list in which PHP looks for include files. This will allow the factory method in Auth to find its classes. -- Matthew Weier O'Phinney | mailto:matthew@garden.org Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org

« previous php.pear.general (#14340) next »