blob: 3ca0e03a731ee2b842a62d35aeec2b912c190734 [file] [log] [blame]
Derek Jones8ede1a22011-10-05 13:34:52 -05001##########################
2Managing your Applications
3##########################
4
5By default it is assumed that you only intend to use CodeIgniter to
Andrey Andreev16a704c2012-11-09 17:25:00 +02006manage one application, which you will build in your *application/*
Derek Jones8ede1a22011-10-05 13:34:52 -05007directory. It is possible, however, to have multiple sets of
8applications that share a single CodeIgniter installation, or even to
Andrey Andreev16a704c2012-11-09 17:25:00 +02009rename or relocate your application directory.
Derek Jones8ede1a22011-10-05 13:34:52 -050010
Andrey Andreev16a704c2012-11-09 17:25:00 +020011Renaming the Application Directory
Derek Jones8ede1a22011-10-05 13:34:52 -050012==================================
13
Andrey Andreev16a704c2012-11-09 17:25:00 +020014If you would like to rename your application directory you may do so
15as long as you open your main index.php file and set its name using
16the ``$application_folder`` variable::
Derek Jones8ede1a22011-10-05 13:34:52 -050017
Andrey Andreev16a704c2012-11-09 17:25:00 +020018 $application_folder = 'application';
Derek Jones8ede1a22011-10-05 13:34:52 -050019
Andrey Andreev16a704c2012-11-09 17:25:00 +020020Relocating your Application Directory
21=====================================
22
23It is possible to move your application directory to a different
vlakoff52301c72013-03-29 14:23:34 +010024location on your server than your web root. To do so open
Andrey Andreev16a704c2012-11-09 17:25:00 +020025your main index.php and set a *full server path* in the
26``$application_folder`` variable::
27
28 $application_folder = '/path/to/your/application';
Derek Jones8ede1a22011-10-05 13:34:52 -050029
30Running Multiple Applications with one CodeIgniter Installation
31===============================================================
32
33If you would like to share a common CodeIgniter installation to manage
34several different applications simply put all of the directories located
Andrey Andreev16a704c2012-11-09 17:25:00 +020035inside your application directory into their own sub-directory.
Derek Jones8ede1a22011-10-05 13:34:52 -050036
Andrey Andreev16a704c2012-11-09 17:25:00 +020037For example, let's say you want to create two applications, named "foo"
38and "bar". You could structure your application directories like this::
Derek Jones8ede1a22011-10-05 13:34:52 -050039
Derek Jonesa1360ef2011-10-05 17:22:53 -050040 applications/foo/
41 applications/foo/config/
42 applications/foo/controllers/
43 applications/foo/errors/
44 applications/foo/libraries/
45 applications/foo/models/
46 applications/foo/views/
47 applications/bar/
48 applications/bar/config/
49 applications/bar/controllers/
50 applications/bar/errors/
51 applications/bar/libraries/
52 applications/bar/models/
53 applications/bar/views/
Derek Jones8ede1a22011-10-05 13:34:52 -050054
55To select a particular application for use requires that you open your
Andrey Andreev16a704c2012-11-09 17:25:00 +020056main index.php file and set the ``$application_folder`` variable. For
Derek Jones8ede1a22011-10-05 13:34:52 -050057example, to select the "foo" application for use you would do this::
58
Andrey Andreev16a704c2012-11-09 17:25:00 +020059 $application_folder = 'applications/foo';
Derek Jones8ede1a22011-10-05 13:34:52 -050060
61.. note:: Each of your applications will need its own index.php file
62 which calls the desired application. The index.php file can be named
Andrey Andreev16a704c2012-11-09 17:25:00 +020063 anything you want.