Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
554 views
in Q2A Core by
edited by

I try to use qa1.6-0512.

qa_db_blob_read() in qa-include/qa-db-blobs.php

If QA_BLOBS_DIRECTORY is defined, I hope to get contents by calling file_get_contents() at qa_db_blob_read(). At new version, since file_get_contents() called at qa_read_blob() in qa-include/qa-app-blobs.php, Core is no problem. But, back compatibility cannot be maintained.

Please, please, consider users / plugins of using low level function.

Best regards.

Q2A version: qa1.6-0512 higher

1 Answer

+3 votes
by
selected by
 
Best answer

I hear you. The problem is that it doesn't make architectural sense for a qa_db_* function to do anything other than access the database. The problem arose because I didn't originally think ahead enough to create an app-level blob reading function, separate from the database one - sorry about that.

My best suggestion is to update the plugin to use code like this:

require_once QA_INCLUDE_DIR.'qa-app-blobs.php';
require_once QA_INCLUDE_DIR.'qa-db-blobs.php';

$content=function_exists('qa_read_blob') ? qa_read_blob($blobid) : qa_db_blob_read($blobid);

That way it will be compatible from Q2A 1.4 to 1.6 and beyond.

by
Thank you gid. I coped by function_exists() immediately after this question. I'm sorry, I should have reported having solved by myself...
...