Re: Having configuration-data in a package with multiple instances of the same app

Han Do Jin <[email protected]> Wed, 18 Dec 2019 17:41:57 -0800
Newsgroups gmane.comp.web.mason.user
Message-ID <CADBG4qW4jfJ7prTXRd1e4gkGyFZnVd_BLc7G5zpkHfDowKh5sQ@mail.gmail.com>
--===============1374778507512108774==
Content-Type: multipart/alternative; boundary="0000000000005b9c1c059a04ab45"

--0000000000005b9c1c059a04ab45
Content-Type: text/plain; charset="UTF-8"

Can you show us your autohandler? I think maybe you should be using <%attr>
to affect a shared template rather than put configs into a shared library.
I'm guessing when you say you want same application 2nd time on same server
that they are both running in the same apache instance? I run multiple
sites (virtualhosts) on the same apache instance and use a few techniques
for altering the core/shared master template as well as which database to
connect to. Let's see what you are trying to accomplish and I can try and
offer you some more concrete examples.

Chris


On Wed, Dec 18, 2019 at 5:16 PM [email protected] <[email protected]>
wrote:

> Hello!
>
> I am new to Mason and have a little problem in having the same
> application (but with different configuration) multiple times on a
> server in different paths.
> Think the problem is because of the global scope of packages.
>
> I have the configuation data in a package - lets say MyConfig.
>
> e.g.
> package MyConfig;
>
> sub getColor
> {
>      return "red";
> }
>
> 1;
>
> I load it in the autohandler and via MyConfig::getColor () it is
> available in all parts of the application.
>
> Lets say I wanna have the same application a 2nd time on the same server
> but with a different color.
> So both applications would have the same files but MyConfig.pm differs.
>
> That does not work. The color get mixed up unless I do not have unique
> names for the config-package (e.g. MyConfig1 in the 1st application and
> MyConfig2 in the 2nd) again.
> Thats not great because I also need to change every appearence of
> MyConfig::getColor () to the new name.
>
> Is there a way I can bring such static configuration data in the
> application in a more elegant way?
>
> Thanks for help!
> Chris
>
>
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users
>

--0000000000005b9c1c059a04ab45
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Can you show us your autohandler? I think maybe you s=
hould be using &lt;%attr&gt; to affect a shared template rather than put co=
nfigs into a shared library. I&#39;m guessing when you say you want same ap=
plication 2nd time on same server that they are both running in the same ap=
ache instance? I run multiple sites (virtualhosts) on the same apache insta=
nce and use a few techniques for altering the core/shared master template a=
s well as which database to connect to. Let&#39;s see what you are trying t=
o accomplish and I can try and offer you some more concrete examples.</div>=
<div><br></div><div>Chris</div><div><br></div></div><br><div class=3D"gmail=
_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 18, 2019 at 5:16 =
PM <a href=3D"mailto:[email protected]">[email protected]</a> &lt;<a href=
=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
I am new to Mason and have a little problem in having the same <br>
application (but with different configuration) multiple times on a <br>
server in different paths.<br>
Think the problem is because of the global scope of packages.<br>
<br>
I have the configuation data in a package - lets say MyConfig.<br>
<br>
e.g.<br>
package MyConfig;<br>
<br>
sub getColor<br>
{<br>
=C2=A0=C2=A0=C2=A0=C2=A0 return &quot;red&quot;;<br>
}<br>
<br>
1;<br>
<br>
I load it in the autohandler and via MyConfig::getColor () it is <br>
available in all parts of the application.<br>
<br>
Lets say I wanna have the same application a 2nd time on the same server <b=
r>
but with a different color.<br>
So both applications would have the same files but MyConfig.pm differs.<br>
<br>
That does not work. The color get mixed up unless I do not have unique <br>
names for the config-package (e.g. MyConfig1 in the 1st application and <br=
>
MyConfig2 in the 2nd) again.<br>
Thats not great because I also need to change every appearence of <br>
MyConfig::getColor () to the new name.<br>
<br>
Is there a way I can bring such static configuration data in the <br>
application in a more elegant way?<br>
<br>
Thanks for help!<br>
Chris<br>
<br>
<br>
_______________________________________________<br>
Mason-users mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Maso=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/mason-users" rel=3D=
"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo=
/mason-users</a><br>
</blockquote></div>

--0000000000005b9c1c059a04ab45--


--===============1374778507512108774==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1374778507512108774==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

--===============1374778507512108774==--