Page 1 of 1

Fatal error: Class 'Dataface_AuthenticationTool'

PostPosted: Fri Jun 22, 2012 10:26 am
by clawes
I am trying to implement user registration on my application and I'm seeing the following error:

Fatal error: Class 'Dataface_AuthenticationTool' not found in /var/www/departed/index.php on line 20


..after adding the following statement to my index.php file.

Code: Select all
..
$auth =& Dataface_AuthenticationTool::getInstance();

How I can fix this?

It also appears that Xataface is ignoring the <myapp>/conf/ApplicationDelegate.php file.
To remedy this, I have to create a new file named <myapp>/functions.inc.php, copy the contents of ApplicationDelegate.php to this file, then call ( require_once) this file from the index.php file. This is contrary to how the Application Delegate class is documented. What am I missing?

Re: Fatal error: Class 'Dataface_AuthenticationTool'

PostPosted: Fri Jun 22, 2012 10:32 am
by shannah
Unfortunately you can't do it this way. The df_init() method performs some bootstrap code that sets up the include paths and environment. If your ApplicationDelegate class isn't being found then you are setting yourself up for more problems by ignoring this. You need this class for many different purposes.

Remember that the path is case sensitive. So is the class name.

-Steve

Re: Fatal error: Class 'Dataface_AuthenticationTool'

PostPosted: Fri Jun 22, 2012 11:01 am
by clawes
How is this related to my 1st issue?

Shouldn't the 'Dataface_AuthenticationTool' class be defined in the /var/www/html/dataface/dataface-public-api.php?

Re: Fatal error: Class 'Dataface_AuthenticationTool'

PostPosted: Fri Jun 22, 2012 11:10 am
by shannah
The Dataface_AuthenticationTool is loaded if you have turned on authentication in the conf.ini file by adding an [_auth] section.
If you need to use it otherwise, you'll need to import Dataface/AuthenticationTool.php.

You probably shouldn't be using it in the index.php file - it can't be used properly until df_init() has finished running bootstrap code.

-Steve