Issue #1933540 by SylvainM: Bad call to Watchdog in stage_file_proxy_init
[project/stage_file_proxy.git] / INSTALL.txt
1 Enable the module.
2
3 To use Stage File Proxy, you must add variables to $conf in settings.php:
4
5 REQUIRED:
6 =========
7
8 The origin website. 
9
10 $conf['stage_file_proxy_origin'] = 'http://example.com'; // no trailing slash
11
12 If the site is using HTTP Basic Authentication (the browser popup for username
13 and password) you can embed those in the url. Be sure to URL encode any 
14 special characters:
15
16 For a username of myusername and password letme&in the configuration would be:
17
18 $conf['stage_file_proxy_origin'] = 'http://myusername:letme%26in@example.com';
19
20 OPTIONAL
21 ========
22 $conf['stage_file_proxy_use_imagecache_root'] = TRUE;
23
24 Default is TRUE.
25
26 If this is true (default) then Stage File Proxy will look for /imagecache/ in
27 the URL and determine the original file and request that rather than the
28 processed file, then send a header to the browser to refresh the image and let
29 imagecache handle it. This will speed up future imagecache requests for the
30 same original file.
31
32 $conf['stage_file_proxy_hotlink'] = FALSE;
33
34 Default is FALSE.
35
36 If this is true then Stage File Proxy will not transfer the remote file to the
37 local machine, it will just serve a 301 to the remote file and let the origin
38 webserver handle it.
39
40 $conf['stage_file_proxy_origin_dir'] = 'sites/default/files';
41
42 Default is 'sites/default/files';
43
44 If this is set then Stage File Proxy will use a different path for the remote
45 files. This is useful for multisite installations where the sites directory
46 contains different names for each url. If this is not set, it defaults to the
47 same path as the local site (sites/default/files).
48
49 $conf['stage_file_proxy_sslversion'] = 3;
50
51 Default is 3.
52
53 CURL will try to figure out which ssl version to use, but if it fails to do that
54 properly it can lead to getting an empty file and a 0 status code. The default is
55 3 which seems relatively common, but if you get 0 byte files you can try changing
56 it to 2.
57
58 DRUSH USERS
59 ===========
60
61 To automatically enable stage_file_proxy on your dev machine after sql-sync,
62 add the following to your dev site alias file:
63
64   $aliases['dev'] = array (
65     'root' => '/path/to/drupalroot',
66     'uri' => 'http://example.org',
67     'target-command-specific' => array(
68       'sql-sync' => array(
69         'enable' => array('stage_file_proxy'),
70       ),
71     ),
72   );
73
74 In order for this to work, you must copy the file
75 drush/examples/sync_enable.drush.inc to your ~/.drush folder.
76 For more informatoin, see:
77
78 http://drupalcode.org/project/drush.git/blob/HEAD:/examples/sync_enable.drush.inc