[Vfs-devel] First on the topic list?
Status: Alpha
Brought to you by:
eesa
From: Tony K. <tk...@ca...> - 2000-06-05 12:48:08
|
We may have to work out another storage method for the files since not all DBSs have comparable functions to the Postgres function; pg_lo_import. On large files for servers without a function like that the only option would really be to encode the file and store it or read the file in and store it as a normal blob type. Both of which would be time consuming for very large files (8 megs or more). How about storing the file as a file? Creating a file named VFSXXXXX where X would be randomly generated characters to insure unique file names. Just keep looping until you get a random file name. Then store the original filename in the database so it can be sent to the user with the correct file name. That would insure that separate methods wouldn't be needed for storing the files with different DBSs. Just an idea. Also we need to work out the layout of the scripts. If you want the scripts as one set of files and the db_wrapper files to be separate - it would require a small rewrite of some of the current code since there is SQL statements being generated through the scripts. My idea for the layout would be the following. config.inc postgres_db_wrapper.inc mysql_db_wrapper.inc [then whatever other databases will be supported]_db_wrapper.inc Then the rest of the scripts. In the config.inc file would be a setting like: $dbtype = "postgres"; and in the scripts needing the db functions all you would need is: require("config.inc"); require("$dbtype_db_wrapper.inc"); Does all of this make sense? It's a pretty typical setup for PHP apps that support multiple DBSs. Regards, Tony Kirk |