df_update() and df_get_file_system_version()

A place to discuss development of the Xataface core.

df_update() and df_get_file_system_version()

Postby ADobkin » Fri Jul 22, 2011 12:10 pm

I've been noticing for a while that my dataface__version table always had '0' listed for the version. So I decided to figure out why.

The dataface_info.php script worked for me and returned the correct version when accessed from a browser. Likewise, version.txt did exist in the active xataface directory. However, the version field was still set to 0 in the database.

I noticed that df_init, which is called by index.php on each page load, checks to see if the filesystem version matches the database version. If not, it calls the df_update function from dataface_public-api.php. The df_update function then updates the database version. In order to check the filesystem version, it looks for the version.txt file. This works fine when accessing php scripts directly under the xataface directory, but it fails when accessed from any of the database applications, because it is not looking in the correct path. So, it always returns 0 for the filesystem version, which matches what is in the database. It doesn't complain, and it doesn't update the version.

To resolve this problem, I prefixed the 'version.txt' filename with the DATAFACE_PATH constant in the df_get_file_system_version. For the first time ever, I got a message stating "The database has been successfully updated to version 2458", and sure enough the dataface__version table has been updated. Success!

So, is this fix necessary to make the version checking and df_update function work properly, or did I possibly have some other configuration problem on my system causing it to look in the wrong path? If the former, please incorporate the path prefix into future releases.

Thanks,
Alan
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: df_update() and df_get_file_system_version()

Postby shannah » Fri Jul 22, 2011 1:57 pm

The dataface__version table is intended to track the version of your app - not the version of Xataface.
See this post for details:
http://www.sjhannah.com/blog/?p=144
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: df_update() and df_get_file_system_version()

Postby ADobkin » Fri Jul 22, 2011 2:11 pm

Ah, now that makes more sense. Thanks for clarifying that, and the blog post is very helpful!
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 25 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved