Welcome Guest, Not a member yet? Register   Sign In
Multiple Applications
#1

[eluser]Unknown[/eluser]
Hello

I'm new to CI and MVC. I'm using CI 1.7.1 on XP with Apache 2.0, PHP ver 4.4.2 on my own PC. I will upgrade to PHP 5 shortly. However, I'm trying to get a grasp on the whole URL segment stuff just now. I have read the user guide section - http://ellislab.com/codeigniter/user-gui..._apps.html - but am still none the wiser about running 2 different apps. This doc mentions

"To select a particular application for use requires that you open your main index.php file and set the $application_folder variable. For example, to select the "foo" application for use you would do this: $application_folder = "application/foo";" What is the "main INDEX.PHP" file mentioned? Is this the file at the CI root?

I have setup 2 folders called "test" and "test2", and changed the database.php within these folders to point to 2 different MySQL databases. I have changed the $application_folder in the "main INDEX.PHP" to "application/test" and test using - http://localhost/CodeIgniter_1.7.1/index.php - works ok.

If I then change the $application_folder in the "main INDEX.PHP" to "application/test2" and test using - http://localhost/CodeIgniter_1.7.1/index.php - works ok.

A note at the bottom of this page says:
"Note: Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want."

I assumed this meant that each index.php at the application/test folder could be changed to point to the correct place. In which case, what would the URL look like?

Hope this isn't too long winded an explanation, but I seem to have a mental block on this subject.

Thanks for any help.
#2

[eluser]Dam1an[/eluser]
If you make 2 copies of index.php, and call one test.php and the other test2.php, and make the application paths point to the test/test2 folders in application respectivly

You can then see each site when you go to
http://localhost/CodeIgniter_1.7.1/test.php
and
http://localhost/CodeIgniter_1.7.1/test2.php
#3

[eluser]jedd[/eluser]
Hi daveboy and welcome to the CI forums.

Quote:I'm new to CI and MVC. I'm using CI 1.7.1 on XP with Apache 2.0, PHP ver 4.4.2 on my own PC. I will upgrade to PHP 5 shortly. However, I'm trying to get a grasp on the whole URL segment stuff just now. I have read the user guide section - http://ellislab.com/codeigniter/user-gui..._apps.html - but am still none the wiser about running 2 different apps.

Keeping in mind that a full CI installation is something less than 3MB - ie, two floppy disks in oldspeak, or US$0.000027 in actual cost of storage - you are probably best advised to install two totally separate directory structures under your web server's root, unpack a clean CI tarball to each, then continue to manage them as completely separate entities.

There are some reasons for sharing a CI installation between several applications, but if you're just starting with this stuff it t seems highly unlikely that any of them would be appropriate here.

At the moment I'd suggest your goal should be to reduce potential points of confusion, not eagerly seek out new ones. Wink
#4

[eluser]Unknown[/eluser]
Dam1an:

Thanks for the quick reply. I tried this out and it worked just fine. Many thanks. I'm sure this won't be my last question here!! I do appreciate your help.


Jedd:
Quote:Keeping in mind that a full CI installation is something less than 3MB - ie, two floppy disks in oldspeak, or US$0.000027 in actual cost of storage - you are probably best advised to install two totally separate directory structures under your web server's root, unpack a clean CI tarball to each, then continue to manage them as completely separate entities.

There are some reasons for sharing a CI installation between several applications, but if you're just starting with this stuff it t seems highly unlikely that any of them would be appropriate here.

At the moment I'd suggest your goal should be to reduce potential points of confusion, not eagerly seek out new ones. Wink

I take your points on board, one of the reasons to try CI was because of the small footprint. The reason I was thinking for only having one installation, was to make it easier to upgrade when a new version is released.

Thanks again for you quick reply.




Theme © iAndrew 2016 - Forum software by © MyBB