Line 52: | Line 52: | ||
# Rename ckfinder_v1.js to ckfinder.js | # Rename ckfinder_v1.js to ckfinder.js | ||
# In ckfinder.html change: <br><br><source><script type="text/javascript" src="ckfinder.js"></script></source> into <br><br> <source><script type="text/javascript" src="ckfinder_v2.js"></script></source> | # In ckfinder.html change: <br><br><source><script type="text/javascript" src="ckfinder.js"></script></source> into <br><br> <source><script type="text/javascript" src="ckfinder_v2.js"></script></source> | ||
− | |||
− |
Revision as of 14:54, 31 May 2010
Upgrading CKFinder is very easy, below you'll find a complete instruction how to do it.
Contents
Upgrading instructions
- Download the new version of CKFinder from the CKFinder website.
- Backup your old copy of CKFinder in a safe place.
- Temporarily disable access to CKFinder for all users in your application.
- Delete all files from CKFinder folder (remember to not delete the "userfiles" folder if you have configured CKFinder to store files there).
- Unpack new CKFinder in the folder where old CKFinder was installed.
- Apply changes from the old configuration file to the new configuration file shipped with CKFinder (most of the time, you can simply use the old configuration file).
- (Optional) In you application, add a timestamp to a path to ckfinder.js to help browsers recognize that the new version of file is available, e.g.:
<script type="text/javascript" src="/ckfinder/ckfinder.js?t=20100601"></script>
- Make some simple tests to ensure that CKFinder is running fine.
- Enable access to CKFinder for all users in your application.
Upgrading from CKFinder 1.x
When using the server side integration method, no code changes are required when upgrading from CKFinder 1.x to 2.x. However, when using JavaScript integration, some small modifications are needed, please read below.
Method 1
In CKFinder 2.x we have made a small changes to the JavaScript API to conform to CKEditor coding standards. The JavaScript methods now begin with a lower case letter. The following code used in CKFinder 1.x:
var finder = new CKFinder(); finder.BasePath = '/ckfinder/'; finder.SelectFunction = ShowFileInfo; finder.Create();
should be changed in CKFinder 2.x into:
var finder = new CKFinder(); finder.basePath = '/ckfinder/'; finder.selectFunction = ShowFileInfo; finder.create();
Method 2
Alternatively, you may simply include ckfinder_v1.js instead of ckfinder.js in your application to not worry about changes in the API . ckfinder_v1.js contains a comptibility pack that makes ugrading from 1.x even easier thanks to bringing back old function names used in CKFinder 1.x.
This method of upgrading is not the same as the first method. When using ckfinder_v1.js, an extra file named ckfinder.html is used to create CKFinder instance, for better performance the first method should be used instead.
Method 3
This method is similar to method (2), but does not require any changes in existing applications. Instead, we just rename some files from CKFinder package.
- Rename ckfinder.js to ckfinder_v2.js
- Rename ckfinder_v1.js to ckfinder.js
- In ckfinder.html change:
<script type="text/javascript" src="ckfinder.js"></script>
into
<script type="text/javascript" src="ckfinder_v2.js"></script>