| 1 |
// $Id: README.txt,v 1.4 2008/01/06 23:39:52 wimleers Exp $
|
| 2 |
|
| 3 |
Applying the Drupal core patch
|
| 4 |
------------------------------
|
| 5 |
|
| 6 |
You *must* apply this patch!
|
| 7 |
|
| 8 |
First, change the directory to the Drupal root directory.
|
| 9 |
|
| 10 |
You can apply the included Drupal core patch like this:
|
| 11 |
patch -p0 < drupal_core_cdn_integration.patch
|
| 12 |
|
| 13 |
To undo the patch:
|
| 14 |
patch -p0 -R < drupal_core_cdn_integration.patch
|
| 15 |
|
| 16 |
Note: there is also a patch that combines the CDN integration core patch with
|
| 17 |
the JS aggregation. It's included in this module because if you apply both
|
| 18 |
patches separately, you will get a conflict.
|
| 19 |
|
| 20 |
|
| 21 |
Applying the theme patch
|
| 22 |
------------------------
|
| 23 |
|
| 24 |
You *must* apply this patch to *every* theme that's being used on your website!
|
| 25 |
|
| 26 |
Repeat this process for every theme: first, change the directory to the
|
| 27 |
directory of the theme. Applying the patch is identical to the example above,
|
| 28 |
only with a different filename.
|
| 29 |
|
| 30 |
|
| 31 |
Setting up CDN sync filters
|
| 32 |
---------------------------
|
| 33 |
- paths: This is an array of paths (each path being relative to the Drupal
|
| 34 |
root directory) on which this filter should be applied.
|
| 35 |
- pattern: A regular expression that will be used to filter the files in each
|
| 36 |
directory. Like the $mask parameter in file_scan_directory().
|
| 37 |
- ignored_dirs: An array of directories that should be ignored in each
|
| 38 |
directory. Like the $nomask parameter in file_scan_directory().
|
| 39 |
- unique: Determines how the uniqueness will be applied. You can set it to
|
| 40 |
'filename', which will alter the filename, or 'common parent
|
| 41 |
directory', which will alter the path of the file. The latter is
|
| 42 |
strongly recommended for themes, since it will not break URLs in
|
| 43 |
CSS files.
|
| 44 |
- unique_method: The method that should be used to generate unique filenames.
|
| 45 |
Currently supported: 'mtime' (the file's mtime property),
|
| 46 |
'md5' (md5 hash of the file) or 'md5 of mtimes' (md5 hash of
|
| 47 |
the concatenated mtimes of a set of files). This last option
|
| 48 |
is only available if you have set the unique property to
|
| 49 |
'common parent directory'.
|
| 50 |
|
| 51 |
|
| 52 |
Configuring the $conf array in settings.php
|
| 53 |
-------------------------------------------
|
| 54 |
|
| 55 |
This is my configuration:
|
| 56 |
|
| 57 |
$conf = array(
|
| 58 |
'cdn_url' => 'http://wimleers.cachefly.com/wimleers.com',
|
| 59 |
'cdn_sync_filters' => array(
|
| 60 |
'cdn_sync_filters' => array(
|
| 61 |
0 => array(
|
| 62 |
'paths' => array('misc', 'profiles', 'modules', 'sites/all/modules', 'sites/default/modules'),
|
| 63 |
'pattern' => '.*\.(js|css|gif|png|jpg|jpeg|svg|swf)$',
|
| 64 |
'ignored_dirs' => array('CVS'),
|
| 65 |
'unique' => 'filename',
|
| 66 |
'unique_method' => 'mtime',
|
| 67 |
),
|
| 68 |
1 => array(
|
| 69 |
'paths' => array('sites/wimleers.com/files'),
|
| 70 |
'pattern' => '.*',
|
| 71 |
'ignored_dirs' => array('CVS', 'css'),
|
| 72 |
'unique' => 'filename',
|
| 73 |
'unique_method' => 'mtime',
|
| 74 |
),
|
| 75 |
2 => array(
|
| 76 |
'paths' => array('sites/wimleers.com/files/css'),
|
| 77 |
'pattern' => '.*',
|
| 78 |
'ignored_dirs' => array('CVS'),
|
| 79 |
'unique' => 'filename',
|
| 80 |
'unique_method' => 'mtime',
|
| 81 |
'update_urls_in_files' => TRUE,
|
| 82 |
),
|
| 83 |
3 => array(
|
| 84 |
'paths' => array('sites/default/themes/garland-customized'),
|
| 85 |
'pattern' => '.*\.(js|css|gif|png|jpg|jpeg|otf)$',
|
| 86 |
'ignored_dirs' => array('CVS'),
|
| 87 |
'unique' => 'common parent directory',
|
| 88 |
'unique_method' => 'md5 of mtimes',
|
| 89 |
),
|
| 90 |
),
|
| 91 |
'cdn_sync_method' => 'ftp',
|
| 92 |
'cdn_sync_method_settings' => array(
|
| 93 |
'host' => 'ftp.cachefly.com',
|
| 94 |
'remote_path' => 'wimleers.com',
|
| 95 |
'port' => 21,
|
| 96 |
'user' => 'user',
|
| 97 |
'pass' => 'pass',
|
| 98 |
),
|
| 99 |
);
|