Welcome Guest, Not a member yet? Register   Sign In
Two Applications -- Shared Config, Helpers ...
#1

[eluser]davste[/eluser]
Greetings, fellow Igniters.

I have come across a tiny (correction: huge) problem. I have to separate application folders respectively called "private" and "public". This is to differentiate between the administration area and the public area (D'oh).

Oh, yes, I also have two PHP files in ROOT, "index.php" and "admin.php" (loads application respectively).

However, both these applications takes use of the same database, and often uses the same helpers (custom, not part of CI). So, instead of duplicating configs, helpers, libraries and such twice, is there no other way to "share" these?

Of course, I do not want to share controllers, models, modules and views. Only the ones that overlap across the applications.

E.g. something like this, perhaps?
Code:
public/
private/
<shared application folder>/
system/
index.php
admin.php
Thanks, best regards from Norway.
#2

[eluser]Colin Williams[/eluser]
Put the custom helpers in system/helpers. And for sharing config stuff, there are amazing things you can do with include() and require()
#3

[eluser]Dam1an[/eluser]
[quote author="Colin Williams" date="1244452187"]And for sharing config stuff, there are amazing things you can do with include() and require()[/quote]

It never ceases to amaze me that people forget they can use normal PHP with CI (and thats not meant as an insult at davste or this particular problem in particular)
#4

[eluser]davste[/eluser]
Aight, then. I though I was going to get some nice hacks or something, but this is just simple. Thanks.
#5

[eluser]Dam1an[/eluser]
Well you could come up with an elaborate hack which would move config to the system, and then overwrite any application specific thing in the application config, but what would involve a fair bit of hacking at the core (well, enough to make it not worthwhile IMO)
#6

[eluser]wiredesignz[/eluser]
Modular Extensions HMVC allows for everything your require. These dummies just don't realize it.
#7

[eluser]Dam1an[/eluser]
[quote author="wiredesignz" date="1244480947"]Modular Extensions HMVC allows for everything your require. These dummies just don't realize it.[/quote]

This 'dummy' doesn't use HMVC so has no way to know
#8

[eluser]wiredesignz[/eluser]
Well maybe you should before you comment otherwise.
#9

[eluser]Dam1an[/eluser]
In my defense, I'm pretty sure the question changed slightly since when I first replied
Before, it was just about accessing the variables in the config file outside that application

Also, does this mean I should read up on every single library before answering any more posts? Tongue
#10

[eluser]wiredesignz[/eluser]
Yes Damian, if you want to give SOLID advice you need to review everything.




Theme © iAndrew 2016 - Forum software by © MyBB