Managing your Applications

By default it is assumed that you only intend to use revIgniter to manage one application, which you will build in your system/application/ directory. It is possible, however, to have multiple sets of applications that share a single revIgniter installation, or even to rename or relocate your application folder.

Renaming the Application Folder

If you would like to rename your application folder you may do so as long as you open your main index.irev file and set its name using the gApplicationFolder variable:

put "application" into gApplicationFolder

Relocating your Application Folder

It is possible to move your application folder to a different location on your server than your system folder. To do so open your main index.irev and set a full server path in the gApplicationFolder variable.

put "/Path/to/your/application" into gApplicationFolder

Running Multiple Applications with one revIgniter Installation

If you would like to share a common revIgniter installation to manage several different applications simply put all of the directories located inside your application folder into their own sub-folder.

For example, let's say you want to create two applications, "foo" and "bar". You will structure your application folder like this:

system/application/foo/
system/application/foo/config/
system/application/foo/controllers/
system/application/foo/errors/
system/application/foo/helpers/
system/application/foo/hooks/
system/application/foo/index.html
system/application/foo/language/
system/application/foo/libraries/
system/application/foo/models/
system/application/foo/plugins/
system/application/foo/views/
system/application/bar/
system/application/bar/config/
system/application/bar/controllers/
system/application/bar/errors/
system/application/bar/helpers/
system/application/bar/hooks/
system/application/bar/index.html
system/application/bar/language/
system/application/bar/libraries/
system/application/bar/models/
system/application/bar/plugins/
system/application/bar/views/

To select a particular application for use requires that you open your main front controller, the index.irev file, and set the gApplicationFolder variable. For example, to select the "foo" application for use you would do this:

put "application/foo" into gApplicationFolder

To set the gApplicationFolder variable for the "bar" application you need another front controller located at document root. Let's name it bar.irev. The corresponding setting should read like this:

put "application/bar" into gApplicationFolder

Note:  Each of your applications will need its own index.irev file which calls the desired application. The index.irev file can be named anything you want.

To exclude index.irev and bar.irev from your URLs you need to modify the mod_rewrite rules explained in revIgniter URLs like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.irev|bar\.irev|image|img|assets|robots\.txt|css|js|bar)
RewriteRule ^(.*)$ index.irev?/$1 [L]

RewriteCond $1 !^(bar\.irev|index\.irev|image|img|assets|robots\.txt|css|js)
RewriteRule ^bar/?$ bar.irev?/ [L]
RewriteRule ^(bar)/(.*)$ bar.irev?/$2 [L]
</IfModule>

Now, assuming the name of your default controllers is "welcome.irev", the URLs of your applications look like this:

http://www.MyDomain.com/ refers to http://www.MyDomain.com/index.irev/welcome.irev
http://www.MyDomain.com/bar/ refers to http://www.MyDomain.com/bar.irev/welcome.irev