Author Topic: filepro and php...  (Read 843 times)

0 Members and 1 Guest are viewing this topic.

ajlisowski

  • Member
  • Posts: 3
    • View Profile
filepro and php...
« on: February 18, 2010, 01:47:48 PM »
Hey everyone. Im brand new to filepro. I am a mysql/php developer who has been assigned to create a PHP intranet system porting over a filepro database to mysql. I have seen that PHP seems to have a filepro function to read from a filepro database, however my current PHP build does not include this function and I can not find the module anywhere...

Basically, Im in a bit over my head.

I have found a package containing a filepro.so file for linux, but I am currently running xampp on windows, so the rpm file is useless to me.

Any tips on filepro with php? Does anyone specifically have advice for getting the filepro() functions working in a php installation. Any help would be great.

syntencoist

  • Member
  • Posts: 7
    • View Profile
Re: filepro and php...
« Reply #1 on: September 01, 2010, 03:32:33 PM »
A little late I guess.
From what I have heard, the FilePro to MySQL communication is slow at best.

The best method to send SQL data to the server (assuming its on the same server) is one of two ways:
* Write the results into a SQL file and then run the SQL file.
* Use command based php files and have those run the mysql for you.

The best method to send SQL data to the server (assuming its on a different server) is one of three ways:
* Write the results into a SQL file and then run the SQL file for the remote server.
* Use a text based browser (such as lynx) and call a remote php file with the proper GET arguments to do the processing.
* Use curl to call a processing page on the remote server.

Ray_Scheel

  • Member
  • Posts: 3
    • View Profile
    • Scheel Media Solutions
Re: filepro and php...
« Reply #2 on: October 06, 2010, 11:07:05 AM »
A little later yet, but worth sharing. 

At my primary workplace, my method of making filePro data available to another DBMS took advantage of the fact that filePro records are fixed length and primarily ASCII based to create a read-only access to the current filePro data within Oracle.  If the DMBS needing to read filePro data is able to mount flat files, you can do the same thing.  I am not aware of any OS specific barriers to doing this. This essentially provides a limited reversal of what I understand is the functionality of filePro ODBC by letting an outside ODBC client at least "see" live data in filePro tables.

I created a report process (using filePro) that wrote out a file with the Oracle specific SQL to create external table definition for every single "key" file in the path, including logic to sanitize any table or field names that were Oracle reserved words.  "Running" the generated Oracle SQL statements created a read-only link in Oracle to the live version of every filePro key file we had.  No index information is available, nor can you create an Oracle index on the external tables, but from that point it is very easy to "CREATE TABLE main_instance.oracleversion AS filepro_instance.fileproversion", "drop" the first field (containing the 20 byte binary record header) and index the Oracle version as you like.   (If you are really motivated you could even decode and pull record dates out of the 20 byte header, but I have not done that yet).

This makes an easy way to script updates to the linked tables within Oracle so you have relatively fresh data to use for development and testing.  Even better, non-fP developers do not have to learn filePro to do data extractions (since they probably will need to do some data normalization and similar work while extracting the filePro data). 

Good luck
Ray Scheel

ajlisowski

  • Member
  • Posts: 3
    • View Profile
Re: filepro and php...
« Reply #3 on: October 29, 2010, 09:53:26 AM »
Just wanted to stop in and say thanks for the responses. So far I wrote some classes to read in the filepro map and key files and then put them in a database. The problem is, its sort of slow and we have to do it as a batch process which is a pain on some of the larger filepro databases.

Right now I am trying to interpret the index files and make some PHP classes to be able to quickly pull index records and then be able to grab the data from the key file based on the record number. I have some questions about how the index file data is stored that I will be making another post on. So feel free to check that out in a few moments :)