Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ########################## |
| 2 | Managing your Applications |
| 3 | ########################## |
| 4 | |
| 5 | By default it is assumed that you only intend to use CodeIgniter to |
| 6 | manage one application, which you will build in your application/ |
| 7 | directory. It is possible, however, to have multiple sets of |
| 8 | applications that share a single CodeIgniter installation, or even to |
| 9 | rename or relocate your application folder. |
| 10 | |
| 11 | Renaming the Application Folder |
| 12 | =============================== |
| 13 | |
| 14 | If you would like to rename your application folder you may do so as |
| 15 | long as you open your main index.php file and set its name using the |
| 16 | $application_folder variable:: |
| 17 | |
| 18 | $application_folder = "application"; |
| 19 | |
| 20 | Relocating your Application Folder |
| 21 | ================================== |
| 22 | |
| 23 | It is possible to move your application folder to a different location |
| 24 | on your server than your system folder. To do so open your main |
| 25 | index.php and set a *full server path* in the $application_folder |
| 26 | variable. |
| 27 | |
| 28 | :: |
| 29 | |
| 30 | $application_folder = "/Path/to/your/application"; |
| 31 | |
| 32 | Running Multiple Applications with one CodeIgniter Installation |
| 33 | =============================================================== |
| 34 | |
| 35 | If you would like to share a common CodeIgniter installation to manage |
| 36 | several different applications simply put all of the directories located |
| 37 | inside your application folder into their own sub-folder. |
| 38 | |
| 39 | For example, let's say you want to create two applications, "foo" and |
| 40 | "bar". You could structure your application folders like this:: |
| 41 | |
Derek Jones | a1360ef | 2011-10-05 17:22:53 -0500 | [diff] [blame] | 42 | applications/foo/ |
| 43 | applications/foo/config/ |
| 44 | applications/foo/controllers/ |
| 45 | applications/foo/errors/ |
| 46 | applications/foo/libraries/ |
| 47 | applications/foo/models/ |
| 48 | applications/foo/views/ |
| 49 | applications/bar/ |
| 50 | applications/bar/config/ |
| 51 | applications/bar/controllers/ |
| 52 | applications/bar/errors/ |
| 53 | applications/bar/libraries/ |
| 54 | applications/bar/models/ |
| 55 | applications/bar/views/ |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 56 | |
| 57 | To select a particular application for use requires that you open your |
| 58 | main index.php file and set the $application_folder variable. For |
| 59 | example, to select the "foo" application for use you would do this:: |
| 60 | |
| 61 | $application_folder = "applications/foo"; |
| 62 | |
| 63 | .. note:: Each of your applications will need its own index.php file |
| 64 | which calls the desired application. The index.php file can be named |
| 65 | anything you want. |