changed git call from https to git readonly
[atutor.git] / mods / wiki / fragments / patches / binarystoredirect
1 OBSOLETED: This patch is now worthless, cause there is now the possibility
2 to just set the EWIKI_DB_STORE_URL constant, so ewiki_script_binary() will
3 automatically take care and generate URLs directly to the binary_store data
4 directory then.
5
6 ---------------------------------------------------------------------------
7
8 If you use the plugins/binary_store.php to save binary files outside of the
9 SQL or dbff database, and you additionally store those plain files at a
10 location which is accessible via your webserver, then you will find it
11 useful to let ewiki generate URLs directly to there.
12 This means binary stuff like images is kept separate from the database and
13 can thus be accessed by the http clients directly. If you however direct
14 them directly to the stored files, you will loose some advantages of the
15 ewiki ?binary= code, like the Content-Type headers for example (you should
16 work around that by telling your webserver to utilize mime_magic for all
17 files in that binary_store directory).
18
19
20 - edit ewiki.php
21 - find the "function ewiki_script_binary("
22 - add after the line "$url = ewiki_script(..." following:
23
24       if (!$upload) {
25         $url = "http://www.mywikiserver.net/wiki/files/binary_store/"
26                . rawurlencode($id);
27       }
28
29 - fin
30
31 The above example assumes, that you directed the "binary_store" plugin to
32 save your binary files as is in the "/wiki/files/binary_store/" subdirectory
33 (see also your EWIKI_DB_STORE_DIRECTORY constant).
34
35 This is an example and will not work if you do copy&paste without changing
36 the example url and path string. There is no support for this patch.
37